Skip to content

Print a ts_tree object to the screen.

Usage

# S3 method for class 'ts_tree'
print(x, n = 10, ...)

Arguments

x

ts_tree object to print.

n

Number of lines, or number of selections to print.

...

Not used currently.

Value

Invisibly returns the original ts_tree object.

Details

Calls format.ts_tree() to format the ts_tree object, writes the formatted object to the standard output, and returns the original object invisibly.

Examples

# Create a parse tree with tsjsonc -------------------------------------
json <- tsjsonc::ts_parse_jsonc(
  '{ "a": 1, "b": [10, 20, 30], "c": { "c1": true, "c2": 100 } }'
)
print(json)
#> # jsonc (1 line)
#> 1 | { "a": 1, "b": [10, 20, 30], "c": { "c1": true, "c2": 100 } }