TreeSitter::Node
Inherits Struct / Value / Object
A Node represents a single node in the syntax tree. It tracks its start and end positions in
the source code, as well as its relation to other nodes like its parent, siblings and children.
Instance methods
Get the node's child at the given index, where zero represents the first child.
Raises IndexError if index is out of bounds.
Check if the node is extra. Extra nodes represent things like comments, which are not required the grammar, but can appear anywhere.
Check if the node is missing. Missing nodes are inserted by the parser in order to recover from certain kinds of syntax errors.
Check if the node is named. Named nodes correspond to named rules in the grammar, whereas anonymous nodes correspond to string literals in the grammar.