diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2018-12-09 21:45:15 -0800 |
---|---|---|
committer | Timothee Cour <timothee.cour2@gmail.com> | 2018-12-09 21:45:15 -0800 |
commit | fc7b3a7c2a223b04087426c3b7df9edc12ce1f03 (patch) | |
tree | 5e529ab72692bed0eed5d3b6ca14a30aa714d09e /compiler/main.nim | |
parent | 606b43ba1130b5672e91ddd156d81267634ed465 (diff) | |
download | Nim-fc7b3a7c2a223b04087426c3b7df9edc12ce1f03.tar.gz |
enhance `dump --dump.format:json`
Diffstat (limited to 'compiler/main.nim')
-rw-r--r-- | compiler/main.nim | 18 |
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}) |