Files
mercury/tests/hard_coded/parse_number_from_io.exp
Julien Fischer b3835dd826 Fix bug #430.
The lexer was not allowing underscores between leading zeros in decimal integer
literals and float literals (e.g. 0_0 or 0_0.0).

library/lexer.m:
     Allow underscores in the above cases.

tests/hard_coded/parse_number_from_io.{m,exp,exp2,exp3}:
tests/hard_coded/parse_number_from_string.{m,exp,exp2,exp3}:
     Extend these tests to cover the above cases.

tests/invalid/invalid_binary_literal.err_exp:
tests/invalid/invalid_octal_literal.err_exp:
tests/invalid/invalid_hex_literal.err_exp:
     Conform to the above change.
2017-01-29 14:38:26 +11:00

61 lines
324 B
Plaintext

Decimal:
0
0
0
0
10
-10
10
-10
1
1
-1
-1
Binary:
0
0
1
-1
68
-68
Octal:
511
-511
511
-511
511
-511
511
-511
Hexadecimal:
255
-255
255
-255
255
-255
4095
Float:
0.123
-0.123
0.123
-0.123
1.123
-1.123
12.123
-12.123
12.123
-12.123
12300000000000.0
12300000000000.0
1200000000000.0
1200000000000.0
1.2e-10
1.2e-10
0.0
1.01