further steps for closure support; added 'system.rawProc', 'system.rawEnv'

This commit is contained in:
Araq 2012-02-08 22:56:31 +01:00
commit f3f3fc01aa
4 changed files with 68 additions and 13 deletions

View file

@ -626,6 +626,13 @@ proc transform(c: PTransf, n: PNode): PTransNode =
if n.sons[namePos].kind == nkSym:
let x = transformSym(c, n.sons[namePos])
if x.pnode.kind == nkClosure: result = x
of nkMacroDef:
# XXX no proper closure support yet:
if n.sons[genericParamsPos].kind == nkEmpty:
var s = n.sons[namePos].sym
n.sons[bodyPos] = PNode(transform(c, s.getBody))
if n.kind == nkMethodDef: methodDef(s, false)
result = PTransNode(n)
of nkForStmt: result = transformFor(c, n)
of nkCaseStmt: result = transformCase(c, n)
of nkContinueStmt: