Files
Nim/tests/tools/tnimscriptwithmacro.nims
2019-08-31 19:32:59 +02:00

23 lines
282 B
Nim

discard """
cmd: "nim e $file"
output: '''
foobar
nothing
hallo
"""
# this test ensures that the mode is resetted correctly to repr
import macros
macro foobar(): void =
result = newCall(bindSym"echo", newLit("nothing"))
echo "foobar"
let x = 123
foobar()
exec "echo hallo"