JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
85 stars 3 forks source link

Simplify ENum #69

Closed JSAbrahams closed 5 years ago

JSAbrahams commented 5 years ago

Relevant issues

...

Summary

It might be overdoing it to define a custom class for this. Instead of using the constructor of a hypothetical ENum class, it is good enough for now to use the built-in ** power operator of Python. Whether exp of an Enum is empty is now checked during the desugar stage, not in the core language.

So for instance:

Added Tests

Change the verify_while test to reflect the behaviour that enum desugaring is now slightly more advanced, in that it checks if the exp is empty instead of doing this in the core language.

Additional Context

...

codecov[bot] commented 5 years ago

Codecov Report

Merging #69 into master will decrease coverage by 0.01%. The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
- Coverage      80%   79.98%   -0.02%     
==========================================
  Files          58       58              
  Lines        3850     3852       +2     
==========================================
+ Hits         3080     3081       +1     
- Misses        770      771       +1
Impacted Files Coverage Δ
src/core/mod.rs 63.87% <100%> (-0.24%) :arrow_down:
tests/desugar/control_flow.rs 90.12% <100%> (ø) :arrow_up:
src/desugar/node.rs 69.47% <75%> (-0.05%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2c92365...abd1944. Read the comment docs.