Closed CanftIn closed 1 day ago
Hi @CanftIn,
Right now, there is no user-facing AST API (and the whole simplify stage will be removed in the next version). You can print any AST in codon via LOG("{}", node->toString(0));
.
You can also run codon with CODON_DEBUG=lt
that will produce dump files that you can use for diffing. It's honestly a bit ugly at the moment, but handles well diffing and other simple operations.
When i debug for frontend infra of codon, i found there is no existing api to dump the raw AST like that SimplifyVisitor can dump a S-expr string. The api like this code comment, or is a better method to dump to a "_dump_ast.sexp"? So there will be intuitively to diff raw ast with simplify ast.
And i noticed if i dump a test python file to codon simplify sexp or cir, it would load all sexpr/cir produced by stdlib, and it would cause to produce a large ir file with more information that does not need attention for the moment. Is there a way to avoid this? thank you!