errors and warnings / parsing / E0103
E0103 error
Malformed number, including any misuse of _ digit separators
- area
- parsing (x01xx)
- fails the build
- yes
A number literal is malformed, such as 1e, 3..2 or 0xG, or uses a _
digit separator in the wrong place. wowlua allows _ between two digits of
the same run (1_000_000, 0xFF_FF, 3.141_592, 0b1010_1010), but not at
the start or end, twice in a row, or next to ., e, x, b or a sign:
1__0, _1, 1_, 1_.5, 0x_FF and 1e_5 are all E0103.
Example
local maxGold = 1__000_000print(maxGold)local maxGold = 1_000_000print(maxGold)The compiler reports it like this:
error[E0103]: malformed number (misplaced `_` digit separator) near '1__000_000' ┌─ src/main.wowlua:1:17 │ 1 │ local maxGold = 1__000_000 │ ^^^^^^^^^^ here
Offline
$ wowlua explain E0103 E0103 (error): Malformed number, including any misuse of _ digit separators