mirror of https://github.com/kdl-org/kdl.git
Rearrange the number production to put decimal at the end
While the grammar makes no statements about match order, parsers pretty universally test for decimal last, after the other number productions, because `0b010` (/etc) can look like a `0` followed by garbage. Matching this order can reduce confusion. Closes #330.
This commit is contained in:
parent
a75ca13c15
commit
f3e5ff6027
2
SPEC.md
2
SPEC.md
|
|
@ -484,7 +484,7 @@ raw-string := 'r' raw-string-hash
|
|||
raw-string-hash := '#' raw-string-hash '#' | raw-string-quotes
|
||||
raw-string-quotes := '"' .* '"'
|
||||
|
||||
number := decimal | hex | octal | binary
|
||||
number := hex | octal | binary | decimal
|
||||
|
||||
decimal := sign? integer ('.' integer)? exponent?
|
||||
exponent := ('e' | 'E') sign? integer
|
||||
|
|
|
|||
Loading…
Reference in New Issue