JSAbrahams / mamba

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

Restructure lexer and add Comment Token #84

Closed JSAbrahams closed 5 years ago

JSAbrahams commented 5 years ago

Relevant issues

25

Summary

Rewrite lexer to make it more readable. Add comments to language, so that these are preserved when converting to Python.

Indentation is now 4 spaces. Tabs are no longer recognized as valid characters. Furthermore, a bug has been fixed with regards to indentation. When we wish to exit an if, it no longer needs to be immediately be followed by a dedented line. We can have empty lines in between now. This was caused by the complex application logic of the lexer, was has been simplified somewhat.

E-numbers now have to use E, and no longer allow e, reducing inconsistency.

Added Tests

...

Additional Context

...

codecov[bot] commented 5 years ago

Codecov Report

Merging #84 into master will increase coverage by 1.72%. The diff coverage is 95.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #84      +/-   ##
==========================================
+ Coverage   81.63%   83.35%   +1.72%     
==========================================
  Files          62       63       +1     
  Lines        4040     4085      +45     
==========================================
+ Hits         3298     3405     +107     
+ Misses        742      680      -62
Impacted Files Coverage Ξ”
tests/output/syntax.rs 43.75% <0%> (-2.92%) :arrow_down:
src/parser/ast.rs 24.28% <0%> (-0.18%) :arrow_down:
src/core/construct.rs 32.65% <0%> (-0.34%) :arrow_down:
tests/lexer/lexer.rs 100% <100%> (ΓΈ) :arrow_up:
tests/parser/valid/control_flow.rs 87.07% <100%> (ΓΈ) :arrow_up:
src/lexer/token.rs 88% <100%> (+59.42%) :arrow_up:
src/core/mod.rs 69.67% <100%> (+0.19%) :arrow_up:
tests/parser/valid/operation.rs 100% <100%> (ΓΈ) :arrow_up:
tests/parser/valid/error.rs 100% <100%> (ΓΈ) :arrow_up:
src/lexer/common.rs 100% <100%> (ΓΈ)
... and 6 more

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 6d4b854...3856d97. Read the comment docs.