@@ -96,12 +96,16 @@ explicit codepoint lists. [^inputformat]
96
96
## Special Unicode Productions
97
97
98
98
The following productions in the Rust grammar are defined in terms of Unicode
99
- properties: ` ident ` , ` non_null ` , ` non_star ` , ` non_eol ` , ` non_slash_or_star ` ,
100
- ` non_single_quote ` and ` non_double_quote ` .
99
+ properties: ` ident ` , ` non_null ` , ` non_eol ` , ` non_single_quote ` and
100
+ ` non_double_quote ` .
101
101
102
102
### Identifiers
103
103
104
- The ` ident ` production is any nonempty Unicode string of the following form:
104
+ The ` ident ` production is any nonempty Unicode[ ^ non_ascii_idents ] string of
105
+ the following form:
106
+
107
+ [ ^ non_ascii_idents ] : Non-ASCII characters in identifiers are currently feature
108
+ gated. This is expected to improve soon.
105
109
106
110
- The first character has property ` XID_start `
107
111
- The remaining characters have property ` XID_continue `
@@ -118,8 +122,6 @@ Some productions are defined by exclusion of particular Unicode characters:
118
122
119
123
- ` non_null ` is any single Unicode character aside from ` U+0000 ` (null)
120
124
- ` non_eol ` is ` non_null ` restricted to exclude ` U+000A ` (` '\n' ` )
121
- - ` non_star ` is ` non_null ` restricted to exclude ` U+002A ` (` * ` )
122
- - ` non_slash_or_star ` is ` non_null ` restricted to exclude ` U+002F ` (` / ` ) and ` U+002A ` (` * ` )
123
125
- ` non_single_quote ` is ` non_null ` restricted to exclude ` U+0027 ` (` ' ` )
124
126
- ` non_double_quote ` is ` non_null ` restricted to exclude ` U+0022 ` (` " ` )
125
127
@@ -152,19 +154,19 @@ token : simple_token | ident | literal | symbol | whitespace token ;
152
154
153
155
<p id =" keyword-table-marker " ></p >
154
156
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 | | | | |
157
+ | | | | | |
158
+ | ----------| ----------| ----------| ----------| --------- |
159
+ | abstract | alignof | as | become | box |
160
+ | break | const | continue | crate | do |
161
+ | else | enum | extern | false | final |
162
+ | fn | for | if | impl | in |
163
+ | let | loop | macro | match | mod |
164
+ | move | mut | offsetof | override | priv |
165
+ | proc | pub | pure | ref | return |
166
+ | Self | self | sizeof | static | struct |
167
+ | super | trait | true | type | typeof |
168
+ | unsafe | unsized | use | virtual | where |
169
+ | while | yield | | | |
168
170
169
171
170
172
Each of these keywords has special meaning in its grammar, and all of them are
@@ -524,6 +526,15 @@ array_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
524
526
idx_expr : expr '[' expr ']' ;
525
527
```
526
528
529
+ ### Range expressions
530
+
531
+ ``` antlr
532
+ range_expr : expr ".." expr |
533
+ expr ".." |
534
+ ".." expr |
535
+ ".." ;
536
+ ```
537
+
527
538
### Unary operator expressions
528
539
529
540
** FIXME:** grammar?
@@ -610,7 +621,7 @@ lambda_expr : '|' ident_list '|' expr ;
610
621
### While loops
611
622
612
623
``` antlr
613
- while_expr : "while" no_struct_literal_expr '{' block '}' ;
624
+ while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ;
614
625
```
615
626
616
627
### Infinite loops
@@ -634,7 +645,7 @@ continue_expr : "continue" [ lifetime ];
634
645
### For expressions
635
646
636
647
``` antlr
637
- for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
648
+ for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ;
638
649
```
639
650
640
651
### If expressions
0 commit comments