renamed writeln to writeLine in compiler
This commit is contained in:
parent
4e275f2a1a
commit
2a0f7b5de7
8 changed files with 228 additions and 228 deletions
|
|
@ -452,7 +452,7 @@ proc debug(n: PSym) =
|
||||||
elif n.kind == skUnknown:
|
elif n.kind == skUnknown:
|
||||||
msgWriteln("skUnknown")
|
msgWriteln("skUnknown")
|
||||||
else:
|
else:
|
||||||
#writeln(stdout, $symToYaml(n, 0, 1))
|
#writeLine(stdout, $symToYaml(n, 0, 1))
|
||||||
msgWriteln("$1_$2: $3, $4, $5, $6" % [
|
msgWriteln("$1_$2: $3, $4, $5, $6" % [
|
||||||
n.name.s, $n.id, $flagsToStr(n.flags), $flagsToStr(n.loc.flags),
|
n.name.s, $n.id, $flagsToStr(n.flags), $flagsToStr(n.loc.flags),
|
||||||
$lineInfoToStr(n.info), $n.kind])
|
$lineInfoToStr(n.info), $n.kind])
|
||||||
|
|
|
||||||
|
|
@ -596,7 +596,7 @@ proc externalFileChanged(filename: string): bool =
|
||||||
result = true
|
result = true
|
||||||
if result:
|
if result:
|
||||||
if open(f, crcFile, fmWrite):
|
if open(f, crcFile, fmWrite):
|
||||||
f.writeln($currentCrc)
|
f.writeLine($currentCrc)
|
||||||
close(f)
|
close(f)
|
||||||
|
|
||||||
proc addExternalFileToCompile*(filename: string) =
|
proc addExternalFileToCompile*(filename: string) =
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@ proc toGid(f: string): string =
|
||||||
|
|
||||||
proc saveMaxIds*(project: string) =
|
proc saveMaxIds*(project: string) =
|
||||||
var f = open(project.toGid, fmWrite)
|
var f = open(project.toGid, fmWrite)
|
||||||
f.writeln($gFrontEndId)
|
f.writeLine($gFrontEndId)
|
||||||
f.writeln($gBackendId)
|
f.writeLine($gBackendId)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
proc loadMaxIds*(project: string) =
|
proc loadMaxIds*(project: string) =
|
||||||
|
|
|
||||||
|
|
@ -593,7 +593,7 @@ var
|
||||||
|
|
||||||
proc suggestWriteln*(s: string) =
|
proc suggestWriteln*(s: string) =
|
||||||
if eStdOut in errorOutputs:
|
if eStdOut in errorOutputs:
|
||||||
if isNil(writelnHook): writeln(stdout, s)
|
if isNil(writelnHook): writeLine(stdout, s)
|
||||||
else: writelnHook(s)
|
else: writelnHook(s)
|
||||||
|
|
||||||
proc msgQuit*(x: int8) = quit x
|
proc msgQuit*(x: int8) = quit x
|
||||||
|
|
@ -688,7 +688,7 @@ var gTrackPos*: TLineInfo
|
||||||
|
|
||||||
proc outWriteln*(s: string) =
|
proc outWriteln*(s: string) =
|
||||||
## Writes to stdout. Always.
|
## Writes to stdout. Always.
|
||||||
if eStdOut in errorOutputs: writeln(stdout, s)
|
if eStdOut in errorOutputs: writeLine(stdout, s)
|
||||||
|
|
||||||
proc msgWriteln*(s: string) =
|
proc msgWriteln*(s: string) =
|
||||||
## Writes to stdout. If --stdout option is given, writes to stderr instead.
|
## Writes to stdout. If --stdout option is given, writes to stderr instead.
|
||||||
|
|
@ -698,9 +698,9 @@ proc msgWriteln*(s: string) =
|
||||||
if not isNil(writelnHook):
|
if not isNil(writelnHook):
|
||||||
writelnHook(s)
|
writelnHook(s)
|
||||||
elif optStdout in gGlobalOptions:
|
elif optStdout in gGlobalOptions:
|
||||||
if eStdErr in errorOutputs: writeln(stderr, s)
|
if eStdErr in errorOutputs: writeLine(stderr, s)
|
||||||
else:
|
else:
|
||||||
if eStdOut in errorOutputs: writeln(stdout, s)
|
if eStdOut in errorOutputs: writeLine(stdout, s)
|
||||||
|
|
||||||
macro callIgnoringStyle(theProc: typed, first: typed,
|
macro callIgnoringStyle(theProc: typed, first: typed,
|
||||||
args: varargs[expr]): stmt =
|
args: varargs[expr]): stmt =
|
||||||
|
|
@ -735,13 +735,13 @@ template styledMsgWriteln*(args: varargs[expr]) =
|
||||||
if not isNil(writelnHook):
|
if not isNil(writelnHook):
|
||||||
callIgnoringStyle(callWritelnHook, nil, args)
|
callIgnoringStyle(callWritelnHook, nil, args)
|
||||||
elif optStdout in gGlobalOptions:
|
elif optStdout in gGlobalOptions:
|
||||||
if eStdErr in errorOutputs: callIgnoringStyle(writeln, stderr, args)
|
if eStdErr in errorOutputs: callIgnoringStyle(writeLine, stderr, args)
|
||||||
else:
|
else:
|
||||||
if eStdOut in errorOutputs:
|
if eStdOut in errorOutputs:
|
||||||
if optUseColors in gGlobalOptions:
|
if optUseColors in gGlobalOptions:
|
||||||
callStyledEcho(args)
|
callStyledEcho(args)
|
||||||
else:
|
else:
|
||||||
callIgnoringStyle(writeln, stdout, args)
|
callIgnoringStyle(writeLine, stdout, args)
|
||||||
|
|
||||||
proc coordToStr(coord: int): string =
|
proc coordToStr(coord: int): string =
|
||||||
if coord == -1: result = "???"
|
if coord == -1: result = "???"
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ proc processCmdLine*(pass: TCmdLinePass, cmd: string) =
|
||||||
|
|
||||||
proc handleCmdLine() =
|
proc handleCmdLine() =
|
||||||
if paramCount() == 0:
|
if paramCount() == 0:
|
||||||
stdout.writeln(Usage)
|
stdout.writeLine(Usage)
|
||||||
else:
|
else:
|
||||||
processCmdLine(passCmd1, "")
|
processCmdLine(passCmd1, "")
|
||||||
if gProjectName != "":
|
if gProjectName != "":
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ proc completeGeneratedFilePath*(f: string, createSubDir: bool = true): string =
|
||||||
when noTimeMachine:
|
when noTimeMachine:
|
||||||
excludeDirFromTimeMachine(subdir)
|
excludeDirFromTimeMachine(subdir)
|
||||||
except OSError:
|
except OSError:
|
||||||
writeln(stdout, "cannot create directory: " & subdir)
|
writeLine(stdout, "cannot create directory: " & subdir)
|
||||||
quit(1)
|
quit(1)
|
||||||
result = joinPath(subdir, tail)
|
result = joinPath(subdir, tail)
|
||||||
#echo "completeGeneratedFilePath(", f, ") = ", result
|
#echo "completeGeneratedFilePath(", f, ") = ", result
|
||||||
|
|
|
||||||
|
|
@ -1031,28 +1031,28 @@ proc viewFile(rodfile: string) =
|
||||||
case section
|
case section
|
||||||
of "CRC":
|
of "CRC":
|
||||||
inc(r.pos) # skip ':'
|
inc(r.pos) # skip ':'
|
||||||
outf.writeln("CRC:", $decodeVInt(r.s, r.pos))
|
outf.writeLine("CRC:", $decodeVInt(r.s, r.pos))
|
||||||
of "ID":
|
of "ID":
|
||||||
inc(r.pos) # skip ':'
|
inc(r.pos) # skip ':'
|
||||||
r.moduleID = decodeVInt(r.s, r.pos)
|
r.moduleID = decodeVInt(r.s, r.pos)
|
||||||
setId(r.moduleID)
|
setId(r.moduleID)
|
||||||
outf.writeln("ID:", $r.moduleID)
|
outf.writeLine("ID:", $r.moduleID)
|
||||||
of "ORIGFILE":
|
of "ORIGFILE":
|
||||||
inc(r.pos)
|
inc(r.pos)
|
||||||
r.origFile = decodeStr(r.s, r.pos)
|
r.origFile = decodeStr(r.s, r.pos)
|
||||||
outf.writeln("ORIGFILE:", r.origFile)
|
outf.writeLine("ORIGFILE:", r.origFile)
|
||||||
of "OPTIONS":
|
of "OPTIONS":
|
||||||
inc(r.pos) # skip ':'
|
inc(r.pos) # skip ':'
|
||||||
r.options = cast[TOptions](int32(decodeVInt(r.s, r.pos)))
|
r.options = cast[TOptions](int32(decodeVInt(r.s, r.pos)))
|
||||||
outf.writeln("OPTIONS:", $r.options)
|
outf.writeLine("OPTIONS:", $r.options)
|
||||||
of "GOPTIONS":
|
of "GOPTIONS":
|
||||||
inc(r.pos) # skip ':'
|
inc(r.pos) # skip ':'
|
||||||
let dep = cast[TGlobalOptions](int32(decodeVInt(r.s, r.pos)))
|
let dep = cast[TGlobalOptions](int32(decodeVInt(r.s, r.pos)))
|
||||||
outf.writeln("GOPTIONS:", $dep)
|
outf.writeLine("GOPTIONS:", $dep)
|
||||||
of "CMD":
|
of "CMD":
|
||||||
inc(r.pos) # skip ':'
|
inc(r.pos) # skip ':'
|
||||||
let dep = cast[TCommands](int32(decodeVInt(r.s, r.pos)))
|
let dep = cast[TCommands](int32(decodeVInt(r.s, r.pos)))
|
||||||
outf.writeln("CMD:", $dep)
|
outf.writeLine("CMD:", $dep)
|
||||||
of "DEFINES":
|
of "DEFINES":
|
||||||
inc(r.pos) # skip ':'
|
inc(r.pos) # skip ':'
|
||||||
var d = 0
|
var d = 0
|
||||||
|
|
@ -1074,7 +1074,7 @@ proc viewFile(rodfile: string) =
|
||||||
r.files.add(finalPath.fileInfoIdx)
|
r.files.add(finalPath.fileInfoIdx)
|
||||||
inc(r.pos) # skip #10
|
inc(r.pos) # skip #10
|
||||||
inc(r.line)
|
inc(r.line)
|
||||||
outf.writeln finalPath
|
outf.writeLine finalPath
|
||||||
if r.s[r.pos] == ')': inc(r.pos)
|
if r.s[r.pos] == ')': inc(r.pos)
|
||||||
outf.write(")\n")
|
outf.write(")\n")
|
||||||
of "INCLUDES":
|
of "INCLUDES":
|
||||||
|
|
|
||||||
|
|
@ -218,12 +218,12 @@ proc cmpCandidates*(a, b: TCandidate): int =
|
||||||
result = complexDisambiguation(a.callee, b.callee)
|
result = complexDisambiguation(a.callee, b.callee)
|
||||||
|
|
||||||
proc writeMatches*(c: TCandidate) =
|
proc writeMatches*(c: TCandidate) =
|
||||||
writeln(stdout, "exact matches: " & $c.exactMatches)
|
writeLine(stdout, "exact matches: " & $c.exactMatches)
|
||||||
writeln(stdout, "generic matches: " & $c.genericMatches)
|
writeLine(stdout, "generic matches: " & $c.genericMatches)
|
||||||
writeln(stdout, "subtype matches: " & $c.subtypeMatches)
|
writeLine(stdout, "subtype matches: " & $c.subtypeMatches)
|
||||||
writeln(stdout, "intconv matches: " & $c.intConvMatches)
|
writeLine(stdout, "intconv matches: " & $c.intConvMatches)
|
||||||
writeln(stdout, "conv matches: " & $c.convMatches)
|
writeLine(stdout, "conv matches: " & $c.convMatches)
|
||||||
writeln(stdout, "inheritance: " & $c.inheritancePenalty)
|
writeLine(stdout, "inheritance: " & $c.inheritancePenalty)
|
||||||
|
|
||||||
proc argTypeToString(arg: PNode; prefer: TPreferedDesc): string =
|
proc argTypeToString(arg: PNode; prefer: TPreferedDesc): string =
|
||||||
if arg.kind in nkSymChoices:
|
if arg.kind in nkSymChoices:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue