Skip to contents

Rebuild an AST node from a language-neutral list

Usage

ast_from_json(j)

Arguments

j

A list as produced by ast_to_json(), or the result of jsonlite::fromJSON() with simplifyVector = FALSE.

Value

An AST node.

See also

Examples

n <- ast_expression("*", ast_symbol("a"), ast_symbol("b"))
identical(ast_from_json(ast_to_json(n)), n)
#> [1] TRUE