From 85cc3cfec99a7d232384efae010bfbc8224f1351 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 3 Jan 2021 11:47:57 +0100 Subject: Revert "Proper handling $crate and local_inner_macros" --- crates/mbe/src/parser.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'crates/mbe/src/parser.rs') diff --git a/crates/mbe/src/parser.rs b/crates/mbe/src/parser.rs index 77cc739b6..2f3ebc831 100644 --- a/crates/mbe/src/parser.rs +++ b/crates/mbe/src/parser.rs @@ -8,7 +8,7 @@ use crate::{tt_iter::TtIter, ExpandError, MetaTemplate}; #[derive(Clone, Debug, PartialEq, Eq)] pub(crate) enum Op { - Var { name: SmolStr, kind: Option, id: tt::TokenId }, + Var { name: SmolStr, kind: Option }, Repeat { subtree: MetaTemplate, kind: RepeatKind, separator: Option }, Leaf(tt::Leaf), Subtree(MetaTemplate), @@ -106,21 +106,18 @@ fn next_op<'a>(first: &tt::TokenTree, src: &mut TtIter<'a>, mode: Mode) -> Resul } let name = UNDERSCORE.clone(); let kind = eat_fragment_kind(src, mode)?; - let id = punct.id; - Op::Var { name, kind, id } + Op::Var { name, kind } } tt::Leaf::Ident(ident) => { let name = ident.text.clone(); let kind = eat_fragment_kind(src, mode)?; - let id = ident.id; - Op::Var { name, kind, id } + Op::Var { name, kind } } tt::Leaf::Literal(lit) => { if is_boolean_literal(&lit) { let name = lit.text.clone(); let kind = eat_fragment_kind(src, mode)?; - let id = lit.id; - Op::Var { name, kind, id } + Op::Var { name, kind } } else { bail!("bad var 2"); } -- cgit v1.2.3