Fix false positive when marking nodes unreusable due to ambiguity
This commit is contained in:
parent
1e42e68098
commit
96e2e49ef8
2 changed files with 8 additions and 4 deletions
|
|
@ -10,8 +10,12 @@ const TSParseAction *ts_language_actions(const TSLanguage *self, TSStateId state
|
|||
TSSymbol symbol, size_t *count) {
|
||||
if (state == ts_parse_state_error) {
|
||||
*count = 1;
|
||||
return (symbol == ts_builtin_sym_error) ? &ERROR_SHIFT_EXTRA
|
||||
: &self->recovery_actions[symbol];
|
||||
if (symbol == ts_builtin_sym_error)
|
||||
return &ERROR_SHIFT_EXTRA;
|
||||
else if (self->recovery_actions[symbol].type == TSParseActionTypeError)
|
||||
return &ERROR_SHIFT_EXTRA;
|
||||
else
|
||||
return &self->recovery_actions[symbol];
|
||||
}
|
||||
|
||||
size_t action_index = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue