You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When visiting nodes in the AST, it could be handy if the visitor would allow for an early exit. This could work as follows:
visit_nodes(ast, function(node) {
if(somecheck) {
# We got what we want, so we do not have to visit more nodesreturn(FALSE)
}
# return nothing (or TRUE) to visit more nodes
})
If you (@Ellpeck and @EagleoutIce) are fine with this small addition, I already have the code ready :)
The text was updated successfully, but these errors were encountered:
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 :)
The text was updated successfully, but these errors were encountered: