Collects all node ids within a tree given by a respective root node
The root id nodes to start collecting from
Collects all node ids within a tree given by a respective root node, but stops collecting at nodes where the given stop function returns true.
This can be used to exclude certain subtrees from the collection, for example to exclude function bodies when collecting ids on the root level.
The root id nodes to start collecting from
A function that determines whether to stop collecting at a given node, does not stop by default
In contrast to the nesting stored in the RNode structure, this function calculates the depth of a node by counting the number of parents until the root node is reached.
Returns the direct parent of a node. Usually, only root nodes do not have a parent, and you can assume that there is a linear chain of parents leading to the root node.
iterateParents - to get all parents of a node
Readonlydocumentation: (Return the (roxygen) documentation associated with the given node, if available.
A helper function to retrieve the id of a given node, if available.
A helper function to retrieve the location of a given node, if available.
Type guard for RNamedFunctionCall nodes.
Type guard for RUnnamedFunctionCall nodes.
Returns an iterable of all parents of a node, starting with the direct parent and ending with the root node.
A helper function to retrieve the lexeme of a given node, if available.
If the fullLexeme is available, it will be returned, otherwise the lexeme will be returned.
Bind a call's arguments to the formal paramNames using R's argument matching rules
(see https://cran.r-project.org/doc/manuals/R-lang.html#Argument-matching): exact name, then partial
(pmatch, unique-prefix) name, then the remaining unnamed arguments filling the remaining formals
left-to-right. Returns a map from parameter name to the argument bound to it, so
matchArgumentsToParameters(call.arguments, names).get('X') answers "which argument is mapped to
parameter X". Pass paramNames as the full formal list excluding ... so ambiguous prefixes are
rejected; this makes it exact when the signature is known (e.g. from the signature database).
Readonlyname: "RFunctionCall"Visits all node ids within a tree given by a respective root node using a depth-first search with prefix order.
The root id nodes to start collecting from
OptionalonVisit: OnEnter<OtherInfo>Called before visiting the subtree of each node. Can be used to stop visiting the subtree starting with this node (return true stop)
OptionalonExit: OnExit<OtherInfo>Called after the subtree of a node has been visited, called for leafs too (even though their subtree is empty)
Helper for working with RFunctionCall AST nodes.