Open MrEbbinghaus opened 2 years ago
I looked at the regex. There are more issues:
0b101010
is not a valid Clojure number. You would write: 2r101010
.0o
prefix.
0
or, more explicit, 8r
(052
8r52
)+
or -
x
and the r
for hexadecimal numbers and radix numbers are case-insensitive. Number {
("+" | "-")? (std.digit+ ("." std.digit* "M"?)? | "." std.digit+) (("e" | "E") ("+" | "-")? std.digit+ "M"?)? |
("+" | "-")? std.digit+ ("M" | "N") |
("+" | "-")? std.digit+ "/" std.digit+ |
("+" | "-")? "0x" (std.digit | $[a-fA-F])+ |
"0b" $[01]+ |
"0o" $[0-7]+
}
Clojure allows for numbers with a radix between 2 and 36. Also, the BigInt
N
suffix is allowed after a hexadecimal number.From https://clojure.org/reference/reader#_literals:
Here are some regex from [clojure.tools.reader] describing all numbers. (https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader/impl/commons.clj#L46-L48)