summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-07-08 22:24:28 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-07-08 22:24:28 +0200
commite2267ef5c95e400e20ac48bea9c662241bc01f18 (patch)
tree7f3dec1d840266b55e27853ac38b83d6add91d18 /compiler
parent089c31765fd7d0fc2c4beb4869dd9a42c78b4ab8 (diff)
downloadNim-e2267ef5c95e400e20ac48bea9c662241bc01f18.tar.gz
Nimscript supports hint() and warning() procs; refs #3688
Diffstat (limited to 'compiler')
-rw-r--r--compiler/commands.nim2
-rw-r--r--compiler/scriptconfig.nim9
2 files changed, 8 insertions, 3 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index cf1e16b28..22512c563 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -158,7 +158,7 @@ var
   enableNotes: TNoteKinds
   disableNotes: TNoteKinds
 
-proc processSpecificNote(arg: string, state: TSpecialWord, pass: TCmdLinePass,
+proc processSpecificNote*(arg: string, state: TSpecialWord, pass: TCmdLinePass,
                          info: TLineInfo; orig: string) =
   var id = ""  # arg = "X]:on|off"
   var i = 0
diff --git a/compiler/scriptconfig.nim b/compiler/scriptconfig.nim
index d04fd5231..ca42cc8fa 100644
--- a/compiler/scriptconfig.nim
+++ b/compiler/scriptconfig.nim
@@ -13,7 +13,7 @@
 import
   ast, modules, passes, passaux, condsyms,
   options, nimconf, lists, sem, semdata, llstream, vm, vmdef, commands, msgs,
-  os, times, osproc
+  os, times, osproc, wordrecg
 
 # we support 'cmpIgnoreStyle' natively for efficiency:
 from strutils import cmpIgnoreStyle
@@ -116,7 +116,12 @@ proc setupVM*(module: PSym; scriptName: string): PEvalContext =
     setResult(a, options.command)
   cbconf switch:
     processSwitch(a.getString 0, a.getString 1, passPP, unknownLineInfo())
-
+  cbconf hintImpl:
+    processSpecificNote(a.getString 0, wHint, passPP, unknownLineInfo(),
+      a.getString 1)
+  cbconf warningImpl:
+    processSpecificNote(a.getString 0, wWarning, passPP, unknownLineInfo(),
+      a.getString 1)
 
 proc runNimScript*(scriptName: string; freshDefines=true) =
   passes.gIncludeFile = includeModule