@@ -93,28 +93,28 @@ use std::ops::{Deref, DerefMut};
93
93
94
94
// To avoid costly uniqueness checks, we require that `MatchSeq` always has a nonempty body.
95
95
96
- /// Either a sequence of token trees or a single one. This is used as the representation of the
97
- /// sequence of tokens that make up a matcher.
96
+ /// Either a slice of token trees or a single one. This is used as the representation of the
97
+ /// token trees that make up a matcher.
98
98
#[ derive( Clone ) ]
99
99
enum TokenTreeOrTokenTreeSlice < ' tt > {
100
100
Tt ( TokenTree ) ,
101
- TtSeq ( & ' tt [ TokenTree ] ) ,
101
+ TtSlice ( & ' tt [ TokenTree ] ) ,
102
102
}
103
103
104
104
impl < ' tt > TokenTreeOrTokenTreeSlice < ' tt > {
105
105
/// Returns the number of constituent top-level token trees of `self` (top-level in that it
106
106
/// will not recursively descend into subtrees).
107
107
fn len ( & self ) -> usize {
108
108
match * self {
109
- TtSeq ( ref v) => v. len ( ) ,
109
+ TtSlice ( ref v) => v. len ( ) ,
110
110
Tt ( ref tt) => tt. len ( ) ,
111
111
}
112
112
}
113
113
114
114
/// The `index`-th token tree of `self`.
115
115
fn get_tt ( & self , index : usize ) -> TokenTree {
116
116
match * self {
117
- TtSeq ( ref v) => v[ index] . clone ( ) ,
117
+ TtSlice ( ref v) => v[ index] . clone ( ) ,
118
118
Tt ( ref tt) => tt. get_tt ( index) ,
119
119
}
120
120
}
@@ -154,7 +154,7 @@ type NamedMatchVec = SmallVec<[NamedMatch; 4]>;
154
154
/// lifetime. By separating `'tt` from `'root`, we can show that.
155
155
#[ derive( Clone ) ]
156
156
struct MatcherPos < ' root , ' tt > {
157
- /// The token or sequence of tokens that make up the matcher. `elts` is short for "elements".
157
+ /// The token or slice of tokens that make up the matcher. `elts` is short for "elements".
158
158
top_elts : TokenTreeOrTokenTreeSlice < ' tt > ,
159
159
160
160
/// The position of the "dot" in this matcher
@@ -220,7 +220,7 @@ impl<'root, 'tt> MatcherPos<'root, 'tt> {
220
220
let match_idx_hi = count_names ( ms) ;
221
221
MatcherPos {
222
222
// Start with the top level matcher given to us.
223
- top_elts : TtSeq ( ms) ,
223
+ top_elts : TtSlice ( ms) ,
224
224
225
225
// The "dot" is before the first token of the matcher.
226
226
idx : 0 ,
@@ -419,7 +419,7 @@ crate enum NamedMatch {
419
419
MatchedNonterminal ( Lrc < Nonterminal > ) ,
420
420
}
421
421
422
- /// Takes a sequence of token trees `ms` representing a matcher which successfully matched input
422
+ /// Takes a slice of token trees `ms` representing a matcher which successfully matched input
423
423
/// and an iterator of items that matched input and produces a `NamedParseResult`.
424
424
fn nameize < I : Iterator < Item = NamedMatch > > (
425
425
sess : & ParseSess ,
@@ -678,8 +678,8 @@ fn parse_tt_inner<'root, 'tt>(
678
678
}
679
679
}
680
680
681
- /// Use the given sequence of token trees (`ms`) as a matcher. Match the token
682
- /// stream from the given `parser` against it and return the match.
681
+ /// Use the given slice of token trees (`ms`) as a matcher. Match the token stream from the given
682
+ /// `parser` against it and return the match.
683
683
pub ( super ) fn parse_tt (
684
684
parser : & mut Cow < ' _ , Parser < ' _ > > ,
685
685
ms : & [ TokenTree ] ,
0 commit comments