From a1b5cf81ebcac15299cc612b49023bb418507027 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sun, 19 Apr 2020 03:24:17 +0800 Subject: Convert bool to ident instead of literal in mbe --- crates/ra_mbe/src/mbe_expander/matcher.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_mbe/src/mbe_expander') diff --git a/crates/ra_mbe/src/mbe_expander/matcher.rs b/crates/ra_mbe/src/mbe_expander/matcher.rs index 9485c62b8..78f9efa1b 100644 --- a/crates/ra_mbe/src/mbe_expander/matcher.rs +++ b/crates/ra_mbe/src/mbe_expander/matcher.rs @@ -187,7 +187,11 @@ impl<'a> TtIter<'a> { _ => false, }, Separator::Literal(lhs) => match fork.expect_literal() { - Ok(rhs) => rhs.text == lhs.text, + Ok(rhs) => match rhs { + tt::Leaf::Literal(rhs) => rhs.text == lhs.text, + tt::Leaf::Ident(rhs) => rhs.text == lhs.text, + tt::Leaf::Punct(_) => false, + }, _ => false, }, Separator::Puncts(lhss) => lhss.iter().all(|lhs| match fork.expect_punct() { -- cgit v1.2.3