From adf47e2b57b8fe993bb4727dd22322a93d35bd68 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 28 Dec 2017 17:17:58 -0800 Subject: [PATCH] Fix invalid usage of 'extra' field on non-shift parse action --- src/runtime/parser.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/runtime/parser.c b/src/runtime/parser.c index 2f0d459c..2371a1cd 100644 --- a/src/runtime/parser.c +++ b/src/runtime/parser.c @@ -797,11 +797,10 @@ static void parser__do_potential_reductions(Parser *self, StackVersion starting_ ts_language_table_entry(self->language, state, symbol, &entry); for (uint32_t i = 0; i < entry.action_count; i++) { TSParseAction action = entry.actions[i]; - if (action.params.extra) continue; switch (action.type) { case TSParseActionTypeShift: case TSParseActionTypeRecover: - has_shift_action = true; + if (!action.params.extra) has_shift_action = true; break; case TSParseActionTypeReduce: if (action.params.child_count > 0)