@@ -27,14 +27,6 @@ use crate::mbe::{self, KleeneOp, MetaVarExpr};
27
27
28
28
/// Context needed to perform transcription of metavariable expressions.
29
29
struct TranscrCtx < ' psess , ' itp > {
30
- psess : & ' psess ParseSess ,
31
-
32
- /// Map from metavars to matched tokens
33
- interp : & ' itp FxHashMap < MacroRulesNormalizedIdent , NamedMatch > ,
34
-
35
- /// Allow marking spans.
36
- marker : Marker ,
37
-
38
30
/// The stack of things yet to be completely expanded.
39
31
///
40
32
/// We descend into the RHS (`src`), expanding things as we go. This stack contains the things
@@ -66,6 +58,14 @@ struct TranscrCtx<'psess, 'itp> {
66
58
/// The in-progress `result` lives at the top of this stack. Each entered `TokenTree` adds a
67
59
/// new entry.
68
60
result_stack : Vec < Vec < TokenTree > > ,
61
+
62
+ /// Allow marking spans.
63
+ marker : Marker ,
64
+
65
+ psess : & ' psess ParseSess ,
66
+
67
+ /// Map from metavars to matched tokens
68
+ interp : & ' itp FxHashMap < MacroRulesNormalizedIdent , NamedMatch > ,
69
69
}
70
70
71
71
impl < ' psess > TranscrCtx < ' psess , ' _ > {
@@ -174,17 +174,17 @@ pub(super) fn transcribe<'a>(
174
174
}
175
175
176
176
let mut tscx = TranscrCtx {
177
- psess,
178
- interp,
179
- marker : Marker { expand_id, transparency, cache : Default :: default ( ) } ,
180
- repeats : Vec :: new ( ) ,
181
177
stack : smallvec ! [ Frame :: new_delimited(
182
178
src,
183
179
src_span,
184
180
DelimSpacing :: new( Spacing :: Alone , Spacing :: Alone )
185
181
) ] ,
182
+ repeats : Vec :: new ( ) ,
186
183
result : Vec :: new ( ) ,
187
184
result_stack : Vec :: new ( ) ,
185
+ marker : Marker { expand_id, transparency, cache : Default :: default ( ) } ,
186
+ psess,
187
+ interp,
188
188
} ;
189
189
190
190
loop {
0 commit comments