From c175b35495487da6a62bb5d4d9ed7df64186b106 Mon Sep 17 00:00:00 2001 From: FuGangqiang Date: Sat, 21 Mar 2015 22:56:05 +0800 Subject: [PATCH 1/2] fix the attributes sytax --- src/doc/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/reference.md b/src/doc/reference.md index 92573d7921773..b23a8d91069ee 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -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 ] ? ; From bc9d9f20db488dae2b6a80e4b30d1cf3d69058c1 Mon Sep 17 00:00:00 2001 From: FuGangqiang Date: Sat, 21 Mar 2015 23:59:30 +0800 Subject: [PATCH 2/2] add lifetime for `while` and `for` expression --- src/doc/reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/reference.md b/src/doc/reference.md index b23a8d91069ee..415ec4e4fbf0a 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -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