From 3e521bfd96597d89dc2f0e8026caf8beee8959d9 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 28 Apr 2015 21:09:28 -0400 Subject: [PATCH] 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 --- src/doc/grammar.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/doc/grammar.md b/src/doc/grammar.md index 4b6790c763b..ad4c0c1711b 100644 --- a/src/doc/grammar.md +++ b/src/doc/grammar.md @@ -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`.