cleanup of #4113
This commit is contained in:
parent
d3fe4a2db1
commit
a406ebbac9
2 changed files with 30 additions and 30 deletions
|
|
@ -1186,34 +1186,34 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
let rb = instr.regB
|
let rb = instr.regB
|
||||||
let rc = instr.regC
|
let rc = instr.regC
|
||||||
case rc:
|
case rc:
|
||||||
of 0:
|
of 0:
|
||||||
# getType opcode:
|
# getType opcode:
|
||||||
ensureKind(rkNode)
|
ensureKind(rkNode)
|
||||||
if regs[rb].kind == rkNode and regs[rb].node.typ != nil:
|
if regs[rb].kind == rkNode and regs[rb].node.typ != nil:
|
||||||
regs[ra].node = opMapTypeToAst(regs[rb].node.typ, c.debug[pc])
|
regs[ra].node = opMapTypeToAst(regs[rb].node.typ, c.debug[pc])
|
||||||
else:
|
|
||||||
stackTrace(c, tos, pc, errGenerated, "node has no type")
|
|
||||||
of 1:
|
|
||||||
# typeKind opcode:
|
|
||||||
ensureKind(rkInt)
|
|
||||||
if regs[rb].kind == rkNode and regs[rb].node.typ != nil:
|
|
||||||
regs[ra].intVal = ord(regs[rb].node.typ.kind)
|
|
||||||
#else:
|
|
||||||
# stackTrace(c, tos, pc, errGenerated, "node has no type")
|
|
||||||
of 2:
|
|
||||||
# getTypeInst opcode:
|
|
||||||
ensureKind(rkNode)
|
|
||||||
if regs[rb].kind == rkNode and regs[rb].node.typ != nil:
|
|
||||||
regs[ra].node = opMapTypeInstToAst(regs[rb].node.typ, c.debug[pc])
|
|
||||||
else:
|
|
||||||
stackTrace(c, tos, pc, errGenerated, "node has no type")
|
|
||||||
else:
|
else:
|
||||||
# getTypeImpl opcode:
|
stackTrace(c, tos, pc, errGenerated, "node has no type")
|
||||||
ensureKind(rkNode)
|
of 1:
|
||||||
if regs[rb].kind == rkNode and regs[rb].node.typ != nil:
|
# typeKind opcode:
|
||||||
regs[ra].node = opMapTypeImplToAst(regs[rb].node.typ, c.debug[pc])
|
ensureKind(rkInt)
|
||||||
else:
|
if regs[rb].kind == rkNode and regs[rb].node.typ != nil:
|
||||||
stackTrace(c, tos, pc, errGenerated, "node has no type")
|
regs[ra].intVal = ord(regs[rb].node.typ.kind)
|
||||||
|
#else:
|
||||||
|
# stackTrace(c, tos, pc, errGenerated, "node has no type")
|
||||||
|
of 2:
|
||||||
|
# getTypeInst opcode:
|
||||||
|
ensureKind(rkNode)
|
||||||
|
if regs[rb].kind == rkNode and regs[rb].node.typ != nil:
|
||||||
|
regs[ra].node = opMapTypeInstToAst(regs[rb].node.typ, c.debug[pc])
|
||||||
|
else:
|
||||||
|
stackTrace(c, tos, pc, errGenerated, "node has no type")
|
||||||
|
else:
|
||||||
|
# getTypeImpl opcode:
|
||||||
|
ensureKind(rkNode)
|
||||||
|
if regs[rb].kind == rkNode and regs[rb].node.typ != nil:
|
||||||
|
regs[ra].node = opMapTypeImplToAst(regs[rb].node.typ, c.debug[pc])
|
||||||
|
else:
|
||||||
|
stackTrace(c, tos, pc, errGenerated, "node has no type")
|
||||||
of opcNStrVal:
|
of opcNStrVal:
|
||||||
decodeB(rkNode)
|
decodeB(rkNode)
|
||||||
createStr regs[ra]
|
createStr regs[ra]
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ proc mapTypeToAstX(t: PType; info: TLineInfo;
|
||||||
of tyArrayConstr, tyArray:
|
of tyArrayConstr, tyArray:
|
||||||
result = newNodeIT(nkBracketExpr, if t.n.isNil: info else: t.n.info, t)
|
result = newNodeIT(nkBracketExpr, if t.n.isNil: info else: t.n.info, t)
|
||||||
result.add atomicType("array")
|
result.add atomicType("array")
|
||||||
if inst:
|
if inst and t.sons[0].kind == tyRange:
|
||||||
var rng = newNodeX(nkInfix)
|
var rng = newNodeX(nkInfix)
|
||||||
rng.add newIdentNode(getIdent(".."), info)
|
rng.add newIdentNode(getIdent(".."), info)
|
||||||
rng.add t.sons[0].n.sons[0].copyTree
|
rng.add t.sons[0].n.sons[0].copyTree
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue