diff options
author | Edwin Cheng <[email protected]> | 2019-04-19 14:38:26 +0100 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-04-19 14:38:26 +0100 |
commit | 87ff908135a28115593f8cf895d176aef331347c (patch) | |
tree | 5dd5b02918f9abbd3be1d6071ae266db63add4c6 /crates/ra_mbe/src/mbe_expander.rs | |
parent | c5983b85fc9e520208684a8c625cdb96bb219b31 (diff) |
Add vis matcher
Diffstat (limited to 'crates/ra_mbe/src/mbe_expander.rs')
-rw-r--r-- | crates/ra_mbe/src/mbe_expander.rs | 4 |
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 | } |