ReadonlycurrentThe depth of the current node relative to the node where the cursor was created
ReadonlycurrentThe index of the current node among all descendants of the original node
ReadonlycurrentThe numerical field ID of the current node
ReadonlycurrentThe field name of the current node
ReadonlycurrentThe current node that the cursor is pointing to
The end byte index of the current node
The end position of the current node
Whether the current node is missing from the source code
Whether the current node is named
The parse state of the current node
The text of the current node
The type of the current node as a string
The type of the current node as a numeric ID
The start byte index of the current node
The start position of the current node
Move the cursor to the descendant node at the given index, where zero represents the original node the cursor was created with.
The index of the descendant to move to
Move this cursor to the first child of its current node.
true if cursor successfully moved, false if there were no children
Move this cursor to the first child that extends beyond the given byte offset
The byte offset to search for
true if a child was found and cursor moved, false otherwise
Move this cursor to the first child that extends beyond the given position
The position to search for
true if a child was found and cursor moved, false otherwise
Move this cursor to the last child of its current node. Note: This may be slower than gotoFirstChild() as it needs to iterate through all children to compute the position.
true if cursor successfully moved, false if there were no children
Move this cursor to the next sibling of its current node
true if cursor successfully moved, false if there was no next sibling
Move this cursor to the parent of its current node.
true if cursor successfully moved, false if there was no parent (cursor was already at the root node)
Move this cursor to the previous sibling of its current node. Note: This may be slower than gotoNextSibling() due to how node positions are stored. In the worst case, it will need to iterate through all previous siblings to recalculate positions.
true if cursor successfully moved, false if there was no previous sibling
Re-initialize this cursor to start at a new node
The node to start from
Re-initialize this cursor to the same position as another cursor. Unlike reset(), this will not lose parent information and allows reusing already created cursors.
The cursor to copy the position from
A stateful object for walking a syntax Tree efficiently