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, 2 insertions, 4 deletions
diff --git a/compiler/passes.nim b/compiler/passes.nim
index 8d228fe9a..22249edaf 100644
--- a/compiler/passes.nim
+++ b/compiler/passes.nim
@@ -177,6 +177,7 @@ 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 
@@ -186,10 +187,7 @@ proc processModule(module: PSym, stream: PLLStream, rd: PRodReader) =
         processImplicits implicitImports, nkImportStmt, a
         processImplicits implicitIncludes, nkIncludeStmt, a
 
-      while true: 
-        var n = parseTopLevelStmt(p)
-        if n.kind == nkEmpty: break 
-        if not processTopLevelStmt(n, a): break
+      processTopLevelStmt(code, a)
 
       closeParsers(p)
       if s.kind != llsStdIn: break