@@ -20,7 +20,7 @@ of this text is copied, and expanded upon in subsequent RFCs.
2020 character.
2121 - ` simple NT ` : a "meta-variable" non-terminal (further discussion below).
2222 - ` complex NT ` : a repetition matching non-terminal, specified via repetition
23- operators (` \ *` , ` + ` , ` ? ` ).
23+ operators (` * ` , ` + ` , ` ? ` ).
2424 - ` token ` : an atomic element of a matcher; i.e. identifiers, operators,
2525 open/close delimiters, * and* simple NT's.
2626 - ` token tree ` : a tree structure formed from tokens (the leaves), complex
@@ -46,12 +46,12 @@ macro_rules! i_am_an_mbe {
4646}
4747```
4848
49- ` (start $foo:expr $($i:ident),\ * end) ` is a matcher. The whole matcher is a
49+ ` (start $foo:expr $($i:ident),* end) ` is a matcher. The whole matcher is a
5050delimited sequence (with open- and close-delimiters ` ( ` and ` ) ` ), and ` $foo `
5151and ` $i ` are simple NT's with ` expr ` and ` ident ` as their respective fragment
5252specifiers.
5353
54- ` $(i:ident),\ * ` is * also* an NT; it is a complex NT that matches a
54+ ` $(i:ident),* ` is * also* an NT; it is a complex NT that matches a
5555comma-separated repetition of identifiers. The ` , ` is the separator token for
5656the complex NT; it occurs in between each pair of elements (if any) of the
5757matched fragment.
@@ -72,7 +72,7 @@ its additional role as a fragment specifier; but it will be clear from context
7272which interpretation is meant.)
7373
7474"SEP" will range over separator tokens, "OP" over the repetition operators
75- ` \ *` , ` + ` , and ` ? ` , "OPEN"/"CLOSE" over matching token pairs surrounding a
75+ ` * ` , ` + ` , and ` ? ` , "OPEN"/"CLOSE" over matching token pairs surrounding a
7676delimited sequence (e.g. ` [ ` and ` ] ` ).
7777
7878Greek letters "α" "β" "γ" "δ" stand for potentially empty token-tree sequences.
@@ -110,7 +110,7 @@ of FIRST and FOLLOW are described later.
1101101 . For any separated complex NT in a matcher, ` M = ... $(tt ...) SEP OP ... ` ,
111111 we must have ` SEP ` ∈ FOLLOW(` tt ... ` ).
1121121 . For an unseparated complex NT in a matcher, ` M = ... $(tt ...) OP ... ` , if
113- OP = ` \ *` or ` + ` , we must have FOLLOW(` tt ... ` ) ⊇ FIRST(` tt ... ` ).
113+ OP = ` * ` or ` + ` , we must have FOLLOW(` tt ... ` ) ⊇ FIRST(` tt ... ` ).
114114
115115The first invariant says that whatever actual token that comes after a matcher,
116116if any, must be somewhere in the predetermined follow set. This ensures that a
@@ -202,7 +202,7 @@ first token-tree (if any):
202202 * Let SEP\_ SET(M) = { SEP } if SEP is present and ε ∈ FIRST(` tt ... ` );
203203 otherwise SEP\_ SET(M) = {}.
204204
205- * Let ALPHA\_ SET(M) = FIRST(` α ` ) if OP = ` \ *` or ` ? ` and ALPHA\_ SET(M) = {} if
205+ * Let ALPHA\_ SET(M) = FIRST(` α ` ) if OP = ` * ` or ` ? ` and ALPHA\_ SET(M) = {} if
206206 OP = ` + ` .
207207 * FIRST(M) = (FIRST(` tt ... ` ) \\ {ε}) ∪ SEP\_ SET(M) ∪ ALPHA\_ SET(M).
208208
@@ -211,7 +211,7 @@ the possibility that the separator could be a valid first token for M, which
211211happens when there is a separator defined and the repeated fragment could be
212212empty. ALPHA\_ SET(M) defines the possibility that the complex NT could be empty,
213213meaning that M's valid first tokens are those of the following token-tree
214- sequences ` α ` . This occurs when either ` \ *` or ` ? ` is used, in which case there
214+ sequences ` α ` . This occurs when either ` * ` or ` ? ` is used, in which case there
215215could be zero repetitions. In theory, this could also occur if ` + ` was used with
216216a potentially-empty repeating fragment, but this is forbidden by the third
217217invariant.
@@ -339,17 +339,17 @@ represent simple nonterminals with the given fragment specifier.
339339 * FOLLOW(M), for any other M, is defined as the intersection, as t ranges over
340340 (LAST(M) \ {ε}), of FOLLOW(t).
341341
342- The tokens that can begin a type are, as of this writing, {` ( ` , ` [ ` , ` ! ` , ` \ *` ,
342+ The tokens that can begin a type are, as of this writing, {` ( ` , ` [ ` , ` ! ` , ` * ` ,
343343` & ` , ` && ` , ` ? ` , lifetimes, ` > ` , ` >> ` , ` :: ` , any non-keyword identifier, ` super ` ,
344344` self ` , ` Self ` , ` extern ` , ` crate ` , ` $crate ` , ` _ ` , ` for ` , ` impl ` , ` fn ` , ` unsafe ` ,
345345` typeof ` , ` dyn ` }, although this list may not be complete because people won't
346346always remember to update the appendix when new ones are added.
347347
348348Examples of FOLLOW for complex M:
349349
350- * FOLLOW(` $( $d:ident $e:expr )\ * ` ) = FOLLOW(` $e:expr ` )
351- * FOLLOW(` $( $d:ident $e:expr )\ * $(;)\ * ` ) = FOLLOW(` $e:expr ` ) ∩ ANYTOKEN = FOLLOW(` $e:expr ` )
352- * FOLLOW(` $( $d:ident $e:expr )\ * $(;)\ * $( f |)+ ` ) = ANYTOKEN
350+ * FOLLOW(` $( $d:ident $e:expr )* ` ) = FOLLOW(` $e:expr ` )
351+ * FOLLOW(` $( $d:ident $e:expr )* $(;)* ` ) = FOLLOW(` $e:expr ` ) ∩ ANYTOKEN = FOLLOW(` $e:expr ` )
352+ * FOLLOW(` $( $d:ident $e:expr )* $(;)* $( f |)+ ` ) = ANYTOKEN
353353
354354### Examples of valid and invalid matchers
355355
0 commit comments