Nim/tests/trmacros/tstmtlist.nim
2015-06-19 01:34:34 -05:00

19 lines
264 B
Nim

discard """
output: '''0
|12|
34
'''
"""
template optWrite{
write(f, x)
((write|writeLine){w})(f, y)
}(x, y: varargs[expr], f, w: expr) =
w(f, "|", x, y, "|")
if true:
echo "0"
write stdout, "1"
writeLine stdout, "2"
write stdout, "3"
echo "4"