From e6ec4a329fedb354e64c0e0dea9b7651cab78960 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 15 Mar 2020 14:03:30 +0100 Subject: Better fix for stuck parser? --- crates/ra_parser/src/grammar/expressions/atom.rs | 6 +++--- 1 file 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 = LIFETIME, ]); -const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW]; +const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW, R_DOLLAR]; pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> { if let Some(m) = literal(p) { @@ -565,10 +565,10 @@ fn meta_var_expr(p: &mut Parser) -> CompletedMarker { it } _ => { - while !p.at(EOF) && !p.at(R_DOLLAR) { + while !p.at(R_DOLLAR) { p.bump_any() } - p.eat(R_DOLLAR); + p.bump(R_DOLLAR); m.complete(p, ERROR) } } -- cgit v1.2.3