| tree-accessors | R Documentation |
tree_text() retrieves the tree's text that it was parsed with.
tree_language() retrieves the tree's language that it was parsed with.
tree_included_ranges() retrieves the tree's included_ranges that were
provided to parser_set_included_ranges(). Note that if no ranges were
provided originally, then this still returns a default that always covers
the entire document.
tree_included_ranges(x)
tree_text(x)
tree_language(x)
x |
A tree. |
tree_text() returns a string.
tree_language() returns a tree_sitter_language.
tree_included_ranges() returns a list of range() objects.
language <- treesitter.r::language()
parser <- parser(language)
text <- "1 + foo"
tree <- parser_parse(parser, text)
tree_text(tree)
tree_language(tree)
tree_included_ranges(tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.