Define `digit` in formal grammar (#236)

`digit` is used as a subtraction in bare-identifier, but never defined.
This commit is contained in:
Christopher Durham 2022-02-19 04:06:17 -06:00 committed by GitHub
parent 5a566ea5e3
commit 8976e2da68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -452,9 +452,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 | '_')*