text_parse | R Documentation |
text_parse()
is a convenience utility for quickly parsing a small snippet
of text using a particular language and getting access to its root node. It
is meant for demonstration purposes. If you are going to need to reparse the
text after an edit has been made, you should create a full parser with
parser()
and use parser_parse()
instead.
text_parse(x, language)
x |
The text to parse. |
language |
The language to parse with. |
A root node.
language <- treesitter.r::language()
text <- "map(xs, function(x) 1 + 1)"
# Note that this directly returns the root node, not the tree
text_parse(text, language)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.