the caller can now provide a pointer arg to ivy_ast_node_iterate, which will
be forwarded to the specified callback function each time it is called.
the iterator now behaves similarly to fts, in that it visits each node
in both pre-order and post-order, and indicates to the callback whether
the current iteration is pre- or post-order.
iteration is implementing without recursion, instead using type-specific callbacks to construct a queue of nodes to iterate through. ast priting is implemented using this functionality.