parser-adjustments {treesitter}R Documentation

Parser adjustments

Description

Usage

parser_set_language(x, language)

parser_set_timeout(x, timeout)

parser_set_included_ranges(x, included_ranges)

Arguments

x

⁠[tree_sitter_parser]⁠

A parser.

language

⁠[tree_sitter_language]⁠

A language.

timeout

⁠[double(1)]⁠

A single whole number corresponding to a timeout in microseconds to use when parsing.

included_ranges

⁠[list_of<tree_sitter_range>]⁠

A list of ranges constructed by range(). These are the only locations that will be considered when parsing.

An empty list can be used to clear any existing ranges so that the parser will again parse the entire document.

Value

A new parser.

Examples


language <- treesitter.r::language()
parser <- parser(language)
parser_set_timeout(parser, 10000)


[Package treesitter version 0.1.0 Index]