much more efficient rod file generation

This commit is contained in:
Araq 2011-10-18 17:21:51 +02:00
commit 4de84024e5
18 changed files with 611 additions and 557 deletions

View file

@ -158,7 +158,7 @@ proc SemReturn(c: PContext, n: PNode): PNode =
globalError(n.info, errXNotAllowedHere, "\'return\'")
if n.sons[0].kind != nkEmpty:
# transform ``return expr`` to ``result = expr; return``
if c.p.resultSym == nil: InternalError(n.info, "semReturn")
if c.p.resultSym == nil: globalError(n.info, errNoReturnTypeDeclared)
var a = newNodeI(nkAsgn, n.sons[0].info)
addSon(a, newSymNode(c.p.resultSym))
addSon(a, n.sons[0])