diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2015-09-03 22:13:50 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2015-09-03 22:13:50 +0300 |
| commit | 83aee74fce004106571cf27c320c117263055cee (patch) | |
| tree | 1338acbdfe347de78eb455da5382c6befcb666ec | |
| parent | 0762f58c1143b4ff0ae5d0cdda9cdd8249512e77 (diff) | |
reference grammar: loop label should be optional
This adds missing `?` marks to productions for loops and break/continue. It also adds missing option label to while let loop
| -rw-r--r-- | src/doc/grammar.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/doc/grammar.md b/src/doc/grammar.md index 3aa89cba031..76f544e1075 100644 --- a/src/doc/grammar.md +++ b/src/doc/grammar.md @@ -636,31 +636,31 @@ lambda_expr : '|' ident_list '|' expr ; ### While loops ```antlr -while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ; +while_expr : [ lifetime ':' ] ? "while" no_struct_literal_expr '{' block '}' ; ``` ### Infinite loops ```antlr -loop_expr : [ lifetime ':' ] "loop" '{' block '}'; +loop_expr : [ lifetime ':' ] ? "loop" '{' block '}'; ``` ### Break expressions ```antlr -break_expr : "break" [ lifetime ]; +break_expr : "break" [ lifetime ] ?; ``` ### Continue expressions ```antlr -continue_expr : "continue" [ lifetime ]; +continue_expr : "continue" [ lifetime ] ?; ``` ### For expressions ```antlr -for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ; +for_expr : [ lifetime ':' ] ? "for" pat "in" no_struct_literal_expr '{' block '}' ; ``` ### If expressions @@ -694,7 +694,7 @@ else_tail : "else" [ if_expr | if_let_expr | '{' block '}' ] ; ### While let loops ```antlr -while_let_expr : "while" "let" pat '=' expr '{' block '}' ; +while_let_expr : [ lifetime ':' ] ? "while" "let" pat '=' expr '{' block '}' ; ``` ### Return expressions |
