diff options
author | Florian Diebold <[email protected]> | 2020-03-15 13:03:30 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-03-16 17:38:19 +0000 |
commit | e6ec4a329fedb354e64c0e0dea9b7651cab78960 (patch) | |
tree | 6171c9ea650cb69613a84140cec9c204d50374cd /crates/ra_parser/src/grammar/expressions | |
parent | 035db0fbb94e35c78cc76798844db06bd6ad8451 (diff) |
Better fix for stuck parser?
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions')
-rw-r--r-- | crates/ra_parser/src/grammar/expressions/atom.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index 2fc6ce1e1..2335d99b3 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs | |||
@@ -61,7 +61,7 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet = | |||
61 | LIFETIME, | 61 | LIFETIME, |
62 | ]); | 62 | ]); |
63 | 63 | ||
64 | const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW]; | 64 | const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW, R_DOLLAR]; |
65 | 65 | ||
66 | pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> { | 66 | pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> { |
67 | if let Some(m) = literal(p) { | 67 | if let Some(m) = literal(p) { |
@@ -565,10 +565,10 @@ fn meta_var_expr(p: &mut Parser) -> CompletedMarker { | |||
565 | it | 565 | it |
566 | } | 566 | } |
567 | _ => { | 567 | _ => { |
568 | while !p.at(EOF) && !p.at(R_DOLLAR) { | 568 | while !p.at(R_DOLLAR) { |
569 | p.bump_any() | 569 | p.bump_any() |
570 | } | 570 | } |
571 | p.eat(R_DOLLAR); | 571 | p.bump(R_DOLLAR); |
572 | m.complete(p, ERROR) | 572 | m.complete(p, ERROR) |
573 | } | 573 | } |
574 | } | 574 | } |