node_text | R Documentation |
node_text()
returns the document text underlying a node.
node_text(x)
x |
A node. |
A single string containing the node's text.
language <- treesitter.r::language()
parser <- parser(language)
text <- "1 + foo"
tree <- parser_parse(parser, text)
node <- tree_root_node(tree)
node |>
node_child(1) |>
node_child_by_field_name("rhs") |>
node_text()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.