parser-adjustments | R Documentation |
parser_set_language()
sets the language of the parser. This is usually
done by parser()
though.
parser_set_timeout()
sets an optional timeout used when calling
parser_parse()
or parser_reparse()
. If the timeout is hit, an error
occurs.
parser_set_included_ranges()
sets an optional list of ranges that are
the only locations considered when parsing. The ranges are created by
range()
.
parser_set_language(x, language)
parser_set_timeout(x, timeout)
parser_set_included_ranges(x, included_ranges)
x |
A parser. |
language |
A language. |
timeout |
A single whole number corresponding to a timeout in microseconds to use when parsing. |
included_ranges |
A list of ranges constructed by An empty list can be used to clear any existing ranges so that the parser will again parse the entire document. |
A new parser.
language <- treesitter.r::language()
parser <- parser(language)
parser_set_timeout(parser, 10000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.