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:
parent
62e1d9902b
commit
5a8a4b0dcf
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue