Skip to content

Commit 3e521bf

Browse files
committed
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
1 parent d715409 commit 3e521bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/doc/grammar.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ excluded from the `ident` rule.
176176

177177
```antlr
178178
lit_suffix : ident;
179-
literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit ] lit_suffix ?;
179+
literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit | bool_lit ] lit_suffix ?;
180180
```
181181

182182
#### Character and string literals
@@ -238,7 +238,9 @@ dec_lit : [ dec_digit | '_' ] + ;
238238

239239
#### Boolean literals
240240

241-
**FIXME:** write grammar
241+
```antlr
242+
bool_lit : [ "true" | "false" ] ;
243+
```
242244

243245
The two values of the boolean type are written `true` and `false`.
244246

0 commit comments

Comments
 (0)