From 096014cb3e99eeb260470430dfb95c7729d051ef Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 7 Feb 2020 11:06:33 -0800 Subject: [PATCH] Clean up ts_language_next_state --- lib/src/language.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/language.h b/lib/src/language.h index 0057e36c..f908b459 100644 --- a/lib/src/language.h +++ b/lib/src/language.h @@ -92,8 +92,8 @@ static inline TSStateId ts_language_next_state(const TSLanguage *self, const TSParseAction *actions = ts_language_actions(self, state, symbol, &count); if (count > 0) { TSParseAction action = actions[count - 1]; - if (action.type == TSParseActionTypeShift || action.type == TSParseActionTypeRecover) { - return action.params.state; + if (action.type == TSParseActionTypeShift) { + return action.params.extra ? state : action.params.state; } } return 0;