made more tests green; fixes #201

This commit is contained in:
Araq 2012-09-12 21:48:37 +02:00
commit a59abdf8e4
13 changed files with 43 additions and 30 deletions

View file

@ -111,21 +111,24 @@ proc semAfterMacroCall(c: PContext, n: PNode, s: PSym): PNode =
GlobalError(s.info, errTemplateInstantiationTooNested)
result = n
case s.typ.sons[0].kind
of tyExpr:
# BUGFIX: we cannot expect a type here, because module aliases would not
# work then (see the ``tmodulealias`` test)
# semExprWithType(c, result)
result = semExpr(c, result)
of tyStmt:
if s.typ.sons[0] == nil:
result = semStmt(c, result)
of tyTypeDesc:
if n.kind == nkStmtList: result.kind = nkStmtListType
result.typ = semTypeNode(c, result, nil)
else:
result = semExpr(c, result)
result = fitNode(c, s.typ.sons[0], result)
#GlobalError(s.info, errInvalidParamKindX, typeToString(s.typ.sons[0]))
case s.typ.sons[0].kind
of tyExpr:
# BUGFIX: we cannot expect a type here, because module aliases would not
# work then (see the ``tmodulealias`` test)
# semExprWithType(c, result)
result = semExpr(c, result)
of tyStmt:
result = semStmt(c, result)
of tyTypeDesc:
if n.kind == nkStmtList: result.kind = nkStmtListType
result.typ = semTypeNode(c, result, nil)
else:
result = semExpr(c, result)
result = fitNode(c, s.typ.sons[0], result)
#GlobalError(s.info, errInvalidParamKindX, typeToString(s.typ.sons[0]))
dec(evalTemplateCounter)
proc semMacroExpr(c: PContext, n, nOrig: PNode, sym: PSym,