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

Precedence on | operator is problematic #44

Open
yigitozkavci opened this issue May 14, 2017 · 0 comments
Open

Precedence on | operator is problematic #44

yigitozkavci opened this issue May 14, 2017 · 0 comments
Assignees

Comments

@yigitozkavci
Copy link
Contributor

In the kicking-the-tires part, we used:

def binary == 9 (LHS, RHS) =
  !(LHS < RHS | LHS > RHS);

However, precedence of | should be higher than both < and > in order to use it properly without brackets. These two expressions are being evaluated to two different results now:

putchar(30 < 31 | 30 > 31);     # 0.0, wrong
putchar((30 < 31) | (30 > 31)); # 1.0, right

It's fixed by adding binary ">" Ex.AssocLeft just in near binary "<" Ex.AssocLeft in the parser, but don't know if it's the right solution.

@sdiehl sdiehl self-assigned this May 20, 2017
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

No branches or pull requests

2 participants