Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/parser.rs')
| -rw-r--r-- | crates/parser/src/parser.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/parser/src/parser.rs b/crates/parser/src/parser.rs index 36a363afe9..ca02d9fdfd 100644 --- a/crates/parser/src/parser.rs +++ b/crates/parser/src/parser.rs @@ -29,7 +29,7 @@ pub(crate) struct Parser<'t> { edition: Edition, } -const PARSER_STEP_LIMIT: usize = 15_000_000; +const PARSER_STEP_LIMIT: usize = if cfg!(debug_assertions) { 150_000 } else { 15_000_000 }; impl<'t> Parser<'t> { pub(super) fn new(inp: &'t Input, edition: Edition) -> Parser<'t> { @@ -254,7 +254,10 @@ impl<'t> Parser<'t> { /// Create an error node and consume the next token. pub(crate) fn err_and_bump(&mut self, message: &str) { - self.err_recover(message, TokenSet::EMPTY); + let m = self.start(); + self.error(message); + self.bump_any(); + m.complete(self, ERROR); } /// Create an error node and consume the next token unless it is in the recovery set. |