summary refs log tree commit diff stats
path: root/compiler/vm.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-08-21 02:34:34 +0200
committerAraq <rumpf_a@web.de>2015-08-21 02:34:34 +0200
commit695e2e970e5ee560d324d6775c202f9b808f97fa (patch)
treeee9a89024a46a4eaf425c1000b5c0406c5c99633 /compiler/vm.nim
parenta2bb7d4c71e0804dd57c8e4d7ba16cf61ab184f1 (diff)
downloadNim-695e2e970e5ee560d324d6775c202f9b808f97fa.tar.gz
implemented macros.getImpl
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r--compiler/vm.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index b15c55565..b7b09f4a3 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -781,6 +781,14 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
         regs[ra].node.add(copyTree(regs[rb].regToNode))
       else:
         stackTrace(c, tos, pc, errNilAccess)
+    of opcGetImpl:
+      decodeB(rkNode)
+      let a = regs[rb].node
+      if a.kind == nkSym:
+        regs[ra].node = if a.sym.ast.isNil: newNode(nkNilLit)
+                        else: copyTree(a.sym.ast)
+      else:
+        stackTrace(c, tos, pc, errFieldXNotFound, "symbol")
     of opcEcho:
       let rb = instr.regB
       if rb == 1: