nimrod dump can now produce a machine readable json report

The data in the report includes necessary information for starting
the compiler service and setting up the project paths in the IDE.

the default verbosity of 1 is now set in the compiler code to fix an
issue with verbosity being temporary set to 1 during config parsing
even when it's explicitly overridden on the command-line.

compiler/lexbase was temporary renamed to nimlexbase as a
work-around for a codegen naming conflict with lib/pure/lexbase
resulting in linking errors (further investigation needed).
This commit is contained in:
Zahary Karadjov 2013-05-01 20:20:48 +03:00
commit 89f9772f15
10 changed files with 64 additions and 34 deletions

View file

@ -11,7 +11,7 @@
## is needed for incremental compilation.
import
ast, astalgo, ropes, options, strutils, lexbase, msgs, cgendata, rodutils,
ast, astalgo, ropes, options, strutils, nimlexbase, msgs, cgendata, rodutils,
intsets, platform, llstream
# Careful! Section marks need to contain a tabulator so that they cannot
@ -119,8 +119,8 @@ proc skipWhite(L: var TBaseLexer) =
var pos = L.bufpos
while true:
case ^pos
of CR: pos = lexbase.HandleCR(L, pos)
of LF: pos = lexbase.HandleLF(L, pos)
of CR: pos = nimlexbase.HandleCR(L, pos)
of LF: pos = nimlexbase.HandleLF(L, pos)
of ' ': inc pos
else: break
L.bufpos = pos
@ -129,8 +129,8 @@ proc skipUntilCmd(L: var TBaseLexer) =
var pos = L.bufpos
while true:
case ^pos
of CR: pos = lexbase.HandleCR(L, pos)
of LF: pos = lexbase.HandleLF(L, pos)
of CR: pos = nimlexbase.HandleCR(L, pos)
of LF: pos = nimlexbase.HandleLF(L, pos)
of '\0': break
of '/':
if ^(pos+1) == '*' and ^(pos+2) == '\t':
@ -153,11 +153,11 @@ when false:
while true:
case buf[pos]
of CR:
pos = lexbase.HandleCR(L, pos)
pos = nimlexbase.HandleCR(L, pos)
buf = L.buf
result.data.add(tnl)
of LF:
pos = lexbase.HandleLF(L, pos)
pos = nimlexbase.HandleLF(L, pos)
buf = L.buf
result.data.add(tnl)
of '\0':
@ -179,11 +179,11 @@ proc readVerbatimSection(L: var TBaseLexer): PRope =
while true:
case buf[pos]
of CR:
pos = lexbase.HandleCR(L, pos)
pos = nimlexbase.HandleCR(L, pos)
buf = L.buf
r.add(tnl)
of LF:
pos = lexbase.HandleLF(L, pos)
pos = nimlexbase.HandleLF(L, pos)
buf = L.buf
r.add(tnl)
of '\0':