diff options
author | Adrian Thurston <thurston@colm.net> | 2019-11-29 18:21:16 -0800 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2019-11-29 18:21:16 -0800 |
commit | 26698c0cf88015653e2503d0ab5e44f63f77e6fe (patch) | |
tree | 83ac54dc7f548550e3dc1da7160e67ef7b36dfcf /grammar/rust.lm | |
parent | aa76fc8781d820ec6bf42b92dd7a35f65e2e4612 (diff) | |
download | colm-26698c0cf88015653e2503d0ab5e44f63f77e6fe.tar.gz |
rust grammar: partial impl of floats
Diffstat (limited to 'grammar/rust.lm')
-rw-r--r-- | grammar/rust.lm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/grammar/rust.lm b/grammar/rust.lm index 45e01d73..ad6d25d8 100644 --- a/grammar/rust.lm +++ b/grammar/rust.lm @@ -31,9 +31,17 @@ lex ( ( 'u' | 'i' ) [a-z0-9]+ )? / + rl float_exponent + / ( [eE] [+\-]? [0-9_]* [0-9] [0-9_]* )? / + + rl float_suffix + / ( 'f32' | 'f64' )? / + + # Not implemented: DEC_LITERAL . (not immediately followed by ., _ or an identifier) token float/ - [0-9]+ '.' [0-9]+ - ( 'f32' | 'f64' )? + [0-9]+ float_exponent | + [0-9]+ '.' [0-9]+ float_exponent? | + [0-9]+ ( '.' [0-9]+ )? float_exponent? float_suffix / token raw_string / |