Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

operator '-' is disregarded #119

Open
thomasfanell opened this issue Sep 18, 2015 · 2 comments
Open

operator '-' is disregarded #119

thomasfanell opened this issue Sep 18, 2015 · 2 comments
Labels

Comments

@thomasfanell
Copy link
Contributor

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
Copy link

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@davidpiuva @thomasfanell and others