The document of a tree-sitter tree as a character scalar
Usage
# S3 method for class 'ts_tree'
as.character(x, ...)See also
as.raw.ts_tree() to get the document as a raw vector.
Examples
# Create a parse tree with tsjsonc -------------------------------------
tree <- tsjsonc::ts_parse_jsonc('{"foo": 42, "bar": [1, 2, 3]}')
tree
#> # jsonc (1 line)
#> 1 | {"foo": 42, "bar": [1, 2, 3]}
as.character(tree)
#> [1] "{\"foo\": 42, \"bar\": [1, 2, 3]}"