Rework logic for when to abandon parses with errors

This commit is contained in:
Max Brunsfeld 2016-05-29 22:36:47 -07:00
parent 6535704870
commit ea47fdc0fe
5 changed files with 206 additions and 134 deletions

View file

@ -92,7 +92,7 @@ recur:
offset = ts_length_zero();
for (size_t i = 0; i < self->child_count; i++) {
TSTree *child = self->children[i];
if (child->context.parent != self) {
if (child->context.parent != self || child->context.index != i) {
child->context.parent = self;
child->context.index = i;
child->context.offset = offset;