about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-11-02 22:59:08 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-11-03 23:48:24 +0000
commit3b71646a600b44868ed6cd7e69d66617a24e41e2 (patch)
tree70a714836ed3a16ba05e05860277b3e756027f4e /src/libsyntax/ext
parenteb3ac29a101f9388966175bb51e340a98b849b59 (diff)
downloadrust-3b71646a600b44868ed6cd7e69d66617a24e41e2.tar.gz
rust-3b71646a600b44868ed6cd7e69d66617a24e41e2.zip
Revert "macros: Improve `tt` fragments"
This reverts commit 41745f30f751364bdce14428b7d3ffa5dd028903.
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/tt/transcribe.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs
index 641d69900f7..9ca3b16b74e 100644
--- a/src/libsyntax/ext/tt/transcribe.rs
+++ b/src/libsyntax/ext/tt/transcribe.rs
@@ -13,7 +13,7 @@ use ast::Ident;
 use errors::{Handler, DiagnosticBuilder};
 use ext::tt::macro_parser::{NamedMatch, MatchedSeq, MatchedNonterminal};
 use parse::token::{DocComment, MatchNt, SubstNt};
-use parse::token::{Token, Interpolated, NtIdent, NtTT};
+use parse::token::{Token, NtIdent};
 use parse::token;
 use parse::lexer::TokenAndSpan;
 use syntax_pos::{Span, DUMMY_SP};
@@ -269,9 +269,9 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
             }
             // FIXME #2887: think about span stuff here
             TokenTree::Token(sp, SubstNt(ident)) => {
+                r.stack.last_mut().unwrap().idx += 1;
                 match lookup_cur_matched(r, ident) {
                     None => {
-                        r.stack.last_mut().unwrap().idx += 1;
                         r.cur_span = sp;
                         r.cur_tok = SubstNt(ident);
                         return ret_val;
@@ -283,24 +283,14 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
                             // (a) idents can be in lots of places, so it'd be a pain
                             // (b) we actually can, since it's a token.
                             NtIdent(ref sn) => {
-                                r.stack.last_mut().unwrap().idx += 1;
                                 r.cur_span = sn.span;
                                 r.cur_tok = token::Ident(sn.node);
                                 return ret_val;
                             }
-                            NtTT(_) => {
-                                r.stack.push(TtFrame {
-                                    forest: TokenTree::Token(sp, Interpolated(nt.clone())),
-                                    idx: 0,
-                                    dotdotdoted: false,
-                                    sep: None,
-                                });
-                            }
                             _ => {
-                                r.stack.last_mut().unwrap().idx += 1;
                                 // FIXME(pcwalton): Bad copy.
                                 r.cur_span = sp;
-                                r.cur_tok = Interpolated(nt.clone());
+                                r.cur_tok = token::Interpolated(nt.clone());
                                 return ret_val;
                             }
                         }