json code generation works again

This commit is contained in:
Araq
2011-08-07 23:54:03 +02:00
parent 5131b3cea4
commit cb21fd4f8f
6 changed files with 17 additions and 14 deletions

View File

@@ -940,8 +940,8 @@ proc createVar(p: var TProc, typ: PType, indirect: bool): PRope =
result = putToSeq("0", indirect)
of tyFloat..tyFloat128:
result = putToSeq("0.0", indirect)
of tyRange:
result = createVar(p, typ.sons[0], indirect)
of tyRange, tyGenericInst:
result = createVar(p, lastSon(typ), indirect)
of tySet:
result = toRope("{}")
of tyBool:
@@ -979,7 +979,7 @@ proc createVar(p: var TProc, typ: PType, indirect: bool): PRope =
of tyVar, tyPtr, tyRef:
if mapType(t) == etyBaseIndex: result = putToSeq("[null, 0]", indirect)
else: result = putToSeq("null", indirect)
of tySequence, tyString, tyCString, tyPointer:
of tySequence, tyString, tyCString, tyPointer, tyProc:
result = putToSeq("null", indirect)
else:
internalError("createVar: " & $t.kind)

View File

@@ -34,7 +34,7 @@ type
TFileModuleMap = seq[TFileModuleRec]
var compMods: TFileModuleMap = @ []
var compMods: TFileModuleMap = @[]
proc registerModule(filename: string, module: PSym) =
# all compiled modules