summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-12-11 22:01:28 +0100
committerGitHub <noreply@github.com>2018-12-11 22:01:28 +0100
commitd20a27321524a08fba1831176e607b837f64ae7f (patch)
tree3e8ca3cddbe886bac4d4eca9689a439a9ea97c61 /compiler
parentbb1ce398af37ddd75fcac611ee993c85e956154e (diff)
parentfc7b3a7c2a223b04087426c3b7df9edc12ce1f03 (diff)
downloadNim-d20a27321524a08fba1831176e607b837f64ae7f.tar.gz
Merge pull request #9917 from timotheecour/pr_dump_msg
enhance `dump --dump.format:json` : report `out`, `hints`, `warnings`, document it ; closes #9513
Diffstat (limited to 'compiler')
-rw-r--r--compiler/main.nim18
1 files changed, 17 insertions, 1 deletions
diff --git a/compiler/main.nim b/compiler/main.nim
index 6afe57d87..fb8fe8443 100644
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -266,11 +266,27 @@ proc mainCommand*(graph: ModuleGraph) =
       var libpaths = newJArray()
       for dir in conf.searchPaths: libpaths.elems.add(%dir.string)
 
+      var hints = block: # consider factoring with `listHints`
+        var ret = newJObject()
+        for a in hintMin..hintMax:
+          let key = lineinfos.HintsToStr[ord(a) - ord(hintMin)]
+          ret[key] = % (a in conf.notes)
+        ret
+      var warnings = block: # consider factoring with `listWarnings`
+        var ret = newJObject()
+        for a in warnMin..warnMax:
+          let key = lineinfos.WarningsToStr[ord(a) - ord(warnMin)]
+          ret[key] = % (a in conf.notes)
+        ret
+
       var dumpdata = % [
         (key: "version", val: %VersionAsString),
         (key: "project_path", val: %conf.projectFull.string),
         (key: "defined_symbols", val: definedSymbols),
-        (key: "lib_paths", val: libpaths)
+        (key: "lib_paths", val: %libpaths),
+        (key: "out", val: %conf.outFile.string),
+        (key: "hints", val: hints),
+        (key: "warnings", val: warnings),
       ]
 
       msgWriteln(conf, $dumpdata, {msgStdout, msgSkipHook})