Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Temporarily remove pat_param." #1010

Merged
merged 2 commits into from
May 28, 2021
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