Skip to content

Checks if x is a tree_sitter_parser or not.

Usage

is_parser(x)

Arguments

x

[object]

An object.

Value

TRUE if x is a tree_sitter_parser, otherwise FALSE.

Examples

language <- treesitter.r::language()
parser <- parser(language)

is_parser(parser)
#> [1] TRUE

is_parser(1)
#> [1] FALSE