From 4b574cad3cb179692abb30880520cca11fa90a2f Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 21 Apr 2021 20:13:55 -0500 Subject: [PATCH] update pat2015/2021 parts --- src/macros-by-example.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/macros-by-example.md b/src/macros-by-example.md index c2a7e885c..3bdf9ce41 100644 --- a/src/macros-by-example.md +++ b/src/macros-by-example.md @@ -28,7 +28,7 @@ > > _MacroFragSpec_ :\ >       `block` | `expr` | `ident` | `item` | `lifetime` | `literal`\ ->    | `meta` | `pat` | `pat2015` | `pat2021` | `path` | `stmt` | `tt` | `ty` | `vis` +>    | `meta` | `pat` | `pat_param` | `path` | `stmt` | `tt` | `ty` | `vis` > > _MacroRepSep_ :\ >    [_Token_]_except delimiters and repetition operators_ @@ -122,9 +122,8 @@ fragment specifiers are: * `block`: a [_BlockExpression_] * `stmt`: a [_Statement_] without the trailing semicolon (except for item statements that require semicolons) - * `pat2015`: a [_PatternNoTopAlt_] - * `pat2021`: a [_Pattern_] - * `pat`: equivalent to either `pat2015` or `pat2021`, depending on edition (see note below). + * `pat_param`: a [_PatternNoTopAlt_] + * `pat`: equivalent to `pat_param` * `expr`: an [_Expression_] * `ty`: a [_Type_] * `ident`: an [IDENTIFIER_OR_KEYWORD] @@ -135,11 +134,6 @@ fragment specifiers are: * `vis`: a possibly empty [_Visibility_] qualifier * `literal`: matches `-`?[_LiteralExpression_] -> **Edition Differences**: In Editions 2015 and 2018, `pat` fragment-specifiers -> do not allow top-level or-patterns (i.e. they accept [_PatternNoTopAlt_]). In -> Edition 2021, this was changed so that top-level or-patterns are accepted by -> `pat` (i.e. [_Pattern_]). - In the transcriber, metavariables are referred to simply by `$`_name_, since the fragment kind is specified in the matcher. Metavariables are replaced with the syntax element that matched them. The keyword metavariable `$crate` can be @@ -495,7 +489,6 @@ For more detail, see the [formal specification]. [_Item_]: items.md [_LiteralExpression_]: expressions/literal-expr.md [_MetaListIdents_]: attributes.md#meta-item-attribute-syntax -[_Pattern_]: patterns.md [_PatternNoTopAlt_]: patterns.md [_Statement_]: statements.md [_TokenTree_]: macros.md#macro-invocation