summary refs log tree commit diff stats
path: root/compiler/semgnrc.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semgnrc.nim')
-rwxr-xr-xcompiler/semgnrc.nim13
1 files changed, 2 insertions, 11 deletions
diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim
index bffa8ad8e..4b0c81433 100755
--- a/compiler/semgnrc.nim
+++ b/compiler/semgnrc.nim
@@ -53,6 +53,7 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym): PNode =
     result = symChoice(c, n, s, scOpen)
   of skTemplate:
     if macroToExpand(s):
+      let n = fixImmediateParams(n)
       result = semTemplateExpr(c, n, s, false)
     else:
       result = symChoice(c, n, s, scOpen)
@@ -123,6 +124,7 @@ proc semGenericStmt(c: PContext, n: PNode,
           result = n
       of skTemplate: 
         if macroToExpand(s):
+          let n = fixImmediateParams(n)
           result = semTemplateExpr(c, n, s, false)
         else:
           n.sons[0] = symChoice(c, n.sons[0], s, scOpen)
@@ -151,17 +153,6 @@ proc semGenericStmt(c: PContext, n: PNode,
     let flags = if isDefinedMagic: flags+{withinMixin} else: flags
     for i in countup(first, sonsLen(result) - 1):
       result.sons[i] = semGenericStmt(c, result.sons[i], flags, toBind)
-  of nkMacroStmt: 
-    checkMinSonsLen(n, 2)
-    var a: PNode
-    if isCallExpr(n.sons[0]): a = n.sons[0].sons[0]
-    else: a = n.sons[0]
-    let luf = if withinMixin notin flags: {checkUndeclared} else: {}
-    var s = qualifiedLookup(c, a, luf)
-    if s != nil and macroToExpand(s):
-      result = semMacroStmt(c, n, {}, false)
-    for i in countup(0, sonsLen(result)-1): 
-      result.sons[i] = semGenericStmt(c, result.sons[i], flags, toBind)
   of nkIfStmt: 
     for i in countup(0, sonsLen(n)-1): 
       n.sons[i] = semGenericStmtScope(c, n.sons[i], flags, toBind)