Function ts_tree_cursor_new

Source
pub unsafe extern "C" fn ts_tree_cursor_new(
    node: TSNode,
) -> TSTreeCursor
Expand description

Create a new tree cursor starting from the given node.

A tree cursor allows you to walk a syntax tree more efficiently than is possible using the TSNode functions. It is a mutable object that is always on a certain syntax node, and can be moved imperatively to different nodes.

Note that the given node is considered the root of the cursor, and the cursor cannot walk outside this node.