get_symbols: Get Sets of Defined and Used Symbols

Description Usage Arguments Value See Also Examples

View source: R/get_symbols.R

Description

This function returns the set of symbols defined by an expression and the set of symbols used by an expression.

Usage

1
get_symbols(node, initial = SymbolSets(), ...)

Arguments

node

(ASTNode) The expression to analyze.

initial

(SymbolSets) The initial sets of defined/used expressions.

...

Further arguments to methods.

recursive

(logical) Search for symbols in function definitions?

include_default_arguments

(logical) Search for symbols in default arguments?

only_undefined_uses

(logical) Exclude used symbols that are defined in node before they are used?

Value

A SymbolSets object, with elements defined and used. Element defined is a list of expressions that define a symbol. Element used is a list of used symbols.

See Also

names_defined(), names_used(), CodeDepends::getInputs()

Examples

1
2
ast = quote_ast(x <- sum(x, 1, y))
get_symbols(ast)

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