Remove expr/stmt (#5857)
This commit is contained in:
parent
52ff244d5d
commit
000b8afd26
168 changed files with 497 additions and 529 deletions
|
|
@ -25,7 +25,7 @@ type
|
|||
|
||||
const data: Tconfig = (@["aa", "bb"], @[11, 22])
|
||||
|
||||
macro mymacro(data: static[TConfig]): stmt =
|
||||
macro mymacro(data: static[TConfig]): untyped =
|
||||
echo "letters"
|
||||
for s in items(data.letters):
|
||||
echo s
|
||||
|
|
@ -43,10 +43,10 @@ const
|
|||
a : Ta = @[(11, 22), (33, 44)]
|
||||
b : Tb = (@[55,66], @[77, 88])
|
||||
|
||||
macro mA(data: static[Ta]): stmt =
|
||||
macro mA(data: static[Ta]): untyped =
|
||||
echo "AST a \n", repr(data)
|
||||
|
||||
macro mB(data: static[Tb]): stmt =
|
||||
macro mB(data: static[Tb]): untyped =
|
||||
echo "AST b \n", repr(data)
|
||||
echo data.e[0]
|
||||
|
||||
|
|
@ -56,13 +56,13 @@ mB(b)
|
|||
type
|
||||
Foo[N: static[int], Z: static[string]] = object
|
||||
|
||||
macro staticIntMacro(f: static[int]): stmt = echo f
|
||||
macro staticIntMacro(f: static[int]): untyped = echo f
|
||||
staticIntMacro 10
|
||||
|
||||
var
|
||||
x: Foo[20, "Test"]
|
||||
|
||||
macro genericMacro[N; Z: static[string]](f: Foo[N, Z], ll = 3, zz = 12): stmt =
|
||||
macro genericMacro[N; Z: static[string]](f: Foo[N, Z], ll = 3, zz = 12): untyped =
|
||||
echo N, Z
|
||||
|
||||
genericMacro x
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue