JSAbrahams / mamba

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

Don't generate ternary if contains raises #420

Closed JSAbrahams closed 1 year ago

JSAbrahams commented 1 year ago

Relevant issues

Summary

Do a check before generating a ternary if one of the branches does not contain a node which would generate invalid Python output. We verify that both then and else branch don't contain:

Added Tests

Happy

codecov[bot] commented 1 year ago

Codecov Report

Merging #420 (56c75c7) into develop (b9657d5) will increase coverage by 0.07%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #420      +/-   ##
===========================================
+ Coverage    88.01%   88.08%   +0.07%     
===========================================
  Files          110      110              
  Lines        12079    12077       -2     
===========================================
+ Hits         10631    10638       +7     
+ Misses        1448     1439       -9     
Impacted Files Coverage Δ
src/generate/convert/control_flow.rs 89.67% <100.00%> (-0.77%) :arrow_down:
src/generate/convert/mod.rs 96.71% <0.00%> (+1.93%) :arrow_up: