node_language: Get a node's underlying language

View source: R/node.R

node_languageR Documentation

Get a node's underlying language

Description

node_language() returns the document text underlying a node.

Usage

node_language(x)

Arguments

x

⁠[tree_sitter_node]⁠

A node.

Value

A tree_sitter_language object.

Examples


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

text <- "1 + foo"
tree <- parser_parse(parser, text)
node <- tree_root_node(tree)

node_language(node)


treesitter documentation built on June 24, 2024, 5:07 p.m.