ts_node__prev_child: Reset earlier node when backtracking

`earlier_node` must be reset when backtracking up the tree or else
`ts_node__prev_child` may loop infinitely on a subtree which contains
zero-width tokens.
This commit is contained in:
Michael Davis 2023-07-24 15:02:37 -05:00
parent 62e1d9902b
commit 5a8a4b0dcf
No known key found for this signature in database

View file

@ -237,6 +237,8 @@ static inline TSNode ts_node__prev_sibling(TSNode self, bool include_anonymous)
return earlier_node;
} else {
node = earlier_node;
earlier_node = ts_node__null();
earlier_node_is_relevant = false;
}
}