@@ -848,11 +848,11 @@ extern crate foo = "some/where/rust-foo#foo:1.0"; // a full crate ID for externa
848
848
##### Use declarations
849
849
850
850
~~~~ {.notrust .ebnf .gram}
851
- use_decl : "pub" ? "use" ident [ '=' path
852
- | "::" path_glob ] ;
851
+ use_decl : "pub" ? "use" [ ident '=' path
852
+ | path_glob ] ;
853
853
854
- path_glob : ident [ "::" path_glob ] ?
855
- | '*'
854
+ path_glob : ident [ "::" [ path_glob
855
+ | '*' ] ] ?
856
856
| '{' ident [ ',' ident ] * '}' ;
857
857
~~~~
858
858
@@ -1743,7 +1743,7 @@ import public items from their destination, not private items.
1743
1743
attribute : '#' '!' ? '[' meta_item ']' ;
1744
1744
meta_item : ident [ '=' literal
1745
1745
| '(' meta_seq ')' ] ? ;
1746
- meta_seq : meta_item [ ',' meta_seq ]* ;
1746
+ meta_seq : meta_item [ ',' meta_seq ] ? ;
1747
1747
~~~~
1748
1748
1749
1749
Static entities in Rust &mdash ; crates, modules and items &mdash ; may have _ attributes_
@@ -3027,11 +3027,11 @@ then any `else` block is executed.
3027
3027
### Match expressions
3028
3028
3029
3029
~~~~ {.notrust .ebnf .gram}
3030
- match_expr : "match" expr '{' match_arm [ '|' match_arm ] * '}' ;
3030
+ match_expr : "match" expr '{' match_arm * '}' ;
3031
3031
3032
- match_arm : match_pat "=>" [ expr "," | '{' block '}' ] ;
3032
+ match_arm : attribute * match_pat "=>" [ expr "," | '{' block '}' ] ;
3033
3033
3034
- match_pat : pat [ ".." pat ] ? [ "if" expr ] ;
3034
+ match_pat : pat [ '|' pat ] * [ "if" expr ] ? ;
3035
3035
~~~~
3036
3036
3037
3037
A ` match ` expression branches on a * pattern* . The exact form of matching that
@@ -3137,7 +3137,7 @@ using the `ref` keyword,
3137
3137
or to a mutable reference using ` ref mut ` .
3138
3138
3139
3139
Subpatterns can also be bound to variables by the use of the syntax
3140
- ` variable @ pattern ` .
3140
+ ` variable @ subpattern ` .
3141
3141
For example:
3142
3142
3143
3143
~~~~
0 commit comments