Checks if x
is a tree_sitter_tree
or not.
Examples
language <- treesitter.r::language()
parser <- parser(language)
text <- "fn <- function() { 1 + 1 }"
tree <- parser_parse(parser, text)
is_tree(tree)
#> [1] TRUE
is_tree(1)
#> [1] FALSE
Checks if x
is a tree_sitter_tree
or not.
language <- treesitter.r::language()
parser <- parser(language)
text <- "fn <- function() { 1 + 1 }"
tree <- parser_parse(parser, text)
is_tree(tree)
#> [1] TRUE
is_tree(1)
#> [1] FALSE