Closed LukasPietzschmann closed 3 months ago
This mirrors flowR's behavior of allowing for an early exist, so please go ahead and open the PR :)
Maybe one small reiteration: I'm unsure of the right behavior when calling visit_nodes
with a list of nodes. Should we instantly stop when the callback returns FALSE
for a single node, or should we continue with the next node in the list?
I think the "intuitive" thing would be to stop early. We define a sequential traversal order through the vector of nodes passed.
The R-Thing to do would be probably to return a vector greedly containing TRUE
/FALSE
for each node individually (i.e., vectorizing over the visitation order). But i think an early exit works perfectly fine.
When visiting nodes in the AST, it could be handy if the visitor would allow for an early exit. This could work as follows:
If you (@Ellpeck and @EagleoutIce) are fine with this small addition, I already have the code ready :)