Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/macros-by-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
>
> _MacroFragSpec_ :\
>       `block` | `expr` | `ident` | `item` | `lifetime` | `literal`\
>    | `meta` | `pat` | `path` | `stmt` | `tt` | `ty` | `vis`
>    | `meta` | `pat` | `pat_param` | `path` | `stmt` | `tt` | `ty` | `vis`
>
> _MacroRepSep_ :\
> &nbsp;&nbsp; [_Token_]<sub>_except delimiters and repetition operators_</sub>
Expand Down Expand Up @@ -122,7 +122,8 @@ fragment specifiers are:
* `block`: a [_BlockExpression_]
* `stmt`: a [_Statement_] without the trailing semicolon (except for item
statements that require semicolons)
* `pat`: a [_PatternNoTopAlt_]
* `pat_param`: a [_PatternNoTopAlt_]
* `pat`: equivalent to `pat_param`
* `expr`: an [_Expression_]
* `ty`: a [_Type_]
* `ident`: an [IDENTIFIER_OR_KEYWORD]
Expand Down Expand Up @@ -450,7 +451,7 @@ Matchers like `$i:expr,` or `$i:expr;` would be legal, however, because `,` and
`;` are legal expression separators. The specific rules are:

* `expr` and `stmt` may only be followed by one of: `=>`, `,`, or `;`.
* `pat` may only be followed by one of: `=>`, `,`, `=`, `|`, `if`, or `in`.
* `pat` and `pat_param` may only be followed by one of: `=>`, `,`, `=`, `|`, `if`, or `in`.
* `path` and `ty` may only be followed by one of: `=>`, `,`, `=`, `|`, `;`,
`:`, `>`, `>>`, `[`, `{`, `as`, `where`, or a macro variable of `block`
fragment specifier.
Expand Down