From 587bbe998ca88d99af697f31807b89ef01a3d1dc Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 6 Sep 2016 10:23:26 -0700 Subject: [PATCH] Don't reuse non-trivial subtrees when stack is split --- src/runtime/parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/parser.c b/src/runtime/parser.c index 2eba4663..ae34d6ab 100644 --- a/src/runtime/parser.c +++ b/src/runtime/parser.c @@ -170,7 +170,8 @@ static bool parser__breakdown_lookahead(Parser *self, TSTree **lookahead, ReusableNode *reusable_node) { bool result = false; while (reusable_node->tree->child_count > 0 && - (reusable_node->tree->parse_state != state || + (self->is_split || + reusable_node->tree->parse_state != state || reusable_node->tree->fragile_left || reusable_node->tree->fragile_right)) { LOG("state_mismatch sym:%s", SYM_NAME(reusable_node->tree->symbol));