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 preceedence for logical operators is too high #342

Closed
Bearmarshal opened this issue Mar 10, 2016 · 4 comments
Closed

Operator preceedence for logical operators is too high #342

Bearmarshal opened this issue Mar 10, 2016 · 4 comments

Comments

@Bearmarshal
Copy link

I get the following error on development (triggering expression at the final line):

Operator 'and' is only defined for boolean types
   Left type: 'int'
   Right type: 'int'
In expression: 
  0 and i
In expression: 
  i % 3 == 0 and i
In expression: 
  i % 3 == 0 and i > 0

The same goes for the or operator. The not operator also preceeds comparison, but I won't argue whether that's a problem or not.

@Bearmarshal Bearmarshal changed the title Operator preceedencefor logical operators is too high Operator preceedence for logical operators is too high Mar 10, 2016
@EliasC
Copy link
Contributor

EliasC commented Mar 10, 2016

@EliasC
Copy link
Contributor

EliasC commented Mar 10, 2016

For anyone with a few minutes to spare: I think it should be enough to move the three lines concerning NOT, AND and OR to below the == at https://github.com/parapluu/encore/blob/master/src/parser/Parser/Parser.hs#L393

@EliasC
Copy link
Contributor

EliasC commented Mar 10, 2016

@Bearmarshal: Feel free to try moving these lines to see if it solves your issue!

@TheGrandmother
Copy link
Contributor

Closed by #387

@EliasC EliasC closed this as completed Apr 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants