diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-05 07:28:31 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-05 07:28:31 +0000 |
commit | d914ac0069d3382f08a1ebdc3481ed7fc7a74b48 (patch) | |
tree | 20fab878520ab3f66d784c8d8c7787a132af676b /crates/ra_mbe/src/mbe_expander.rs | |
parent | 77a824c6a0db6ac2548841d290d5d61d1d23295c (diff) | |
parent | a4b473226bd185e6a016b175bdee22901fafd7ce (diff) |
Merge #744
744: mbe: Ensure repetition separator matches r=matklad a=jrmuizel
Co-authored-by: Jeff Muizelaar <[email protected]>
Diffstat (limited to 'crates/ra_mbe/src/mbe_expander.rs')
-rw-r--r-- | crates/ra_mbe/src/mbe_expander.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs index 212e2ea92..04b5a4035 100644 --- a/crates/ra_mbe/src/mbe_expander.rs +++ b/crates/ra_mbe/src/mbe_expander.rs | |||
@@ -140,8 +140,12 @@ fn match_lhs(pattern: &crate::Subtree, input: &mut TtCursor) -> Option<Bindings> | |||
140 | }) => { | 140 | }) => { |
141 | while let Some(nested) = match_lhs(subtree, input) { | 141 | while let Some(nested) = match_lhs(subtree, input) { |
142 | res.push_nested(nested)?; | 142 | res.push_nested(nested)?; |
143 | if separator.is_some() && !input.is_eof() { | 143 | if let Some(separator) = *separator { |
144 | input.eat_punct()?; | 144 | if !input.is_eof() { |
145 | if input.eat_punct()?.char != separator { | ||
146 | return None; | ||
147 | } | ||
148 | } | ||
145 | } | 149 | } |
146 | } | 150 | } |
147 | } | 151 | } |