summary refs log tree commit diff stats
path: root/lib/core/macros.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/core/macros.nim')
-rwxr-xr-xlib/core/macros.nim6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index c30474b70..be6aecab5 100755
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -234,16 +234,14 @@ proc getAst*(macroOrTemplate: expr): PNimrodNode {.magic: "ExpandToAst".}
   ##   macro FooMacro() =
   ##     var ast = getAst(BarTemplate())
 
-template emit*(s: expr): stmt =
+template emit*(e: expr[string]): stmt =
   ## accepts a single string argument and treats it as nimrod code
   ## that should be inserted verbatim in the program
   ## Example:
   ##
   ##   emit("echo " & '"' & "hello world".toUpper & '"')
   ##
-  block:
-    const evaluated = s
-    eval: result = evaluated.parseStmt
+  eval: result = e.parseStmt
 
 proc expectKind*(n: PNimrodNode, k: TNimrodNodeKind) {.compileTime.} =
   ## checks that `n` is of kind `k`. If this is not the case,