Add boolean literal to the grammar

To make this rule match the definition of Lit_ in
https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs
This commit is contained in:
Carol (Nichols || Goulding) 2015-04-28 21:09:28 -04:00 committed by Carol Nichols
parent d715409736
commit 3e521bfd96

View File

@ -176,7 +176,7 @@ excluded from the `ident` rule.
```antlr
lit_suffix : ident;
literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit ] lit_suffix ?;
literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit | bool_lit ] lit_suffix ?;
```
#### Character and string literals
@ -238,7 +238,9 @@ dec_lit : [ dec_digit | '_' ] + ;
#### Boolean literals
**FIXME:** write grammar
```antlr
bool_lit : [ "true" | "false" ] ;
```
The two values of the boolean type are written `true` and `false`.