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 RFunctionCall nodes.
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 with matchArgumentsToParameters, R's argument
matching. Returns a map from parameter name to the argument bound to it, so
matchArgsToParams(call.arguments, names).get('X') answers "which argument is mapped to parameter X".
An empty argument (f(1, ,3)) takes its formal but never appears in the map, as there is nothing to bind.
Readonlyname: "RFunctionCall"The source range the whole subtree of node covers, from the first position any of its nodes starts at to
the last one any of them ends at. Unlike SourceRange.fromNode this does not stop at what the node
itself is written as: the span of the <- in a multi-line assignment is the whole assignment.
undefined if neither the node nor anything below it carries a location.
RNode.topLevelStatement - for the node to ask this of when the whole statement is wanted
An identity for node that two analyses of the same source agree on, unlike the numeric, which only means something within the analysis that handed it out. Made of the file the node came
from, where it starts, and what it is: <file>:<line>:<column>:<type>.
This survives re-analyzing the same text, not editing it -- an edit above the node moves it.
undefined for a node that carries no location (an artificial node, e.g. a built-in).
The top-level statement node belongs to: the ancestor that is a direct child of the root of its file
(node itself if it already is one). A node with no parent is its own statement.
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.