antimony-lang / antimony

The Antimony programming language
https://antimony-lang.github.io/antimony/
Apache License 2.0
138 stars 6 forks source link

Support for non-standard number system notations #30

Closed garritfra closed 3 years ago

garritfra commented 3 years ago

Binary, Hex and Octal systems should be supported using the following notation:

binary_lit     = "0" ( "b" | "B" ) binary_digits .
octal_lit      = "0" [ "o" | "O" ] octal_digits .
hex_lit        = "0" ( "x" | "X" ) hex_digits .

Examples

5 == 5
5 == 0x5
5 == 0X5
5 == 0o5
5 == 0b101

Golang specifcation can be used as a reference.