toString.ASTNode: Convert an ASTNode to a Character String

Description Usage Arguments Value Examples

View source: R/format.R

Description

These methods produce a single string that describes the code an ASTNode represents.

Usage

1
2
3
4
5
## S3 method for class 'ASTNode'
toString(x, ...)

## S3 method for class 'Label'
toString(x, ..., block_prefix = "%")

Arguments

x

(ASTNode) The object to be converted.

...

Optional arguments passed to or from methods.

block_prefix

(character) Prefix to prepend to basic block IDs.

Value

A character vector of length 1.

Examples

1
2
ast = quote_ast(if (x > 3) 42 else "hello")
toString(ast)

nick-ulle/rstatic documentation built on Oct. 18, 2019, 4:38 a.m.