JSAbrahams / mamba

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

Expression wrapped in braces is no longer a tuple #56

Closed JSAbrahams closed 5 years ago

JSAbrahams commented 5 years ago

Relevant issues

As it is currently everything wrapped in brackets is a tuple. This, however, can become confusing, especially when we want to do arithmetic, as the type checker will throw an error as we're doing arithmetic on a tuple.

Summary

This doesn't always make sense. As Jeff mentioned, some languages make it so that tuples have either 0, 2, or more elements, precisely to avoid this ambiguity.

So now a tuple with only 1 element is now no longer a tuple but an expression wrapped in braces.

Added Tests

Additional Context

...

codecov[bot] commented 5 years ago

Codecov Report

Merging #56 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #56      +/-   ##
==========================================
+ Coverage   77.26%   77.27%   +<.01%     
==========================================
  Files          48       48              
  Lines        3347     3348       +1     
==========================================
+ Hits         2586     2587       +1     
  Misses        761      761
Impacted Files Coverage Δ
src/parser/collection.rs 89.1% <100%> (+0.22%) :arrow_up:
tests/parser/valid/collection.rs 86.13% <100%> (-0.14%) :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 9242519...45e6240. Read the comment docs.