Skip to content

Commit bb7e66f

Browse files
committed
Update for review comments.
1 parent 9cfa243 commit bb7e66f

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/macros-by-example.md

+24-25
Original file line numberDiff line numberDiff line change
@@ -59,33 +59,32 @@ balanced, but they are otherwise not special.
5959
In the matcher, `$` _name_ `:` _designator_ matches the nonterminal in the Rust
6060
syntax named by _designator_. Valid designators are:
6161

62-
* `item`: an [item]
63-
* `block`: a [block]
64-
* `stmt`: a [statement]
65-
* `pat`: a [pattern]
66-
* `expr`: an [expression]
67-
* `ty`: a [type]
68-
* `ident`: an [identifier] or [keyword]
62+
* `item`: an [_Item_]
63+
* `block`: a [_BlockExpression_]
64+
* `stmt`: a [_Statement_] without the trailing semicolon
65+
* `pat`: a [_Pattern_]
66+
* `expr`: an [_Expression_]
67+
* `ty`: a [_Type_]
68+
* `ident`: an [IDENTIFIER_OR_KEYWORD]
6969
* `path`: a [_TypePath_] style path
70-
* `tt`: a [token tree] (a single [token] or tokens in matching delimiters `()`, `[]`, or `{}`)
71-
* `meta`: the contents of an [attribute]
72-
* `lifetime`: a [lifetime]. Examples: `'static`, `'a`.
73-
* `vis`: a [visibility qualifier]
74-
75-
[item]: items.html
76-
[block]: expressions/block-expr.html
77-
[statement]: statements.html
78-
[pattern]: patterns.html
79-
[expression]: expressions.html
80-
[type]: types.html
81-
[identifier]: identifiers.html
82-
[keyword]: keywords.html
70+
* `tt`: a [_TokenTree_] (a single [token] or tokens in matching delimiters `()`, `[]`, or `{}`)
71+
* `meta`: a [_MetaItem_], the contents of an attribute
72+
* `lifetime`: a [LIFETIME_TOKEN]
73+
* `vis`: a [_Visibility_] qualifier
74+
75+
[IDENTIFIER_OR_KEYWORD]: identifiers.html
76+
[LIFETIME_TOKEN]: tokens.html#lifetimes-and-loop-labels
77+
[_BlockExpression_]: expressions/block-expr.html
78+
[_Expression_]: expressions.html
79+
[_Item_]: items.html
80+
[_MetaItem_]: attributes.html
81+
[_Pattern_]: patterns.html
82+
[_Statement_]: statements.html
83+
[_TokenTree_]: macros.html#macro-invocation
8384
[_TypePath_]: paths.html#paths-in-types
84-
[token tree]: macros.html#macro-invocation
85+
[_Type_]: types.html
86+
[_Visibility_]: visibility-and-privacy.html
8587
[token]: tokens.html
86-
[attribute]: attributes.html
87-
[lifetime]: tokens.html#lifetimes-and-loop-labels
88-
[visibility qualifier]: visibility-and-privacy.html
8988

9089
In the transcriber, the
9190
designator is already known, and so only the name of a matched nonterminal comes
@@ -140,7 +139,7 @@ Rust syntax is restricted in two ways:
140139
* `expr` and `stmt` may only be followed by one of `=>`, `,`, or `;`.
141140
* `pat` may only be followed by one of `=>`, `,`, `=`, `|`, `if`, or `in`.
142141
* `path` and `ty` may only be followed by one of `=>`, `,`, `=`, `|`, `;`,
143-
`:`, `>`, `[`, `{`, `as`, `where`, or a macro variable of `block`
142+
`:`, `>`, `>>`, `[`, `{`, `as`, `where`, or a macro variable of `block`
144143
fragment type.
145144
* `vis` may only be followed by one of `,`, `priv`, a raw identifier, any
146145
token that can begin a type, or a macro variable of `ident`, `ty`, or

src/macros.md

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ trait T {
8282
macro_rules! example {
8383
() => { println!("Macro call in a macro!") };
8484
}
85+
// Outer macro `example` is expanded, then inner macro `println` is expanded.
8586
example!();
8687
```
8788

0 commit comments

Comments
 (0)