I think I understand now, the template args in getAst have to be NimNodes. One
more question, can you dynamically evaluate template expansions based on
existing AST or is it conceptually unviable? Example:
import macros
template texture(a, b): untyped =
var a: TexturePtr
init:
state.a = loadTexture(b)
finish:
state.a.free()
macro mcr(body) =
result = newEmptyNode()
let node = getAst(`body[0]`) # do what here?
echo body.treeRepr
mcr:
texture background, "res/menu.png"
Run
- How to expand a single template Hlaaftana
- Re: How to expand a single template Araq
- Re: How to expand a single template Hlaaftana
