Skip to content

Commit 587bbe9

Browse files
committed
Don't reuse non-trivial subtrees when stack is split
1 parent e2ca55c commit 587bbe9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/runtime/parser.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ static bool parser__breakdown_lookahead(Parser *self, TSTree **lookahead,
170170
ReusableNode *reusable_node) {
171171
bool result = false;
172172
while (reusable_node->tree->child_count > 0 &&
173-
(reusable_node->tree->parse_state != state ||
173+
(self->is_split ||
174+
reusable_node->tree->parse_state != state ||
174175
reusable_node->tree->fragile_left ||
175176
reusable_node->tree->fragile_right)) {
176177
LOG("state_mismatch sym:%s", SYM_NAME(reusable_node->tree->symbol));

0 commit comments

Comments
 (0)