Skip to content

Commit f175854

Browse files
committed
---
yaml --- r: 216207 b: refs/heads/stable c: e3d00a4 h: refs/heads/master i: 216205: 3c90b0e 216203: 4eeb343 216199: ed30102 216191: 1beccef v: v3
1 parent 28abe1f commit f175854

40 files changed

+1047
-626
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 07cc7d9960a1bc767dc051b9fae0c7ad2b5cd97f
32+
refs/heads/stable: e3d00a49803fa75580b912463666d86ce2ee3bb8
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/src/doc/grammar.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,19 @@ token : simple_token | ident | literal | symbol | whitespace token ;
152152

153153
<p id="keyword-table-marker"></p>
154154

155-
| | | | | |
156-
|----------|----------|----------|----------|--------|
157-
| abstract | alignof | as | become | box |
158-
| break | const | continue | crate | do |
159-
| else | enum | extern | false | final |
160-
| fn | for | if | impl | in |
161-
| let | loop | match | mod | move |
162-
| mut | offsetof | once | override | priv |
163-
| proc | pub | pure | ref | return |
164-
| sizeof | static | self | struct | super |
165-
| true | trait | type | typeof | unsafe |
166-
| unsized | use | virtual | where | while |
167-
| yield | | | | |
155+
| | | | | |
156+
|----------|----------|----------|----------|---------|
157+
| abstract | alignof | as | become | box |
158+
| break | const | continue | crate | do |
159+
| else | enum | extern | false | final |
160+
| fn | for | if | impl | in |
161+
| let | loop | macro | match | mod |
162+
| move | mut | offsetof | override | priv |
163+
| proc | pub | pure | ref | return |
164+
| Self | self | sizeof | static | struct |
165+
| super | trait | true | type | typeof |
166+
| unsafe | unsized | use | virtual | where |
167+
| while | yield | | | |
168168

169169

170170
Each of these keywords has special meaning in its grammar, and all of them are
@@ -524,6 +524,15 @@ array_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
524524
idx_expr : expr '[' expr ']' ;
525525
```
526526

527+
### Range expressions
528+
529+
```antlr
530+
range_expr : expr ".." expr |
531+
expr ".." |
532+
".." expr |
533+
".." ;
534+
```
535+
527536
### Unary operator expressions
528537

529538
**FIXME:** grammar?
@@ -610,7 +619,7 @@ lambda_expr : '|' ident_list '|' expr ;
610619
### While loops
611620

612621
```antlr
613-
while_expr : "while" no_struct_literal_expr '{' block '}' ;
622+
while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ;
614623
```
615624

616625
### Infinite loops
@@ -634,7 +643,7 @@ continue_expr : "continue" [ lifetime ];
634643
### For expressions
635644

636645
```antlr
637-
for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
646+
for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ;
638647
```
639648

640649
### If expressions

0 commit comments

Comments
 (0)