summary refs log tree commit diff stats
path: root/tests/tools/tnimscriptwithmacro.nims
blob: 8b97f07696141d22a280a4c82ed6789713b88cb4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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"