Define `digit` in formal grammar

`digit` is used as a subtraction in bare-identifier, but never defined.
This commit is contained in:
Christopher Durham 2021-10-12 20:57:31 -05:00 committed by CAD97
parent e5e131920f
commit 02461380b4
1 changed files with 4 additions and 3 deletions

View File

@ -446,9 +446,10 @@ raw-string-quotes := '"' .* '"'
number := decimal | hex | octal | binary
decimal := integer ('.' [0-9] [0-9_]*)? exponent?
exponent := ('e' | 'E') integer
integer := sign? [0-9] [0-9_]*
decimal := sign? integer ('.' integer)? exponent?
exponent := ('e' | 'E') sign? integer
integer := digit (digit | '_')*
digit := [0-9]
sign := '+' | '-'
hex := sign? '0x' hex-digit (hex-digit | '_')*