More descriptive naming

This commit is contained in:
Zahary Karadjov 2020-07-08 00:32:28 +03:00
parent 32b86bfd1f
commit 61e0f82858
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 12 additions and 2 deletions

View File

@ -403,7 +403,17 @@ macro unpackArgs*(callee: typed, args: untyped): untyped =
else:
result.add arg
template genCode*(body: untyped) =
template genExpr*(treeType: NimNodeKind, body: untyped): untyped =
iterator generator: NimNode = body
macro payload: untyped =
result = newTree(treeType)
for node in generator():
result.add node
payload()
template genStmtList*(body: untyped) =
iterator generator: NimNode = body
macro payload: untyped =
@ -413,7 +423,7 @@ template genCode*(body: untyped) =
payload()
template genExpr*(body: untyped) =
template genSimpleExpr*(body: untyped): untyped =
macro payload: untyped = body
payload()