rodfile viewer works again

This commit is contained in:
Araq 2013-04-08 11:56:21 +02:00
commit 00cdbca413

View file

@ -140,6 +140,7 @@ type
memfile: TMemFile # unfortunately there is no point in time where we memfile: TMemFile # unfortunately there is no point in time where we
# can close this! XXX # can close this! XXX
methods*: TSymSeq methods*: TSymSeq
inViewMode: bool
PRodReader* = ref TRodReader PRodReader* = ref TRodReader
@ -386,7 +387,7 @@ proc decodeSym(r: PRodReader, info: TLineInfo): PSym =
if debugIds: registerID(result) if debugIds: registerID(result)
elif result.id != id: elif result.id != id:
InternalError(info, "decodeSym: wrong id") InternalError(info, "decodeSym: wrong id")
elif result.kind != skStub: elif result.kind != skStub and not r.inViewMode:
# we already loaded the symbol # we already loaded the symbol
return return
else: else:
@ -1022,6 +1023,7 @@ proc viewFile(rodfile: string) =
rawMessage(errGenerated, "cannot open file (or maybe wrong version):" & rawMessage(errGenerated, "cannot open file (or maybe wrong version):" &
rodfile) rodfile)
return return
r.inViewMode = true
var outf = system.open(rodfile.changeFileExt(".rod.txt"), fmWrite) var outf = system.open(rodfile.changeFileExt(".rod.txt"), fmWrite)
while r.s[r.pos] != '\0': while r.s[r.pos] != '\0':
let section = rdWord(r) let section = rdWord(r)
@ -1154,7 +1156,7 @@ proc viewFile(rodfile: string) =
#outf.write("\n") #outf.write("\n")
#r.pos = p #r.pos = p
if r.s[r.pos] == ')': inc r.pos if r.s[r.pos] == ')': inc r.pos
outf.write("\n") outf.write("<not supported by viewer>)\n")
else: else:
InternalError("invalid section: '" & section & InternalError("invalid section: '" & section &
"' at " & $r.line & " in " & r.filename) "' at " & $r.line & " in " & r.filename)