mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
more tests work
This commit is contained in:
@@ -802,9 +802,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode =
|
||||
decodeB(nkIntLit)
|
||||
regs[ra].intVal = ord(regs[rb].skipMeta.kind == nkNilLit)
|
||||
of opcNBindSym:
|
||||
# trivial implementation:
|
||||
decodeB(nkMetaNode)
|
||||
setMeta(regs[ra], regs[rb].skipMeta.sons[1])
|
||||
decodeBx(nkMetaNode)
|
||||
setMeta(regs[ra], copyTree(c.constants.sons[rbx]))
|
||||
of opcNChild:
|
||||
decodeBC(nkMetaNode)
|
||||
if regs[rb].kind != nkMetaNode:
|
||||
|
||||
@@ -101,7 +101,6 @@ type
|
||||
opcRaise,
|
||||
opcNChild,
|
||||
opcNSetChild,
|
||||
opcNBindSym, # opcodes for the AST manipulation following
|
||||
opcCallSite,
|
||||
opcNewStr,
|
||||
|
||||
@@ -120,6 +119,7 @@ type
|
||||
opcAsgnConst, # dest = copy(constants[Bx])
|
||||
opcLdGlobal, # dest = globals[Bx]
|
||||
opcLdImmInt, # dest = immediate value
|
||||
opcNBindSym,
|
||||
opcWrGlobal,
|
||||
opcWrGlobalRef,
|
||||
opcGlobalAlias, # load an alias to a global into a register
|
||||
|
||||
@@ -781,7 +781,13 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) =
|
||||
of mNNewNimNode: genBinaryABC(c, n, dest, opcNNewNimNode)
|
||||
of mNCopyNimNode: genUnaryABC(c, n, dest, opcNCopyNimNode)
|
||||
of mNCopyNimTree: genUnaryABC(c, n, dest, opcNCopyNimTree)
|
||||
of mNBindSym: genUnaryABC(c, n, dest, opcNBindSym)
|
||||
of mNBindSym:
|
||||
if n[1].kind in {nkClosedSymChoice, nkOpenSymChoice, nkSym}:
|
||||
let idx = c.genLiteral(n[1])
|
||||
if dest < 0: dest = c.getTemp(n.typ)
|
||||
c.gABx(n, opcNBindSym, dest, idx)
|
||||
else:
|
||||
internalError(n.info, "invalid bindSym usage")
|
||||
of mStrToIdent: genUnaryABC(c, n, dest, opcStrToIdent)
|
||||
of mIdentToStr: genUnaryABC(c, n, dest, opcIdentToStr)
|
||||
of mEqIdent: genBinaryABC(c, n, dest, opcEqIdent)
|
||||
|
||||
Reference in New Issue
Block a user