##### Use declarations
~~~~ {.notrust .ebnf .gram}
-use_decl : "pub" ? "use" ident [ '=' path
- | "::" path_glob ] ;
+use_decl : "pub" ? "use" [ ident '=' path
+ | path_glob ] ;
-path_glob : ident [ "::" path_glob ] ?
- | '*'
+path_glob : ident [ "::" [ path_glob
+ | '*' ] ] ?
| '{' ident [ ',' ident ] * '}' ;
~~~~
attribute : '#' '!' ? '[' meta_item ']' ;
meta_item : ident [ '=' literal
| '(' meta_seq ')' ] ? ;
-meta_seq : meta_item [ ',' meta_seq ]* ;
+meta_seq : meta_item [ ',' meta_seq ] ? ;
~~~~
Static entities in Rust — crates, modules and items — may have _attributes_
### Match expressions
~~~~ {.notrust .ebnf .gram}
-match_expr : "match" expr '{' match_arm [ '|' match_arm ] * '}' ;
+match_expr : "match" expr '{' match_arm * '}' ;
-match_arm : match_pat "=>" [ expr "," | '{' block '}' ] ;
+match_arm : attribute * match_pat "=>" [ expr "," | '{' block '}' ] ;
-match_pat : pat [ ".." pat ] ? [ "if" expr ] ;
+match_pat : pat [ '|' pat ] * [ "if" expr ] ? ;
~~~~
A `match` expression branches on a *pattern*. The exact form of matching that
or to a mutable reference using `ref mut`.
Subpatterns can also be bound to variables by the use of the syntax
-`variable @ pattern`.
+`variable @ subpattern`.
For example:
~~~~