summary refs log tree commit diff stats
path: root/tests/patterns/tstmtlist.nim
blob: 20cb5d688994c359ca77c7cd68ae6733604863cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
discard """
  output: '''0
|12|
34
'''
"""

template optWrite{
  write(f, x)
  ((write|writeln){w})(f, y)
}(x, y: varargs[expr], f, w: expr) =
  w(f, "|", x, y, "|")

if true:
  echo "0"
  write stdout, "1"
  writeln stdout, "2"
  write stdout, "3"
  echo "4"