lives-group / APEG

2 stars 0 forks source link

Precendence and associativity of operators. #6

Closed emcardoso closed 4 years ago

emcardoso commented 6 years ago

Guys (and Girls), I Think there is something wrong with the precedence and associativity of operators. The expression x < y || z == 2 was reporting an error on the type system. At first i thought it was an erro in the type checker, but then I notice that the stack or this specific example was (from botton to top) boolean, int and the error war reported at the OR operator. I guess that the parser is interpreting the sentence as ((x<y) || z) == 2 . Changing the parenthesis to x < y || (z == 2) the type system checks correctly. Is this the intended syntax ?

lvsreis commented 4 years ago

You were right. The precedence was wrong. I've corrected this issue.