cyrilcode / cyril

The Cyril programming language is designed for fast prototyping of visualisations and live coding visuals.
http://cyrilcode.com
Other
145 stars 21 forks source link

precedence in binary operators is wrong #16

Open darrenmothersele opened 10 years ago

darrenmothersele commented 10 years ago

I would expect the following to draw a box:

x: 0
y: 1
if x > 0 | y > 0
  box
end
darrenmothersele commented 10 years ago

It does not because the precedence between the ">" and "|" operators is incorrect. If you add parentheses it evaluates correctly, i.e.

x: 0
y: 1
if (x > 0) | (y > 0)
  box
end