summary refs log tree commit diff stats
path: root/compiler/nim.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-10-11 12:11:47 +0200
committerAndreas Rumpf <rumpf_a@web.de>2020-10-11 20:44:04 +0200
commit3492178494484e0c0c1d8eec83aadc5b2ad06ede (patch)
tree7db5bb72a42269b8d15473320dcef3531a564c88 /compiler/nim.nim
parentc2c7f6025922034073418e608a62f8f4d5a5b381 (diff)
downloadNim-3492178494484e0c0c1d8eec83aadc5b2ad06ede.tar.gz
refactoring: removed cmdlinehelper.mainCommand callback
Diffstat (limited to 'compiler/nim.nim')
-rw-r--r--compiler/nim.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/nim.nim b/compiler/nim.nim
index 2b0d78dd4..15aeccb33 100644
--- a/compiler/nim.nim
+++ b/compiler/nim.nim
@@ -22,7 +22,7 @@ import
   commands, options, msgs,
   extccomp, strutils, os, main, parseopt,
   idents, lineinfos, cmdlinehelper,
-  pathutils
+  pathutils, modulegraphs
 
 from std/browsers import openDefaultBrowser
 from nodejs import findNodeJs
@@ -70,8 +70,7 @@ proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) =
 proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
   let self = NimProg(
     supportsStdinFile: true,
-    processCmdLine: processCmdLine,
-    mainCommand: mainCommand
+    processCmdLine: processCmdLine
   )
   self.initDefinesProg(conf, "nim_compiler")
   if paramCount() == 0:
@@ -79,7 +78,9 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
     return
 
   self.processCmdLineAndProjectPath(conf)
-  if not self.loadConfigsAndRunMainCommand(cache, conf): return
+  var graph = newModuleGraph(cache, conf)
+  if not self.loadConfigsAndRunMainCommand(cache, conf, graph): return
+  mainCommand(graph)
   if conf.hasHint(hintGCStats): echo(GC_getStatistics())
   #echo(GC_getStatistics())
   if conf.errorCounter != 0: return