fixes #5327
This commit is contained in:
parent
4ac6a26031
commit
26fb6cb073
3 changed files with 45 additions and 6 deletions
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
msg: '''2
|
||||
nimout: '''2
|
||||
3
|
||||
4:2
|
||||
Got Hi
|
||||
|
|
@ -13,7 +13,7 @@ import macros, tables, strtabs
|
|||
var ZOOT{.compileTime.} = initTable[int, int](2)
|
||||
var iii {.compiletime.} = 1
|
||||
|
||||
macro zoo:stmt=
|
||||
macro zoo: untyped =
|
||||
ZOOT[iii] = iii*2
|
||||
inc iii
|
||||
echo iii
|
||||
|
|
@ -22,7 +22,7 @@ zoo
|
|||
zoo
|
||||
|
||||
|
||||
macro tupleUnpack: stmt =
|
||||
macro tupleUnpack: untyped =
|
||||
var (y,z) = (4, 2)
|
||||
echo y, ":", z
|
||||
|
||||
|
|
@ -32,14 +32,14 @@ tupleUnpack
|
|||
|
||||
var x {.compileTime.}: StringTableRef
|
||||
|
||||
macro addStuff(stuff, body: expr): stmt {.immediate.} =
|
||||
macro addStuff(stuff, body: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
if x.isNil:
|
||||
x = newStringTable(modeStyleInsensitive)
|
||||
x[$stuff] = ""
|
||||
|
||||
macro dump(): stmt =
|
||||
macro dump(): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
for y in x.keys: echo "Got ", y
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue