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:
parent
e0f706804f
commit
89f9772f15
10 changed files with 64 additions and 34 deletions
|
|
@ -16,7 +16,7 @@
|
|||
# DOS or Macintosh text files, even when it is not the native format.
|
||||
|
||||
import
|
||||
hashes, options, msgs, strutils, platform, idents, lexbase, llstream,
|
||||
hashes, options, msgs, strutils, platform, idents, nimlexbase, llstream,
|
||||
wordrecg
|
||||
|
||||
const
|
||||
|
|
@ -530,10 +530,10 @@ proc HandleCRLF(L: var TLexer, pos: int): int =
|
|||
case L.buf[pos]
|
||||
of CR:
|
||||
registerLine()
|
||||
result = lexbase.HandleCR(L, pos)
|
||||
result = nimlexbase.HandleCR(L, pos)
|
||||
of LF:
|
||||
registerLine()
|
||||
result = lexbase.HandleLF(L, pos)
|
||||
result = nimlexbase.HandleLF(L, pos)
|
||||
else: result = pos
|
||||
|
||||
proc getString(L: var TLexer, tok: var TToken, rawMode: bool) =
|
||||
|
|
@ -559,7 +559,7 @@ proc getString(L: var TLexer, tok: var TToken, rawMode: bool) =
|
|||
pos = HandleCRLF(L, pos)
|
||||
buf = L.buf
|
||||
add(tok.literal, tnl)
|
||||
of lexbase.EndOfFile:
|
||||
of nimlexbase.EndOfFile:
|
||||
var line2 = L.linenumber
|
||||
L.LineNumber = line
|
||||
lexMessagePos(L, errClosingTripleQuoteExpected, L.lineStart)
|
||||
|
|
@ -581,7 +581,7 @@ proc getString(L: var TLexer, tok: var TToken, rawMode: bool) =
|
|||
else:
|
||||
inc(pos) # skip '"'
|
||||
break
|
||||
elif c in {CR, LF, lexbase.EndOfFile}:
|
||||
elif c in {CR, LF, nimlexbase.EndOfFile}:
|
||||
lexMessage(L, errClosingQuoteExpected)
|
||||
break
|
||||
elif (c == '\\') and not rawMode:
|
||||
|
|
@ -680,7 +680,7 @@ proc scanComment(L: var TLexer, tok: var TToken) =
|
|||
var col = getColNumber(L, pos)
|
||||
while true:
|
||||
var lastBackslash = -1
|
||||
while buf[pos] notin {CR, LF, lexbase.EndOfFile}:
|
||||
while buf[pos] notin {CR, LF, nimlexbase.EndOfFile}:
|
||||
if buf[pos] == '\\': lastBackslash = pos+1
|
||||
add(tok.literal, buf[pos])
|
||||
inc(pos)
|
||||
|
|
@ -688,7 +688,7 @@ proc scanComment(L: var TLexer, tok: var TToken) =
|
|||
# a backslash is a continuation character if only followed by spaces
|
||||
# plus a newline:
|
||||
while buf[lastBackslash] == ' ': inc(lastBackslash)
|
||||
if buf[lastBackslash] notin {CR, LF, lexbase.EndOfFile}:
|
||||
if buf[lastBackslash] notin {CR, LF, nimlexbase.EndOfFile}:
|
||||
# false positive:
|
||||
lastBackslash = -1
|
||||
|
||||
|
|
@ -841,7 +841,7 @@ proc rawGetTok(L: var TLexer, tok: var TToken) =
|
|||
else:
|
||||
if c in OpChars:
|
||||
getOperator(L, tok)
|
||||
elif c == lexbase.EndOfFile:
|
||||
elif c == nimlexbase.EndOfFile:
|
||||
tok.toktype = tkEof
|
||||
else:
|
||||
tok.literal = c & ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue