summary refs log tree commit diff stats
path: root/tests/parser/tprecedence.nim
blob: d586f14a3ca8ebd7a5bf80433dd1794b0fd0312e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
discard """
  output: '''holla
true
defabc 4'''
"""

# Test top level semicolon works properly:
import os; echo "holla"

# 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 == 6*9

proc foo[S, T](x: S, y: T): T = x & y

proc bar[T](x: T): T = x

echo "def".foo[:string, string]("abc"), " ", 4.bar[:int]