]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #23590 - FuGangqiang:attr, r=alexcrichton
authorManish Goregaokar <manishsmail@gmail.com>
Sat, 21 Mar 2015 20:06:41 +0000 (01:36 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sun, 22 Mar 2015 23:24:27 +0000 (04:54 +0530)
src/doc/reference.md

index 92573d792177362ad724278699f3d9d13cd2839c..415ec4e4fbf0a4bc661caa3ee26558908310b851 100644 (file)
@@ -1982,7 +1982,7 @@ the namespace hierarchy as it normally would.
 ## Attributes
 
 ```{.ebnf .gram}
-attribute : "#!" ? '[' meta_item ']' ;
+attribute : '#' '!' ? '[' meta_item ']' ;
 meta_item : ident [ '=' literal
                   | '(' meta_seq ')' ] ? ;
 meta_seq : meta_item [ ',' meta_seq ] ? ;
@@ -3158,7 +3158,7 @@ ten_times(|j| println!("hello, {}", j));
 ### While loops
 
 ```{.ebnf .gram}
-while_expr : "while" no_struct_literal_expr '{' block '}' ;
+while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ;
 ```
 
 A `while` loop begins by evaluating the boolean loop conditional expression.
@@ -3223,7 +3223,7 @@ A `continue` expression is only permitted in the body of a loop.
 ### For expressions
 
 ```{.ebnf .gram}
-for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
+for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ;
 ```
 
 A `for` expression is a syntactic construct for looping over elements provided