From 4d48a2b1b5ff799321027bd804a426da6006ef7d Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sun, 6 Dec 2015 20:31:10 -0800 Subject: [PATCH] Mark direct parents of errors as fragile --- src/runtime/tree.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/tree.c b/src/runtime/tree.c index 4953b716..c6891684 100644 --- a/src/runtime/tree.c +++ b/src/runtime/tree.c @@ -79,6 +79,10 @@ void ts_tree_set_children(TSTree *self, size_t child_count, TSTree **children) { self->visible_child_count += child->visible_child_count; self->named_child_count += child->named_child_count; } + + if (child->symbol == ts_builtin_sym_error) { + self->options.fragile_left = self->options.fragile_right = true; + } } if (child_count > 0) {