summary refs log tree commit diff stats
path: root/compiler/service.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-04-24 09:34:20 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-04-24 09:34:29 +0200
commitee366f17469a96b418b58db17e03c892cf4f17d8 (patch)
treef066aac7a9a6dd11c498b90c073c26f7cff4c4b0 /compiler/service.nim
parent8ce9e434348f6f63b81f7a788bd4093996dbaca7 (diff)
downloadNim-ee366f17469a96b418b58db17e03c892cf4f17d8.tar.gz
.experimental can now be used to enable specific features
Diffstat (limited to 'compiler/service.nim')
-rw-r--r--compiler/service.nim12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/service.nim b/compiler/service.nim
index ac04b7860..7cdfc112c 100644
--- a/compiler/service.nim
+++ b/compiler/service.nim
@@ -26,7 +26,7 @@ var
     # in caas mode, the list of defines and options will be given at start-up?
     # it's enough to check that the previous compilation command is the same?
 
-proc processCmdLine*(pass: TCmdLinePass, cmd: string) =
+proc processCmdLine*(pass: TCmdLinePass, cmd: string; config: ConfigRef) =
   var p = parseopt.initOptParser(cmd)
   var argsCount = 0
   while true:
@@ -36,19 +36,19 @@ proc processCmdLine*(pass: TCmdLinePass, cmd: string) =
     of cmdLongoption, cmdShortOption:
       if p.key == " ":
         p.key = "-"
-        if processArgument(pass, p, argsCount): break
+        if processArgument(pass, p, argsCount, config): break
       else:
-        processSwitch(pass, p)
+        processSwitch(pass, p, config)
     of cmdArgument:
-      if processArgument(pass, p, argsCount): break
+      if processArgument(pass, p, argsCount, config): break
   if pass == passCmd2:
     if optRun notin gGlobalOptions and arguments != "" and options.command.normalize != "run":
       rawMessage(errArgsNeedRunOption, [])
 
-proc serve*(cache: IdentCache; action: proc (cache: IdentCache){.nimcall.}) =
+proc serve*(cache: IdentCache; action: proc (cache: IdentCache){.nimcall.}; config: ConfigRef) =
   template execute(cmd) =
     curCaasCmd = cmd
-    processCmdLine(passCmd2, cmd)
+    processCmdLine(passCmd2, cmd, config)
     action(cache)
     gErrorCounter = 0