node-parse-state {treesitter}R Documentation

Node parse states

Description

These are advanced functions that return information about the internal parse states.

See language_next_state() for more information.

Usage

node_parse_state(x)

node_next_parse_state(x)

Arguments

x

⁠[tree_sitter_node]⁠

A node.

Value

A single integer representing a parse state.

Examples


language <- treesitter.r::language()
parser <- parser(language)

text <- "fn <- function() { 1 + 1 }"
tree <- parser_parse(parser, text)
node <- tree_root_node(tree)

node <- node_child(node, 1)

# Parse states are grammar dependent
node_parse_state(node)
node_next_parse_state(node)


[Package treesitter version 0.1.0 Index]