summary refs log tree commit diff stats
path: root/lib/core
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-01-13 01:22:03 +0100
committerAraq <rumpf_a@web.de>2014-01-13 01:22:03 +0100
commit51ee524109cf7e3e86c676bc1676063a01bfd979 (patch)
tree0f611cc00834f0452a3f8ed1729c7b62f676f237 /lib/core
parent4045d7829b0ab9c8749aa701515a53c279db9958 (diff)
parent1280c56f386111b542c8f0effdd3e5cbc5e84622 (diff)
downloadNim-51ee524109cf7e3e86c676bc1676063a01bfd979.tar.gz
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
Diffstat (limited to 'lib/core')
-rw-r--r--lib/core/macros.nim22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index f1f1c8ddb..0356067f1 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -59,7 +59,8 @@ type
     nnkBindStmt, nnkMixinStmt, nnkUsingStmt,
     nnkCommentStmt, nnkStmtListExpr, nnkBlockExpr,
     nnkStmtListType, nnkBlockType, nnkTypeOfExpr, nnkObjectTy,
-    nnkTupleTy, nnkTypeClassTy, nnkRecList, nnkRecCase, nnkRecWhen,
+    nnkTupleTy, nnkTypeClassTy, nnkStaticTy,
+    nnkRecList, nnkRecCase, nnkRecWhen,
     nnkRefTy, nnkPtrTy, nnkVarTy,
     nnkConstTy, nnkMutableTy,
     nnkDistinctTy,
@@ -293,16 +294,15 @@ proc quote*(bl: stmt, op = "``"): PNimrodNode {.magic: "QuoteAst".}
   ##       if not `ex`:
   ##         echo `info` & ": Check failed: " & `expString`
   
-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:
-  ##
-  ## .. code-block:: nimrod
-  ##
-  ##   emit("echo " & '"' & "hello world".toUpper & '"')
-  ##
-  eval: result = e.parseStmt
+when not defined(booting):
+  template emit*(e: static[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 & '"')
+    ##
+    eval: result = e.parseStmt
 
 proc expectKind*(n: PNimrodNode, k: TNimrodNodeKind) {.compileTime.} =
   ## checks that `n` is of kind `k`. If this is not the case,