JSAbrahams / mamba

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

Use `Name` in `NodeTy` where possible #442

Closed JSAbrahams closed 1 year ago

JSAbrahams commented 1 year ago

Summary

This means that generate needs less logic to deal with many edge cases of ASTTy. Instead, when the check stage generates an annotated AST (as ASTTy), it converts any type annotations either to Name, or StringName where relevant. Generate then no longer needs to deal with generation for different types, only the generation of Name, whose logic is well-tested.

Removed Tests

codecov[bot] commented 1 year ago

Codecov Report

Merging #442 (475f03f) into develop (6dcd7a8) will decrease coverage by 0.28%. The diff coverage is 91.43%.

@@             Coverage Diff             @@
##           develop     #442      +/-   ##
===========================================
- Coverage    88.43%   88.16%   -0.28%     
===========================================
  Files          107      105       -2     
  Lines        11729    11391     -338     
===========================================
- Hits         10373    10043     -330     
+ Misses        1356     1348       -8     
Impacted Files Coverage Ξ”
src/check/constrain/mod.rs 100.00% <ΓΈ> (ΓΈ)
src/generate/convert/mod.rs 95.14% <0.00%> (-0.22%) :arrow_down:
src/check/constrain/generate/definition.rs 90.38% <25.00%> (-1.18%) :arrow_down:
src/check/name/string_name/generic.rs 75.00% <50.00%> (-18.34%) :arrow_down:
src/check/ast/mod.rs 67.61% <79.16%> (-28.78%) :arrow_down:
src/generate/convert/class.rs 88.23% <84.61%> (+2.59%) :arrow_up:
src/generate/convert/definition.rs 90.80% <94.28%> (-0.25%) :arrow_down:
src/check/ast/node.rs 96.07% <95.34%> (+0.05%) :arrow_up:
src/check/constrain/generate/control_flow.rs 92.13% <100.00%> (ΓΈ)
src/check/constrain/unify/finished.rs 100.00% <100.00%> (ΓΈ)
... and 19 more
JSAbrahams commented 1 year ago

Drop in coverage is mainly due to dropping unnecessary logic.