Skip to content

Commit f399920

Browse files
committed
fix terminology
1 parent 0808f92 commit f399920

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/doc/reference.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ Users of `rustc` can define new syntax extensions in two ways:
556556
## Macros
557557

558558
`macro_rules` allows users to define syntax extensions in a declarative way.
559-
We call such extensions "macros by example" or simply "macros" — to be
559+
We call such extensions "`macro_rules!` macros" or simply "macros" — to be
560560
distinguished from the "procedural macros" defined in [compiler plugins][plugin].
561561

562562
As shown below, the body of a `macro_rules` macro consists of one or more
@@ -585,7 +585,7 @@ arm in turn. It transcribes the first successful match. Matching and
585585
transcription are closely related to each other, and we will describe them
586586
together.
587587

588-
### Macros By Example
588+
### Macro By Example
589589

590590
The macro expander matches and transcribes every token that does not begin with
591591
a `$` literally, including delimiters. For parsing reasons, delimiters must be
@@ -619,13 +619,13 @@ matches, in a structure that mimics the structure of the repetition encountered
619619
on a successful match. The job of the transcriber is to sort that structure
620620
out.
621621

622-
The rules for transcription of these repetitions are called "Macros By Example".
622+
The rules for transcription of these repetitions are called "Macro By Example".
623623
Essentially, one "layer" of repetition is discharged at a time, and all of them
624624
must be discharged by the time a name is transcribed. Therefore, `( $( $i:ident
625625
),* ) => ( $i )` is an invalid macro, but `( $( $i:ident ),* ) => ( $( $i ),* )`
626626
is acceptable (though trivial).
627627

628-
When Macros By Example encounters a repetition, it examines all of the `$`
628+
When Macro By Example encounters a repetition, it examines all of the `$`
629629
_name_ s that occur in its body. At the "current layer", they all must repeat
630630
the same number of times, so ` ( $( $i:ident ),* ; $( $j:ident ),* ) => ( $(
631631
($i,$j) ),* )` is valid if given the argument `(a,b,c ; d,e,f)`, but not

0 commit comments

Comments
 (0)