TreeCursor

Mutable tree walker. Walks a Tree depth-first, handling both Tree and TreeBuffer children.

Properties

Link copied to clipboard
open override var from: Int
Link copied to clipboard
open override val name: String
Link copied to clipboard

Get the current position as a SyntaxNode.

Link copied to clipboard
open override var to: Int
Link copied to clipboard
val tree: Tree?

The Tree object backing the current node, or null if in a buffer.

Link copied to clipboard
open override var type: NodeType

Functions

Link copied to clipboard

Move to the first child that ends after pos.

Link copied to clipboard

Move to the last child that starts before pos.

Link copied to clipboard
fun enter(pos: Int, side: Int, enterMode: Int = mode): Boolean

Enter child at position.

Link copied to clipboard

Move to the first child. Returns true if successful.

Link copied to clipboard

Move to the last child.

Link copied to clipboard
open override fun matchContext(context: List<String>): Boolean

Match this node against a list of parent names (innermost last).

Link copied to clipboard
fun moveTo(pos: Int, side: Int = 0): TreeCursor

Move to the given position, finding the deepest node at that point.

Link copied to clipboard
fun next(enter: Boolean = true): Boolean

Move depth-first to the next node.

Link copied to clipboard

Move to the next sibling. Returns true if successful.

Link copied to clipboard

Move to the parent node. Returns true if successful.

Link copied to clipboard
fun prev(enter: Boolean = true): Boolean

Move depth-first backward.

Link copied to clipboard

Move to the previous sibling.