Don't reuse any nodes that contain an error as a child node

This commit is contained in:
Max Brunsfeld 2014-10-23 12:50:37 -07:00
parent 647c3e2010
commit 3bc4971fd5
5 changed files with 83 additions and 24 deletions

View file

@ -106,7 +106,7 @@ static TSTree *break_down_right_stack(TSParser *parser) {
TSParseAction action = get_action(parser->language, state, node->symbol);
bool is_usable = (action.type != TSParseActionTypeError) &&
(node->symbol != ts_builtin_sym_error) &&
!ts_tree_has_error(node) &&
!ts_tree_is_extra(node);
if (is_usable && right_subtree_start == current_position.chars) {
ts_stack_shrink(&parser->right_stack, parser->right_stack.size - 1);