yurtsiv / mooncake

🌜 A functional, dynamic programming language
MIT License
12 stars 4 forks source link

Add "/=" operator #1

Closed yurtsiv closed 3 years ago

yurtsiv commented 3 years ago

There's a need of /= (not equal) operator which is the opposite of ==.

Example:

if 1 /= 2 then
  "1 is not equal to 2"
else
  "1 is equal to 2"
end

Steps:

1) See development guide 2) Add tests for parser (tests/Parser/ParserSpec.hs) 3) Add tests for interpreter (tests/Interpreter/EvalSepc.hs) 4) Add operator name in src/parser/Language.hs 5) Add data constructor to AST (src/parser/AST.hs) 6) Handle the operator in src/interpreter/Eval.hs 7) See if tests pass stack test

P.S. For now it's ok for this operator to be able to compare only numbers (as == does)

aitorres commented 3 years ago

Hello! I'm going to submit a PR in a bit with these changes.

yurtsiv commented 3 years ago

Thanks @aitorres, I'll take a look shortly!