rune icon indicating copy to clipboard operation
rune copied to clipboard

Hex number literals containing `e` are considered invalid

Open SWW13 opened this issue 3 years ago • 1 comments

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

SWW13 avatar Aug 10 '22 09:08 SWW13

Oh this definitely looks like a lexing error. Good catch!

udoprog avatar Aug 10 '22 12:08 udoprog