mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Fixes #6824 - Correct scan_number() grammar
Show `int_suffix_size` to appear 0 or 1 times Show `exponent | . dec_lit` to appear 0 or 1 times, to show why `3f;` is a valid number
This commit is contained in:
parent
2d28d64542
commit
bfe141c4e1
@ -301,10 +301,10 @@ num_lit : nonzero_dec [ dec_digit | '_' ] * num_suffix ?
|
||||
num_suffix : int_suffix | float_suffix ;
|
||||
|
||||
int_suffix : 'u' int_suffix_size ?
|
||||
| 'i' int_suffix_size ;
|
||||
| 'i' int_suffix_size ? ;
|
||||
int_suffix_size : [ '8' | '1' '6' | '3' '2' | '6' '4' ] ;
|
||||
|
||||
float_suffix : [ exponent | '.' dec_lit exponent ? ] float_suffix_ty ? ;
|
||||
float_suffix : [ exponent | '.' dec_lit exponent ? ] ? float_suffix_ty ? ;
|
||||
float_suffix_ty : 'f' [ '3' '2' | '6' '4' ] ;
|
||||
exponent : ['E' | 'e'] ['-' | '+' ] ? dec_lit ;
|
||||
dec_lit : [ dec_digit | '_' ] + ;
|
||||
|
Loading…
Reference in New Issue
Block a user