Fix infinite loop due to skipping empty tokens during error recovery
This commit is contained in:
parent
2625c3a96c
commit
172cbb2d22
1 changed files with 1 additions and 0 deletions
|
|
@ -908,6 +908,7 @@ static void parser__recover(Parser *self, StackVersion version, Tree *lookahead)
|
|||
for (unsigned i = 0; i < summary->size; i++) {
|
||||
StackSummaryEntry entry = summary->contents[i];
|
||||
if (entry.state == ERROR_STATE) continue;
|
||||
if (entry.position.bytes == position.bytes) continue;
|
||||
unsigned depth = entry.depth + ts_stack_depth_since_error(self->stack, version);
|
||||
|
||||
unsigned new_cost =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue