The common.tree_printer is coupled to all the things it needs to print - so imports CST, AST, types, the whole nine yards. We should separate it so that the printing logic something is on the class itself. Though then then class will need to know some internals of the printer (and if printer changes, all the classes will have to change). Also, there will need to be some way to share stuff like _write_seq. Maybe do something inspired by Rust's std::fmt::Display trait?
The
common.tree_printeris coupled to all the things it needs to print - so imports CST, AST, types, the whole nine yards. We should separate it so that the printing logic something is on the class itself. Though then then class will need to know some internals of the printer (and if printer changes, all the classes will have to change). Also, there will need to be some way to share stuff like_write_seq. Maybe do something inspired by Rust'sstd::fmt::Displaytrait?