@@ -27,14 +27,6 @@ use crate::mbe::{self, KleeneOp, MetaVarExpr};
2727
2828/// Context needed to perform transcription of metavariable expressions.
2929struct 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-
3830 /// The stack of things yet to be completely expanded.
3931 ///
4032 /// We descend into the RHS (`src`), expanding things as we go. This stack contains the things
@@ -66,6 +58,14 @@ struct TranscrCtx<'psess, 'itp> {
6658 /// The in-progress `result` lives at the top of this stack. Each entered `TokenTree` adds a
6759 /// new entry.
6860 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 > ,
6969}
7070
7171impl < ' psess > TranscrCtx < ' psess , ' _ > {
@@ -174,17 +174,17 @@ pub(super) fn transcribe<'a>(
174174 }
175175
176176 let mut tscx = TranscrCtx {
177- psess,
178- interp,
179- marker : Marker { expand_id, transparency, cache : Default :: default ( ) } ,
180- repeats : Vec :: new ( ) ,
181177 stack : smallvec ! [ Frame :: new_delimited(
182178 src,
183179 src_span,
184180 DelimSpacing :: new( Spacing :: Alone , Spacing :: Alone )
185181 ) ] ,
182+ repeats : Vec :: new ( ) ,
186183 result : Vec :: new ( ) ,
187184 result_stack : Vec :: new ( ) ,
185+ marker : Marker { expand_id, transparency, cache : Default :: default ( ) } ,
186+ psess,
187+ interp,
188188 } ;
189189
190190 loop {
0 commit comments