The rewrite engine used an efficient path based traversal that was iterative with effectively pre and post-order actions. This PR factors that into ast.h, and then uses it for various operations to prevent stack overflow on deep asts.
It also fixes the recursive delete problem that you get from shared_ptr, by building a work list of nodes that need to be destructed.
The rewrite engine used an efficient path based traversal that was iterative with effectively pre and post-order actions. This PR factors that into ast.h, and then uses it for various operations to prevent stack overflow on deep asts.
It also fixes the recursive delete problem that you get from shared_ptr, by building a work list of nodes that need to be destructed.