Fix false positive when marking nodes unreusable due to ambiguity

This commit is contained in:
Max Brunsfeld 2016-05-30 14:16:55 -07:00
parent 1e42e68098
commit 96e2e49ef8
2 changed files with 8 additions and 4 deletions

View file

@ -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;