JSAbrahams / mamba

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

Add Bitwise operations and define operator precedence #115

Closed JSAbrahams closed 5 years ago

JSAbrahams commented 5 years ago

Relevant issues

Fixes #109

Summary

Define operator precedence as follows:

  1. exponent
  2. unary and, unary or, bitwise ones complement
  3. multiplication, division, floor division, modulus
  4. addition, subtraction
  5. binary left shift, binary right shift, binary and, binary or, binary xor
  6. greater, greater or equal, less, less or equal, equal, not equal, is, is not, is a, is not a
  7. and, or
  8. postfix calls

Add bitwise operators

Added Tests

For the new bitwise operators.

codecov[bot] commented 5 years ago

Codecov Report

Merging #115 into master will decrease coverage by 0.88%. The diff coverage is 70.78%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #115      +/-   ##
=========================================
- Coverage   83.39%   82.5%   -0.89%     
=========================================
  Files          65      65              
  Lines        4372    4539     +167     
=========================================
+ Hits         3646    3745      +99     
- Misses        726     794      +68
Impacted Files Coverage Ξ”
src/parser/_type.rs 87.4% <ΓΈ> (-0.27%) :arrow_down:
src/core/mod.rs 64.46% <0%> (-4.94%) :arrow_down:
src/parser/ast.rs 22.29% <0%> (-2.02%) :arrow_down:
src/desugar/node.rs 62.31% <0%> (-6.7%) :arrow_down:
src/core/construct.rs 27.86% <0%> (-3.33%) :arrow_down:
src/parser/expression.rs 93.82% <100%> (ΓΈ) :arrow_up:
tests/lexer/lexer.rs 100% <100%> (ΓΈ) :arrow_up:
src/lexer/mod.rs 97.07% <100%> (+0.12%) :arrow_up:
src/lexer/token.rs 89.71% <100%> (+0.71%) :arrow_up:
tests/parser/valid/operation.rs 100% <100%> (ΓΈ) :arrow_up:
... and 3 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 dc7fb32...1cd90e2. Read the comment docs.