Skip to content

Commit 4b574ca

Browse files
committed
update pat2015/2021 parts
1 parent 100fa06 commit 4b574ca

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/macros-by-example.md

+3-10
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
>
2929
> _MacroFragSpec_ :\
3030
>       `block` | `expr` | `ident` | `item` | `lifetime` | `literal`\
31-
>    | `meta` | `pat` | `pat2015` | `pat2021` | `path` | `stmt` | `tt` | `ty` | `vis`
31+
>    | `meta` | `pat` | `pat_param` | `path` | `stmt` | `tt` | `ty` | `vis`
3232
>
3333
> _MacroRepSep_ :\
3434
> &nbsp;&nbsp; [_Token_]<sub>_except delimiters and repetition operators_</sub>
@@ -122,9 +122,8 @@ fragment specifiers are:
122122
* `block`: a [_BlockExpression_]
123123
* `stmt`: a [_Statement_] without the trailing semicolon (except for item
124124
statements that require semicolons)
125-
* `pat2015`: a [_PatternNoTopAlt_]
126-
* `pat2021`: a [_Pattern_]
127-
* `pat`: equivalent to either `pat2015` or `pat2021`, depending on edition (see note below).
125+
* `pat_param`: a [_PatternNoTopAlt_]
126+
* `pat`: equivalent to `pat_param`
128127
* `expr`: an [_Expression_]
129128
* `ty`: a [_Type_]
130129
* `ident`: an [IDENTIFIER_OR_KEYWORD]
@@ -135,11 +134,6 @@ fragment specifiers are:
135134
* `vis`: a possibly empty [_Visibility_] qualifier
136135
* `literal`: matches `-`<sup>?</sup>[_LiteralExpression_]
137136

138-
> **Edition Differences**: In Editions 2015 and 2018, `pat` fragment-specifiers
139-
> do not allow top-level or-patterns (i.e. they accept [_PatternNoTopAlt_]). In
140-
> Edition 2021, this was changed so that top-level or-patterns are accepted by
141-
> `pat` (i.e. [_Pattern_]).
142-
143137
In the transcriber, metavariables are referred to simply by `$`_name_, since
144138
the fragment kind is specified in the matcher. Metavariables are replaced with
145139
the syntax element that matched them. The keyword metavariable `$crate` can be
@@ -495,7 +489,6 @@ For more detail, see the [formal specification].
495489
[_Item_]: items.md
496490
[_LiteralExpression_]: expressions/literal-expr.md
497491
[_MetaListIdents_]: attributes.md#meta-item-attribute-syntax
498-
[_Pattern_]: patterns.md
499492
[_PatternNoTopAlt_]: patterns.md
500493
[_Statement_]: statements.md
501494
[_TokenTree_]: macros.md#macro-invocation

0 commit comments

Comments
 (0)