SPEC change: ^ is right-assoc and of highest priority

This commit is contained in:
Araq 2011-01-10 21:28:48 +01:00
commit 19fbc8a55e
4 changed files with 38 additions and 26 deletions

View file

@ -0,0 +1,12 @@
# Test operator precedence:
assert 3+5*5-2 == 28- -26-28
proc `^-` (x, y: int): int =
# now right-associative!
result = x - y
assert 34 ^- 6 ^- 2 == 30
assert 34 - 6 - 2 == 26
echo "done"