]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #14043 : sanxiyn/rust/attr-reference, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 9 May 2014 11:36:33 +0000 (04:36 -0700)
committerbors <bors@rust-lang.org>
Fri, 9 May 2014 11:36:33 +0000 (04:36 -0700)
Attribute grammar in reference manual allowed `#[foo, bar]`, which does not match parser behavior.

Also rename nonterminals to match parser code.

Fix #13825.

src/doc/rust.md

index e4c95538d3012199035ed6530b8f5f212b31539e..0e5af8626f8e8a24066e7c29c2695814f2fba274 100644 (file)
@@ -1741,10 +1741,10 @@ import public items from their destination, not private items.
 ## Attributes
 
 ~~~~ {.notrust .ebnf .gram}
-attribute : '#' '!' ? '[' attr_list ']' ;
-attr_list : attr [ ',' attr_list ]* ;
-attr : ident [ '=' literal
-             | '(' attr_list ')' ] ? ;
+attribute : '#' '!' ? '[' meta_item ']' ;
+meta_item : ident [ '=' literal
+                  | '(' meta_seq ')' ] ? ;
+meta_seq : meta_item [ ',' meta_seq ]* ;
 ~~~~
 
 Static entities in Rust &mdash; crates, modules and items &mdash; may have _attributes_