rune
rune copied to clipboard
Hex number literals containing `e` are considered invalid
Many hex literals are considered invalid for no obvious reason, while nearly identical literals are accepted.
Edit: e seems to be the common factor, likely related to scientific representation.
$ cargo install rune-cli
Ignored package `rune-cli v0.12.0` is already installed, use --force to override
$ rune -V
rune git-
$ rune run test.rn
error: compile error
┌─ test.rn:3:11
│
3 │ const X = 0x40c61e;
│ ^^^^^^^^ number literal not valid
test.rn:
const X_P = 0x40c61d + 1; // works
const X_M = 0x40c61f - 1; // works
const X = 0x40c61e; // error
const X_E = 0x40c61E; // works
const X_C = 0x40C61e; // error
Oh this definitely looks like a lexing error. Good catch!