Closed jdpage closed 6 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
jeff65/gold/pattern.py | 11 | 15 | 73.33% | ||
<!-- | Total: | 36 | 40 | 90.0% | --> |
Totals | |
---|---|
Change from base Build 193: | 1.3% |
Covered Lines: | 1127 |
Relevant Lines: | 1305 |
Previously, we'd have
AstNode.transform
dynamically call theenter_
andexit_
methods. Then the pattern system would implement__getattr__
to catch all of them, which makes it hard to follow.Now,
AstNode.transform
callstransform_enter
andtransform_exit
, and the base transformer does the dynamic dispatch. The pattern system doesn't inherit from it, so no dynamic behavior there.As a side benefit, this also simplified inheriting from
ScopedPass
.