summary refs log tree commit diff stats
path: root/compiler/passes.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/passes.nim')
-rw-r--r--compiler/passes.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/passes.nim b/compiler/passes.nim
index f1277b839..8d228fe9a 100644
--- a/compiler/passes.nim
+++ b/compiler/passes.nim
@@ -177,7 +177,6 @@ proc processModule(module: PSym, stream: PLLStream, rd: PRodReader) =
       s = stream
     while true: 
       openParsers(p, fileIdx, s)
-      var code = p.parseAll
 
       if sfSystemModule notin module.flags:
         # XXX what about caching? no processing then? what if I change the 
@@ -187,7 +186,10 @@ proc processModule(module: PSym, stream: PLLStream, rd: PRodReader) =
         processImplicits implicitImports, nkImportStmt, a
         processImplicits implicitIncludes, nkIncludeStmt, a
 
-      discard processTopLevelStmt(code, a)
+      while true: 
+        var n = parseTopLevelStmt(p)
+        if n.kind == nkEmpty: break 
+        if not processTopLevelStmt(n, a): break
 
       closeParsers(p)
       if s.kind != llsStdIn: break