Today 0xff parses as 0 (the parser silently discards the
non-digit suffix). Most modern languages accept hex, octal, and
binary integer literals.
Acceptance criteria
- Lex
0x[0-9a-fA-F_]+, 0o[0-7_]+, 0b[01_]+ as Int.
- Reject malformed forms (
0x, 0xg1, etc.) with a parse error.
- Tests in the parser suite.
Today
0xffparses as0(the parser silently discards thenon-digit suffix). Most modern languages accept hex, octal, and
binary integer literals.
Acceptance criteria
0x[0-9a-fA-F_]+,0o[0-7_]+,0b[01_]+asInt.0x,0xg1, etc.) with a parse error.