about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2017-03-28 05:32:43 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2017-06-26 02:05:45 +0000
commitd4488b7df97e62bfeed8c30b1922ce55ff254594 (patch)
tree3e65f4bf53f191bba6ec937843a8a73e019686d6 /src/libsyntax/parse/parser.rs
parentfc9ccfdbe02f4cf3e3ea60ee4412f00d29ef7f53 (diff)
downloadrust-d4488b7df97e62bfeed8c30b1922ce55ff254594.tar.gz
rust-d4488b7df97e62bfeed8c30b1922ce55ff254594.zip
Simplify `hygiene::Mark` application, and
remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 851a638e148..25ab46f6f9e 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -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
             }