nimpretty: fixes #9384
This commit is contained in:
parent
88adf77569
commit
bd9d5787f0
2 changed files with 11 additions and 7 deletions
|
|
@ -72,12 +72,16 @@ proc parsePipe(filename: AbsoluteFile, inputStream: PLLStream; cache: IdentCache
|
||||||
i = 0
|
i = 0
|
||||||
inc linenumber
|
inc linenumber
|
||||||
if i+1 < line.len and line[i] == '#' and line[i+1] == '?':
|
if i+1 < line.len and line[i] == '#' and line[i+1] == '?':
|
||||||
inc(i, 2)
|
when defined(nimpretty2):
|
||||||
while i < line.len and line[i] in Whitespace: inc(i)
|
# XXX this is a bit hacky, but oh well...
|
||||||
var q: TParser
|
quit "can't nimpretty a source code filter"
|
||||||
parser.openParser(q, filename, llStreamOpen(substr(line, i)), cache, config)
|
else:
|
||||||
result = parser.parseAll(q)
|
inc(i, 2)
|
||||||
parser.closeParser(q)
|
while i < line.len and line[i] in Whitespace: inc(i)
|
||||||
|
var q: TParser
|
||||||
|
parser.openParser(q, filename, llStreamOpen(substr(line, i)), cache, config)
|
||||||
|
result = parser.parseAll(q)
|
||||||
|
parser.closeParser(q)
|
||||||
llStreamClose(s)
|
llStreamClose(s)
|
||||||
|
|
||||||
proc getFilter(ident: PIdent): TFilterKind =
|
proc getFilter(ident: PIdent): TFilterKind =
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ var
|
||||||
failures = 0
|
failures = 0
|
||||||
|
|
||||||
when defined(develop):
|
when defined(develop):
|
||||||
const nimp = "bin/nimpretty".addFileExt(ExeExt)
|
const nimp = "bin" / "nimpretty".addFileExt(ExeExt)
|
||||||
if execShellCmd("nim c -o:$# nimpretty/nimpretty.nim" % [nimp]) != 0:
|
if execShellCmd("nim c -o:$# nimpretty/nimpretty.nim" % [nimp]) != 0:
|
||||||
quit("FAILURE: compilation of nimpretty failed")
|
quit("FAILURE: compilation of nimpretty failed")
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue