node-grammar {treesitter}R Documentation

Node grammar types and symbols

Description

Usage

node_grammar_type(x)

node_grammar_symbol(x)

Arguments

x

⁠[tree_sitter_node]⁠

A node.

See Also

node_type(), node_symbol()

Examples


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

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

# Examples for these functions are highly specific to the grammar,
# because they relies on the placement of `alias()` calls in the grammar.
node_grammar_type(node)
node_grammar_symbol(node)


[Package treesitter version 0.1.0 Index]