mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 13:33:22 +00:00
xmltree.<> macro works again
This commit is contained in:
@@ -17,11 +17,11 @@ proc execute*(program: string) =
|
||||
passes.gIncludeFile = includeModule
|
||||
passes.gImportModule = importModule
|
||||
initDefines()
|
||||
LoadConfigs(DefaultConfig)
|
||||
loadConfigs(DefaultConfig)
|
||||
|
||||
initDefines()
|
||||
DefineSymbol("nimrodvm")
|
||||
when hasFFI: DefineSymbol("nimffi")
|
||||
defineSymbol("nimrodvm")
|
||||
when hasFFI: defineSymbol("nimffi")
|
||||
registerPass(verbosePass)
|
||||
registerPass(semPass)
|
||||
registerPass(vmPass)
|
||||
@@ -30,4 +30,4 @@ proc execute*(program: string) =
|
||||
compileSystemModule()
|
||||
var m = makeStdinModule()
|
||||
incl(m.flags, sfMainModule)
|
||||
processModule(m, LLStreamOpen(program), nil)
|
||||
processModule(m, llStreamOpen(program), nil)
|
||||
|
||||
@@ -173,12 +173,14 @@ proc asgnComplex(x: var TFullReg, y: TFullReg) =
|
||||
of rkRegisterAddr: x.regAddr = y.regAddr
|
||||
of rkNodeAddr: x.nodeAddr = y.nodeAddr
|
||||
|
||||
proc putIntoNode(n: PNode; x: TFullReg) =
|
||||
proc putIntoNode(n: var PNode; x: TFullReg) =
|
||||
case x.kind
|
||||
of rkNone: discard
|
||||
of rkInt: n.intVal = x.intVal
|
||||
of rkFloat: n.floatVal = x.floatVal
|
||||
of rkNode: n[] = x.node[]
|
||||
of rkNode:
|
||||
if nfIsRef in x.node.flags: n = x.node
|
||||
else: n[] = x.node[]
|
||||
of rkRegisterAddr: putIntoNode(n, x.regAddr[])
|
||||
of rkNodeAddr: n[] = x.nodeAddr[][]
|
||||
|
||||
|
||||
@@ -1001,7 +1001,7 @@ proc genAsgn(c: PCtx; le, ri: PNode; requiresCopy: bool) =
|
||||
c.gABC(left, opcWrObj, dest, idx, tmp)
|
||||
c.freeTemp(tmp)
|
||||
of nkDerefExpr, nkHiddenDeref:
|
||||
let dest = c.genx(le, {gfAddrOf})
|
||||
let dest = c.genx(le.sons[0], {gfAddrOf})
|
||||
let tmp = c.genx(ri)
|
||||
c.gABC(le, opcWrDeref, dest, tmp)
|
||||
c.freeTemp(tmp)
|
||||
@@ -1542,9 +1542,9 @@ proc genProc(c: PCtx; s: PSym): int =
|
||||
c.gABC(body, opcEof, eofInstr.regA)
|
||||
c.optimizeJumps(result)
|
||||
s.offset = c.prc.maxSlots
|
||||
#if s.name.s == "importImpl_forward" or s.name.s == "importImpl":
|
||||
#c.echoCode(result)
|
||||
#echo renderTree(body)
|
||||
#if s.name.s == "xmlConstructor":
|
||||
# echo renderTree(body)
|
||||
# c.echoCode(result)
|
||||
c.prc = oldPrc
|
||||
else:
|
||||
c.prc.maxSlots = s.offset
|
||||
|
||||
Reference in New Issue
Block a user