parameter passing works the same for macros and templates; use callsite magic to access the invokation AST

This commit is contained in:
Araq 2012-08-28 22:15:29 +02:00
commit b4844a189d
16 changed files with 270 additions and 180 deletions

View file

@ -51,7 +51,7 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym): PNode =
of skTemplate:
result = semTemplateExpr(c, n, s, false)
of skMacro:
result = semMacroExpr(c, n, s, false)
result = semMacroExpr(c, n, n, s, false)
of skGenericParam:
result = newSymNode(s, n.info)
of skParam:
@ -97,7 +97,7 @@ proc semGenericStmt(c: PContext, n: PNode,
incl(s.flags, sfUsed)
case s.kind
of skMacro:
result = semMacroExpr(c, n, s, false)
result = semMacroExpr(c, n, n, s, false)
of skTemplate:
result = semTemplateExpr(c, n, s, false)
# BUGFIX: we must not return here, we need to do first phase of