diff options
author | Araq <rumpf_a@web.de> | 2015-02-23 10:16:20 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-02-24 00:13:27 +0100 |
commit | 1e6aef62ba8e81212667e2f1fa6b50c48ee98a91 (patch) | |
tree | 47f602bcb9e8fd12c2851e5e175c4085d6fc7de0 /compiler | |
parent | fb467859698b0dff8054c24593ed91cc00b742f2 (diff) | |
download | Nim-1e6aef62ba8e81212667e2f1fa6b50c48ee98a91.tar.gz |
macros.PNimrodNode is now NimNode
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/condsyms.nim | 1 | ||||
-rw-r--r-- | compiler/semexprs.nim | 4 | ||||
-rw-r--r-- | compiler/semtypes.nim | 5 | ||||
-rw-r--r-- | compiler/vm.nim | 2 | ||||
-rw-r--r-- | compiler/vmgen.nim | 2 |
5 files changed, 9 insertions, 5 deletions
diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim index 8a5189167..7ddf44d4a 100644 --- a/compiler/condsyms.nim +++ b/compiler/condsyms.nim @@ -89,6 +89,7 @@ proc initDefines*() = defineSymbol("nimparsebiggestfloatmagic") defineSymbol("nimalias") defineSymbol("nimlocks") + defineSymbol("nimnode") # add platform specific symbols: for c in low(CPU)..high(CPU): diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index da64df9dc..89469ae50 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1512,7 +1512,9 @@ proc semExpandToAst(c: PContext, n: PNode): PNode = # Preserve the magic symbol in order to be handled in evals.nim internalAssert n.sons[0].sym.magic == mExpandToAst - n.typ = getSysSym("PNimrodNode").typ # expandedSym.getReturnType + #n.typ = getSysSym("PNimrodNode").typ # expandedSym.getReturnType + n.typ = if getCompilerProc("NimNode") != nil: sysTypeFromName"NimNode" + else: sysTypeFromName"PNimrodNode" result = n proc semExpandToAst(c: PContext, n: PNode, magicSym: PSym, diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 808653d55..7cd748829 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -672,8 +672,9 @@ proc addParamOrResult(c: PContext, param: PSym, kind: TSymKind) = elif param.typ.kind == tyTypeDesc: addDecl(c, param) else: - # within a macro, every param has the type PNimrodNode! - let nn = getSysSym"PNimrodNode" + # within a macro, every param has the type NimNode! + let nn = if getCompilerProc("NimNode") != nil: getSysSym"NimNode" + else: getSysSym"PNimrodNode" var a = copySym(param) a.typ = nn.typ addDecl(c, a) diff --git a/compiler/vm.nim b/compiler/vm.nim index f7e7fd2af..891718274 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -154,7 +154,7 @@ proc moveConst(x: var TFullReg, y: TFullReg) = of rkNodeAddr: x.nodeAddr = y.nodeAddr # this seems to be the best way to model the reference semantics -# of PNimrodNode: +# of system.NimNode: template asgnRef(x, y: expr) = moveConst(x, y) proc copyValue(src: PNode): PNode = diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index c69957032..f367d4cf9 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1247,7 +1247,7 @@ proc genGlobalInit(c: PCtx; n: PNode; s: PSym) = s.position = c.globals.len # This is rather hard to support, due to the laziness of the VM code # generator. See tests/compile/tmacro2 for why this is necessary: - # var decls{.compileTime.}: seq[PNimrodNode] = @[] + # var decls{.compileTime.}: seq[NimNode] = @[] let dest = c.getTemp(s.typ) c.gABx(n, opcLdGlobal, dest, s.position) let tmp = c.genx(s.ast) |