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
|
||||
|
||||
|
|
@ -417,6 +417,10 @@ proc main() =
|
|||
var runRes = readResults(runJson)
|
||||
listResults(rejectRes, compileRes, runRes)
|
||||
outputJSON(rejectRes, compileRes, runRes)
|
||||
of "dll":
|
||||
var r = initResults()
|
||||
runDLLTests r, p.cmdLineRest.string
|
||||
echo r.data, r
|
||||
of "test":
|
||||
var r = initResults()
|
||||
if p.kind != cmdArgument: quit usage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue