Closed gushogg-blake closed 4 months ago
It'd be nice if you can check if this is still an issue (there's been a plethora of changes here and in tree-sitter core since this issue), if it is then I'd like to investigate it more - thanks!
No, looks like it's sorted, thanks!
With the following code, I'm seeing a zero-length node of type
;
that is its own parent's parent's next sibling:I ran into an infinite loop when trying to traverse this tree. After processing an
identifier
node for thereturn
keyword, it doesn't have anextSibling
so we go to its parent which is avariable_declarator
. The next sibling of thevariable_declarator
is the zero-length semicolon node, so that's the next logical node to process. After processing that node, it doesn't have a next sibling so we go to its parent, which is the originalidentifier
. There are other inconsistencies associated with this, e.g. theidentifier
node has achildCount
of 0 even though it has nodes that point to it viaparent
.