@@ -102,12 +102,12 @@ Productions](#special-unicode-productions).
102
102
103
103
Some rules in the grammar -- notably [ unary
104
104
operators] ( #unary-operator-expressions ) , [ binary
105
- operators] ( #binary-operator-expressions ) , [ keywords] ( #keywords ) and [ reserved
106
- words ] ( #reserved-words ) -- are given in a simplified form: as a listing of a
107
- table of unquoted, printable whitespace-separated strings. These cases form a
108
- subset of the rules regarding the [ token] ( #tokens ) rule, and are assumed to be
109
- the result of a lexical-analysis phase feeding the parser, driven by a DFA,
110
- operating over the disjunction of all such string table entries.
105
+ operators] ( #binary-operator-expressions ) , and [ keywords] ( #keywords ) --
106
+ are given in a simplified form: as a listing of a table of unquoted,
107
+ printable whitespace-separated strings. These cases form a subset of
108
+ the rules regarding the [ token] ( #tokens ) rule, and are assumed to be
109
+ the result of a lexical-analysis phase feeding the parser, driven by a
110
+ DFA, operating over the disjunction of all such string table entries.
111
111
112
112
When such a string enclosed in double-quotes (` " ` ) occurs inside the
113
113
grammar, it is an implicit reference to a single member of such a string table
@@ -139,8 +139,7 @@ The `ident` production is any nonempty Unicode string of the following form:
139
139
- The first character has property ` XID_start `
140
140
- The remaining characters have property ` XID_continue `
141
141
142
- that does _ not_ occur in the set of [ keywords] ( #keywords ) or [ reserved
143
- words] ( #reserved-words ) .
142
+ that does _ not_ occur in the set of [ keywords] ( #keywords ) .
144
143
145
144
Note: ` XID_start ` and ` XID_continue ` as character properties cover the
146
145
character ranges used to form the more familiar C and Java language-family
@@ -190,7 +189,7 @@ with any other legal whitespace element, such as a single space character.
190
189
## Tokens
191
190
192
191
~~~~~~~~ {.ebnf .gram}
193
- simple_token : keyword | reserved | unop | binop ;
192
+ simple_token : keyword | unop | binop ;
194
193
token : simple_token | ident | literal | symbol | whitespace token ;
195
194
~~~~~~~~
196
195
@@ -204,52 +203,32 @@ grammar as double-quoted strings. Other tokens have exact rules given.
204
203
The keywords in [ crate files] ( #crate-files ) are the following strings:
205
204
206
205
~~~~~~~~ {.keyword}
207
- import export use mod dir
206
+ import export use mod
208
207
~~~~~~~~
209
208
210
209
The keywords in [ source files] ( #source-files ) are the following strings:
211
210
212
- * TODO* split these between type keywords and regular (value) keywords,
213
- and define two different ` identifier ` productions for the different
214
- contexts.
215
-
216
211
~~~~~~~~ {.keyword}
217
- alt any as assert
218
- be bind block bool break
219
- char check claim const cont
212
+ alt assert
213
+ be break
214
+ check claim class const cont copy
220
215
do
221
216
else enum export
222
- f32 f64 fail false float fn for
223
- i16 i32 i64 i8 if iface impl import in int
217
+ fail false fn for
218
+ if iface impl import
224
219
let log
225
220
mod mutable
226
- native note
227
- of
228
- prove pure
221
+ native
222
+ pure
229
223
resource ret
230
- self str syntax
231
224
true type
232
- u16 u32 u64 u8 uint unchecked unsafe use
233
- vec
225
+ unsafe use
234
226
while
235
227
~~~~~~~~
236
228
237
229
Any of these have special meaning in their respective grammars, and are
238
230
excluded from the ` ident ` rule.
239
231
240
- ### Reserved words
241
-
242
- The reserved words are the following strings:
243
-
244
- ~~~~~~~~ {.reserved}
245
- m32 m64 m128
246
- f80 f16 f128
247
- class trait
248
- ~~~~~~~~
249
-
250
- Any of these may have special meaning in future versions of the language, so
251
- are excluded from the ` ident ` rule.
252
-
253
232
### Literals
254
233
255
234
A literal is an expression consisting of a single token, rather than a
@@ -389,10 +368,6 @@ literal. There are three floating-point suffixes: `f` (for the base
389
368
` float ` type), ` f32 ` , and ` f64 ` (the 32-bit and 64-bit floating point
390
369
types).
391
370
392
- A set of suffixes are also reserved to accommodate literal support for
393
- types corresponding to reserved tokens. The reserved suffixes are ` f16 ` ,
394
- ` f80 ` , ` f128 ` , ` m ` , ` m32 ` , ` m64 ` and ` m128 ` .
395
-
396
371
Examples of floating-point literals of various forms:
397
372
398
373
~~~~
@@ -421,8 +396,7 @@ Symbols are a general class of printable [token](#tokens) that play structural
421
396
roles in a variety of grammar productions. They are catalogued here for
422
397
completeness as the set of remaining miscellaneous printable tokens that do not
423
398
otherwise appear as [ unary operators] ( #unary-operator-expressions ) , [ binary
424
- operators] ( #binary-operator-expressions ) , [ keywords] ( #keywords ) or [ reserved
425
- words] ( #reserved-words ) .
399
+ operators] ( #binary-operator-expressions ) , or [ keywords] ( #keywords ) .
426
400
427
401
428
402
## Paths
@@ -1431,9 +1405,9 @@ rec_expr : '{' ident ':' expr
1431
1405
1432
1406
A _ [ record] ( #record-types ) expression_ is one or more comma-separated
1433
1407
name-value pairs enclosed by braces. A fieldname can be any identifier
1434
- (including reserved words ), and is separated from its value expression
1435
- by a colon. To indicate that a field is mutable, the ` mutable ` keyword
1436
- is written before its name.
1408
+ (including keywords ), and is separated from its value expression by a
1409
+ colon. To indicate that a field is mutable, the ` mutable ` keyword is
1410
+ written before its name.
1437
1411
1438
1412
~~~~
1439
1413
{x: 10f, y: 20f};
0 commit comments