Skip to content

Commit 218d38f

Browse files
committed
Overwrite grammar sections with what was removed from the reference
Between ffc5f1c, when grammar.md was created by copying parts of the reference, and 8cf2552, when all EBNF was removed from reference.md, there were parts of the grammar that were updated in reference.md but not grammar.md, and then they weren't copied over because they existed already, but they were slightly out of date. Example: the `path_item : ident | "self" ;` rule in Use declarations was changed from "mod" to "self" in the reference in 195fd9a but wasn't updated in the grammar.
1 parent 53cd0bc commit 218d38f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/doc/grammar.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ The two values of the boolean type are written `true` and `false`.
253253
### Symbols
254254

255255
```antlr
256-
symbol : "::" "->"
256+
symbol : "::" | "->"
257257
| '#' | '[' | ']' | '(' | ')' | '{' | '}'
258258
| ',' | ';' ;
259259
```
@@ -342,7 +342,7 @@ path_glob : ident [ "::" [ path_glob
342342
| '*' ] ] ?
343343
| '{' path_item [ ',' path_item ] * '}' ;
344344
345-
path_item : ident | "mod" ;
345+
path_item : ident | "self" ;
346346
```
347347

348348
### Functions
@@ -424,7 +424,7 @@ See [Use declarations](#use-declarations).
424424
## Attributes
425425

426426
```antlr
427-
attribute : "#!" ? '[' meta_item ']' ;
427+
attribute : '#' '!' ? '[' meta_item ']' ;
428428
meta_item : ident [ '=' literal
429429
| '(' meta_seq ')' ] ? ;
430430
meta_seq : meta_item [ ',' meta_seq ] ? ;
@@ -515,8 +515,7 @@ struct_expr : expr_path '{' ident ':' expr
515515
### Block expressions
516516

517517
```antlr
518-
block_expr : '{' [ view_item ] *
519-
[ stmt ';' | item ] *
518+
block_expr : '{' [ stmt ';' | item ] *
520519
[ expr ] '}' ;
521520
```
522521

@@ -537,7 +536,7 @@ field_expr : expr '.' ident ;
537536
```antlr
538537
array_expr : '[' "mut" ? array_elems? ']' ;
539538
540-
array_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
539+
array_elems : [expr [',' expr]*] | [expr ';' expr] ;
541540
```
542541

543542
### Index expressions

0 commit comments

Comments
 (0)