operator precedence changed: assignment like operators are supported; escaping of operators with \ is supported
This commit is contained in:
parent
8c03d96c6a
commit
68be801f63
7 changed files with 64 additions and 26 deletions
11
tests/accept/run/tprecedence.nim
Normal file
11
tests/accept/run/tprecedence.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
discard """
|
||||
output: "true"
|
||||
"""
|
||||
|
||||
# Test the new predence rules
|
||||
|
||||
proc `\+` (x, y: int): int = result = x + y
|
||||
proc `\*` (x, y: int): int = result = x * y
|
||||
|
||||
echo 5 \+ 1 \* 9 == 14
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue