about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCarol Nichols <carol.nichols@gmail.com>2015-05-10 22:17:33 -0400
committerCarol Nichols <carol.nichols@gmail.com>2015-05-10 22:47:39 -0400
commit218d38fb94379feca89eb858b309890d513c35da (patch)
tree8f15c647f36ef1276bfa142e9ef21976aa60a328
parent53cd0bc772c5b73d8059a02f828ceecf9ed2287c (diff)
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.
-rw-r--r--src/doc/grammar.md11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/doc/grammar.md b/src/doc/grammar.md
index a3325b82a9d..fb7562e7bdf 100644
--- a/src/doc/grammar.md
+++ b/src/doc/grammar.md
@@ -253,7 +253,7 @@ The two values of the boolean type are written `true` and `false`.
 ### Symbols
 
 ```antlr
-symbol : "::" "->"
+symbol : "::" | "->"
        | '#' | '[' | ']' | '(' | ')' | '{' | '}'
        | ',' | ';' ;
 ```
@@ -342,7 +342,7 @@ path_glob : ident [ "::" [ path_glob
                           | '*' ] ] ?
           | '{' path_item [ ',' path_item ] * '}' ;
 
-path_item : ident | "mod" ;
+path_item : ident | "self" ;
 ```
 
 ### Functions
@@ -424,7 +424,7 @@ See [Use declarations](#use-declarations).
 ## Attributes
 
 ```antlr
-attribute : "#!" ? '[' meta_item ']' ;
+attribute : '#' '!' ? '[' meta_item ']' ;
 meta_item : ident [ '=' literal
                   | '(' meta_seq ')' ] ? ;
 meta_seq : meta_item [ ',' meta_seq ] ? ;
@@ -515,8 +515,7 @@ struct_expr : expr_path '{' ident ':' expr
 ### Block expressions
 
 ```antlr
-block_expr : '{' [ view_item ] *
-                 [ stmt ';' | item ] *
+block_expr : '{' [ stmt ';' | item ] *
                  [ expr ] '}' ;
 ```
 
@@ -537,7 +536,7 @@ field_expr : expr '.' ident ;
 ```antlr
 array_expr : '[' "mut" ? array_elems? ']' ;
 
-array_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
+array_elems : [expr [',' expr]*] | [expr ';' expr] ;
 ```
 
 ### Index expressions