fram-lang / fram-lang/dbl

Lexer doesn't recognize Int64 minimal value

Open
#340 1 comment 0 reactions 0 assignees View on GitHub
0. parsing
Dominant language
OCaml
Stars
45
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Writing `Int64` minimal value `-9223372036854775808L` gets you an out of bounds error as the absolute value exceeds the max value of `Int64`.

```sh
> let a = -9223372036854775808L ;;
fatal error: Integer literal 9223372036854775808 exceeds the representable range
| let a = -9223372036854775808L ;;
| ^^^^^^^^^^^^^^^^^^^
|
> let a = -9223372036854775807L - 1L ;;
> a ;;
: Int64
= -9223372036854775808L
>
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported REPL input `let a = -9223372036854775808L ;;` and inspect the lexer’s integer-literal handling. Compare it with the working `-9223372036854775807L - 1L` form; done means the minimal Int64 literal is accepted and evaluates to `-9223372036854775808L` without the out-of-bounds error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.