mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
enforce parsing invariant for patterns
This commit is contained in:
parent
7989d567e2
commit
e78424846e
4 changed files with 42 additions and 2 deletions
|
@ -109,6 +109,19 @@ pub(crate) mod entry {
|
|||
items::mod_contents(p, false);
|
||||
m.complete(p, MACRO_ITEMS);
|
||||
}
|
||||
|
||||
pub(crate) fn pattern(p: &mut Parser) {
|
||||
let m = p.start();
|
||||
patterns::pattern_single(p);
|
||||
if p.at(EOF) {
|
||||
m.abandon(p);
|
||||
return;
|
||||
}
|
||||
while !p.at(EOF) {
|
||||
p.bump_any();
|
||||
}
|
||||
m.complete(p, ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue