From b443c5ee22bdf874ec0b8b607fa4afbac7136dc7 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Mon, 20 Feb 2017 23:11:52 -0500 Subject: Macros By Example --- src/doc/reference/src/macros-by-example.md | 32 ++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'src/doc/reference') diff --git a/src/doc/reference/src/macros-by-example.md b/src/doc/reference/src/macros-by-example.md index 916e6c891ab..a007b232e4c 100644 --- a/src/doc/reference/src/macros-by-example.md +++ b/src/doc/reference/src/macros-by-example.md @@ -20,17 +20,27 @@ balanced, but they are otherwise not special. In the matcher, `$` _name_ `:` _designator_ matches the nonterminal in the Rust syntax named by _designator_. Valid designators are: -* `item`: an [item](#items) -* `block`: a [block](#block-expressions) -* `stmt`: a [statement](#statements) -* `pat`: a [pattern](#match-expressions) -* `expr`: an [expression](#expressions) -* `ty`: a [type](#types) -* `ident`: an [identifier](#identifiers) -* `path`: a [path](#paths) -* `tt`: a token tree (a single [token](#tokens) or a sequence of token trees surrounded - by matching `()`, `[]`, or `{}`) -* `meta`: the contents of an [attribute](#attributes) +* `item`: an [item] +* `block`: a [block] +* `stmt`: a [statement] +* `pat`: a [pattern] +* `expr`: an [expression] +* `ty`: a [type] +* `ident`: an [identifier] +* `path`: a [path] +* `tt`: a token tree (a single [token] by matching `()`, `[]`, or `{}`) +* `meta`: the contents of an [attribute] + +[item]: items.html +[block]: expressions.html#block-expressions +[statement]: statements.html +[pattern]: expressions.html#match-expressions +[expression]: expressions.html +[type]: types.html +[identifier]: identifiers.html +[path]: paths.html +[token]: tokens.html +[attribute]: attributes.html In the transcriber, the designator is already known, and so only the name of a matched nonterminal comes -- cgit 1.4.1-3-g733a5