children: Extract or Replace All Children of an RStatic Object

View source: R/child.R

childrenR Documentation

Extract or Replace All Children of an RStatic Object

Description

This function extracts or replaces all children of the given node.

Usage

children(node)

children(node) <- value

Arguments

node

(ASTNode) The node from which to extract or replace the children.

value

(list) A named list of objects to replace the children with. Names should match field names of node.

Value

A list of the child nodes.

See Also

child to extract or replace a single, specific descendant slightly more efficiently.

Examples

code = quote_ast(x <- 3)
children(code)

children(code) = list(read = Integer$new(42), write = Symbol$new("y"))

nick-ulle/ast documentation built on May 14, 2024, 7:40 p.m.