node_raw_s_expression: "Raw" S-expression

View source: R/node.R

node_raw_s_expressionR Documentation

"Raw" S-expression

Description

node_raw_s_expression() returns the "raw" s-expression as seen by tree-sitter. Most of the time, node_show_s_expression() provides a better view of the tree, but occasionally it can be useful to see exactly what the underlying C library is using.

Usage

node_raw_s_expression(x)

Arguments

x

⁠[tree_sitter_node]⁠

A node.

Value

A single string containing the raw s-expression.

Examples


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

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

node_raw_s_expression(node)


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