use syntax::ast::{Ident, Mac};
use syntax::mut_visit::{self, MutVisitor};
-use syntax::parse::token::{self, NtTT, Token};
+use syntax::token::{self, NtTT, Token};
use syntax::tokenstream::{DelimSpan, TokenStream, TokenTree, TreeAndJoint};
use smallvec::{smallvec, SmallVec};
-use errors::pluralise;
+use errors::pluralize;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use syntax_pos::hygiene::{ExpnId, Transparency};
}
}
-impl Marker {
- fn visit_delim_span(&mut self, dspan: &mut DelimSpan) {
- self.visit_span(&mut dspan.open);
- self.visit_span(&mut dspan.close);
- }
-}
-
/// An iterator over the token trees in a delimited token tree (`{ ... }`) or a sequence (`$(...)`).
enum Frame {
Delimited { forest: Lrc<mbe::Delimited>, idx: usize, span: DelimSpan },
// jump back out of the Delimited, pop the result_stack and add the new results back to
// the previous results (from outside the Delimited).
mbe::TokenTree::Delimited(mut span, delimited) => {
- marker.visit_delim_span(&mut span);
+ mut_visit::visit_delim_span(&mut span, &mut marker);
stack.push(Frame::Delimited { forest: delimited, idx: 0, span });
result_stack.push(mem::take(&mut result));
}
for &(idx, _) in repeats {
match matched {
MatchedNonterminal(_) => break,
- MatchedSeq(ref ads, _) => matched = ads.get(idx).unwrap(),
+ MatchedSeq(ref ads) => matched = ads.get(idx).unwrap(),
}
}
"meta-variable `{}` repeats {} time{}, but `{}` repeats {} time{}",
l_id,
l_len,
- pluralise!(l_len),
+ pluralize!(l_len),
r_id,
r_len,
- pluralise!(r_len),
+ pluralize!(r_len),
);
LockstepIterSize::Contradiction(msg)
}
match lookup_cur_matched(name, interpolations, repeats) {
Some(matched) => match matched {
MatchedNonterminal(_) => LockstepIterSize::Unconstrained,
- MatchedSeq(ref ads, _) => LockstepIterSize::Constraint(ads.len(), name),
+ MatchedSeq(ref ads) => LockstepIterSize::Constraint(ads.len(), name),
},
_ => LockstepIterSize::Unconstrained,
}