Open jimmyhchan opened 9 years ago
One very bad idea is to run a string replacement pass on the outputted code. Another bad idea is run the output through esprima and generate a tree and walk that :(. I believe there's a way for us to have an optimization pass but it may need to be done on the instructions pass, we might need some intermediate data type between instruction and code....
I hope there's a way for us to break the generateJS pass into a few passes. There's quite a bit of logic between generate and util/builder. I don't know if it's possible but it'll be nice.
Those do sound like bad ideas ;) I like splitting things into different modules when it makes code easier to understand. I'm not certain that breaking generateJS into multiple passes will make the code easier to understand, so I'm unconvinced.
I don't know if this is possible, because the method name logic is specific to the code generation phase, which happens after the transforms.