aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src/tt_iter.rs
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-04-18 20:24:17 +0100
committerEdwin Cheng <[email protected]>2020-04-18 20:24:17 +0100
commita1b5cf81ebcac15299cc612b49023bb418507027 (patch)
treef1e34af80f87a4628731cbb31c58c3784333e877 /crates/ra_mbe/src/tt_iter.rs
parentb949500126f6bd3723d22541adb2f7c8aae206a4 (diff)
Convert bool to ident instead of literal in mbe
Diffstat (limited to 'crates/ra_mbe/src/tt_iter.rs')
-rw-r--r--crates/ra_mbe/src/tt_iter.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_mbe/src/tt_iter.rs b/crates/ra_mbe/src/tt_iter.rs
index 100184e66..46c420718 100644
--- a/crates/ra_mbe/src/tt_iter.rs
+++ b/crates/ra_mbe/src/tt_iter.rs
@@ -40,9 +40,11 @@ impl<'a> TtIter<'a> {
40 } 40 }
41 } 41 }
42 42
43 pub(crate) fn expect_literal(&mut self) -> Result<&'a tt::Literal, ()> { 43 pub(crate) fn expect_literal(&mut self) -> Result<&'a tt::Leaf, ()> {
44 match self.expect_leaf()? { 44 let it = self.expect_leaf()?;
45 tt::Leaf::Literal(it) => Ok(it), 45 match it {
46 tt::Leaf::Literal(_) => Ok(it),
47 tt::Leaf::Ident(ident) if ident.text == "true" || ident.text == "false" => Ok(it),
46 _ => Err(()), 48 _ => Err(()),
47 } 49 }
48 } 50 }