Skip to content

Commit b1f34cd

Browse files
steveklabnikManishearth
authored andcommitted
Beef up macro designator docs
Fixes rust-lang#28824
1 parent bfbae64 commit b1f34cd

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

reference.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,20 @@ a `$` literally, including delimiters. For parsing reasons, delimiters must be
547547
balanced, but they are otherwise not special.
548548

549549
In the matcher, `$` _name_ `:` _designator_ matches the nonterminal in the Rust
550-
syntax named by _designator_. Valid designators are `item`, `block`, `stmt`,
551-
`pat`, `expr`, `ty` (type), `ident`, `path`, `tt` (either side of the `=>`
552-
in macro rules), and `meta` (contents of an attribute). In the transcriber, the
550+
syntax named by _designator_. Valid designators are:
551+
552+
* `item`: an [item](#items)
553+
* `block`: a [block](#block-expressions)
554+
* `stmt`: a [statement](#statements)
555+
* `pat`: a [pattern](#match-expressions)
556+
* `expr`: an [expression](#expressions)
557+
* `ty`: a [type](#types)
558+
* `ident`: an [identifier](#identifiers)
559+
* `path`: a [path](#paths)
560+
* `tt`: either side of the `=>` in macro rules
561+
* `meta`: the contents of an [attribute](#attributes)
562+
563+
In the transcriber, the
553564
designator is already known, and so only the name of a matched nonterminal comes
554565
after the dollar sign.
555566

0 commit comments

Comments
 (0)