magic-lang / magic

0 stars 2 forks source link

operator '-' is disregarded #119

Open thomasfanell opened 9 years ago

thomasfanell commented 9 years ago

This is due to the fact that - is both unary and binary. A temporary solution would be to check if left and right are identifiers/numbers.

davidpiuva commented 8 years ago

Safest would be to not have the parsing ambiguity at all since more exceptions will occur when new features are added but I guess that people don't want to write ~ as a unary negation.

If we have a unary/binary detector like in my language then we need to make sure that each new token is considered in the pattern matching. This can be done using tables or classes but it is a mess that is not suitable for something this critical.

thomasfanell commented 8 years ago

This will be easy once the analyser is working on a parse tree rather than lexer output.