summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/vmgen.nim6
-rw-r--r--tests/test_nimscript.nims1
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index b869be113..8f0c72e45 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -1773,8 +1773,8 @@ proc gen(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags = {}) =
   of nkAddr, nkHiddenAddr: genAddrDeref(c, n, dest, opcAddrNode, flags)
   of nkIfStmt, nkIfExpr: genIf(c, n, dest)
   of nkWhenStmt:
-      # This is "when nimvm" node. Chose the first branch.
-      gen(c, n.sons[0].sons[1], dest)
+    # This is "when nimvm" node. Chose the first branch.
+    gen(c, n.sons[0].sons[1], dest)
   of nkCaseStmt: genCase(c, n, dest)
   of nkWhileStmt:
     unused(n, dest)
@@ -1810,7 +1810,7 @@ proc gen(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags = {}) =
   of nkVarSection, nkLetSection:
     unused(n, dest)
     genVarSection(c, n)
-  of declarativeDefs:
+  of declarativeDefs, nkMacroDef:
     unused(n, dest)
   of nkLambdaKinds:
     #let s = n.sons[namePos].sym
diff --git a/tests/test_nimscript.nims b/tests/test_nimscript.nims
index 2500bac73..d3eb9808e 100644
--- a/tests/test_nimscript.nims
+++ b/tests/test_nimscript.nims
@@ -21,5 +21,6 @@ import subexes
 import tables
 import unicode
 import uri
+import macros
 
 echo "Nimscript imports are successful."