made more tests green; fixes #201
This commit is contained in:
parent
8178cd4fab
commit
a59abdf8e4
13 changed files with 43 additions and 30 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue