Open gordonwatts opened 5 years ago
This is tricky because as we go down levels we are often skipping things and walking through multiple layers of the AST - and so not having to have the rep attached to that means the code is a little less complex.
The first thing to do is rename _result
to something more reasonable, so it is clear the roll it is playing. Then we should look at removing it, and getting the rep propagation (??) into the generic_visitor pattern.
This feels like something we might do when we move to a real library.
Should we have all the results in the ast.rep, and get rid of _result totally? This would make the code cleaner, and also force us to be more careful about setting things in the backend. And perhaps make things cleaner as the _result gets set by multiple people and multiple places...
OTOH, it may not be the right thing - this means each ast node must have a well-defined thing set. Not clear that is the case or not.