diff --git a/src/tree.ts b/src/tree.ts index 5ff0958..e31f6a0 100644 --- a/src/tree.ts +++ b/src/tree.ts @@ -1318,8 +1318,8 @@ export class TreeCursor implements SyntaxNodeRef { for (;;) { if (mustLeave && leave) leave(this) mustLeave = this.type.isAnonymous - if (this.nextSibling()) break if (!depth) return + if (this.nextSibling()) break this.parent() depth-- mustLeave = true