summary refs log tree commit diff stats
path: root/compiler/rodread.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-04-08 11:56:21 +0200
committerAraq <rumpf_a@web.de>2013-04-08 11:56:21 +0200
commit00cdbca413057d9e9a213082cacb097980b7bb8e (patch)
treeeebdf71f953b6997c2df0d19c3c5e4f53c322891 /compiler/rodread.nim
parentfb3cda551a46753526bbffd38049d93a5df08a72 (diff)
downloadNim-00cdbca413057d9e9a213082cacb097980b7bb8e.tar.gz
rodfile viewer works again
Diffstat (limited to 'compiler/rodread.nim')
-rw-r--r--compiler/rodread.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rodread.nim b/compiler/rodread.nim
index d5eede8a4..6673456fb 100644
--- a/compiler/rodread.nim
+++ b/compiler/rodread.nim
@@ -140,6 +140,7 @@ type
     memfile: TMemFile    # unfortunately there is no point in time where we
                          # can close this! XXX
     methods*: TSymSeq
+    inViewMode: bool
   
   PRodReader* = ref TRodReader
 
@@ -386,7 +387,7 @@ proc decodeSym(r: PRodReader, info: TLineInfo): PSym =
     if debugIds: registerID(result)
   elif result.id != id:
     InternalError(info, "decodeSym: wrong id")
-  elif result.kind != skStub:
+  elif result.kind != skStub and not r.inViewMode:
     # we already loaded the symbol
     return
   else:
@@ -1022,6 +1023,7 @@ proc viewFile(rodfile: string) =
     rawMessage(errGenerated, "cannot open file (or maybe wrong version):" &
        rodfile)
     return
+  r.inViewMode = true
   var outf = system.open(rodfile.changeFileExt(".rod.txt"), fmWrite)
   while r.s[r.pos] != '\0':
     let section = rdWord(r)
@@ -1154,7 +1156,7 @@ proc viewFile(rodfile: string) =
         #outf.write("\n")
         #r.pos = p
       if r.s[r.pos] == ')': inc r.pos
-      outf.write("\n")
+      outf.write("<not supported by viewer>)\n")
     else:
       InternalError("invalid section: '" & section &
                     "' at " & $r.line & " in " & r.filename)