aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src/mbe_expander.rs
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2019-04-19 14:38:26 +0100
committerEdwin Cheng <[email protected]>2019-04-19 14:38:26 +0100
commit87ff908135a28115593f8cf895d176aef331347c (patch)
tree5dd5b02918f9abbd3be1d6071ae266db63add4c6 /crates/ra_mbe/src/mbe_expander.rs
parentc5983b85fc9e520208684a8c625cdb96bb219b31 (diff)
Add vis matcher
Diffstat (limited to 'crates/ra_mbe/src/mbe_expander.rs')
-rw-r--r--crates/ra_mbe/src/mbe_expander.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs
index 548b15535..01e29b556 100644
--- a/crates/ra_mbe/src/mbe_expander.rs
+++ b/crates/ra_mbe/src/mbe_expander.rs
@@ -193,6 +193,10 @@ fn match_lhs(pattern: &crate::Subtree, input: &mut TtCursor) -> Result<Bindings,
193 Binding::Simple(tt::Leaf::from(literal).into()), 193 Binding::Simple(tt::Leaf::from(literal).into()),
194 ); 194 );
195 } 195 }
196 "vis" => {
197 let vis = input.eat_vis().ok_or(ExpandError::UnexpectedToken)?.clone();
198 res.inner.insert(text.clone(), Binding::Simple(vis.into()));
199 }
196 200
197 _ => return Err(ExpandError::UnexpectedToken), 201 _ => return Err(ExpandError::UnexpectedToken),
198 } 202 }