mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
mbe: Ensure repetition separator matches
This commit is contained in:
parent
0000f00787
commit
a4b473226b
2 changed files with 30 additions and 2 deletions
|
@ -140,8 +140,12 @@ fn match_lhs(pattern: &crate::Subtree, input: &mut TtCursor) -> Option<Bindings>
|
|||
}) => {
|
||||
while let Some(nested) = match_lhs(subtree, input) {
|
||||
res.push_nested(nested)?;
|
||||
if separator.is_some() && !input.is_eof() {
|
||||
input.eat_punct()?;
|
||||
if let Some(separator) = *separator {
|
||||
if !input.is_eof() {
|
||||
if input.eat_punct()?.char != separator {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue