Simplify hygiene::Mark application, and

remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
This commit is contained in:
Jeffrey Seyfried 2017-03-28 05:32:43 +00:00
parent fc9ccfdbe0
commit d4488b7df9
26 changed files with 160 additions and 172 deletions

View file

@ -2626,7 +2626,10 @@ impl<'a> Parser<'a> {
pub fn process_potential_macro_variable(&mut self) {
let ident = match self.token {
token::SubstNt(name) => {
token::Dollar if self.span.ctxt != syntax_pos::hygiene::SyntaxContext::empty() &&
self.look_ahead(1, |t| t.is_ident()) => {
self.bump();
let name = match self.token { token::Ident(ident) => ident, _ => unreachable!() };
self.fatal(&format!("unknown macro variable `{}`", name)).emit();
return
}