node-parse-state | R Documentation |
These are advanced functions that return information about the internal parse states.
node_parse_state()
returns the parse state of the current node.
node_next_parse_state()
returns the parse state after this node.
See language_next_state()
for more information.
node_parse_state(x)
node_next_parse_state(x)
x |
A node. |
A single integer representing a parse state.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.