refactorings in preparations for the new runtime

This commit is contained in:
Andreas Rumpf 2018-07-10 10:39:53 +02:00
commit ce01472ff3
8 changed files with 311 additions and 304 deletions

View file

@ -179,11 +179,7 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {
if graph.stopCompile(): break
var n = parseTopLevelStmt(p)
if n.kind == nkEmpty: break
#if {sfNoForward, sfReorder} * module.flags != {}:
when true:
# we now process the full AST in one go, so that destructor injection for top
# level statements works correctly.
if graph.stopCompile(): break
if {sfNoForward, sfReorder} * module.flags != {}:
# read everything, no streaming possible
var sl = newNodeI(nkStmtList, n.info)
sl.add n
@ -195,7 +191,7 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {
sl = reorder(graph, sl, module)
discard processTopLevelStmt(sl, a)
break
#elif not processTopLevelStmt(n, a): break
elif not processTopLevelStmt(n, a): break
closeParsers(p)
if s.kind != llsStdIn: break
closePasses(graph, a)