From 57e4122b890d56c11f9d74c1bdfed40f186331a4 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Wed, 17 Apr 2019 12:34:43 +0800 Subject: Add mbe stmt matcher --- crates/ra_mbe/src/mbe_expander.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/ra_mbe/src/mbe_expander.rs') diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs index 7a259f338..7587b575d 100644 --- a/crates/ra_mbe/src/mbe_expander.rs +++ b/crates/ra_mbe/src/mbe_expander.rs @@ -157,6 +157,10 @@ fn match_lhs(pattern: &crate::Subtree, input: &mut TtCursor) -> Result { + let pat = input.eat_stmt().ok_or(ExpandError::UnexpectedToken)?.clone(); + res.inner.insert(text.clone(), Binding::Simple(pat.into())); + } _ => return Err(ExpandError::UnexpectedToken), } } -- cgit v1.2.3