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

modifing binding power of the unary "plus" and "dash" #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

table-harmony
Copy link

Sense the binding power of the prefix "dash" was unary, it was above the binding power of multiplicative.
Therefore it would have higher precedence: 10 * 10 - 10, for this case the dash would be parsed as a unary and not the correct additive.
image
As you can see the binary expression is parsed as a left for 10 and a right for the binary expression 10 - 10 which is wrong.
That is way in this commit I have changed the binding power of the token "dash" and added the token "plus" as prefix operations such as +10, -10 and modified their binding power to additive sense a "dash" prefix is identical to 0 - 10 and therefore should be parsed with the binding power of additive

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

Successfully merging this pull request may close these issues.

1 participant