[ ] Hex literals (prefixed with 0x) -- case insensitive
[ ] Arbitrary radix (prefixed with N and then r, where N is the radix; e.g. 2r10101 for binary, 16rbadf00d for hex)
We can use std::stol for all of this, which also takes in the radix. We should check the position output param to ensure that the full number was consumed. If not, it's invalid.
Clojure docs: https://www.clojure.org/guides/learn/syntax#_numeric_types
In particular, we need to support the following:
0
)0x
) -- case insensitiver
, where N is the radix; e.g.2r10101
for binary,16rbadf00d
for hex)We can use std::stol for all of this, which also takes in the radix. We should check the
position
output param to ensure that the full number was consumed. If not, it's invalid.