summary refs log tree commit diff stats
path: root/lib/core
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-12-29 17:21:00 +0200
committerZahary Karadjov <zahary@gmail.com>2013-12-29 17:21:00 +0200
commitafddae5aaf08a3a3357ec33d0bc82bdba0f5dc08 (patch)
treeb6bd783f813797dcb5be4abaaade5ad599bb1c5c /lib/core
parent437cfa73abd8fdf878cc2af2c44acbc4b6ec3a56 (diff)
parent72291875bf895e8e0d22ab3f375752417b07ed25 (diff)
downloadNim-afddae5aaf08a3a3357ec33d0bc82bdba0f5dc08.tar.gz
Merge branch 'upstream' into devel
Conflicts:
	compiler/ccgutils.nim
	compiler/msgs.nim
	compiler/sem.nim
	compiler/semexprs.nim
	compiler/seminst.nim
	compiler/semmagic.nim
	compiler/semstmts.nim
	compiler/semtypes.nim
	compiler/semtypinst.nim
	compiler/sigmatch.nim
	compiler/types.nim
	compiler/vmgen.nim
	lib/core/macros.nim
	lib/system.nim
	tests/reject/tenummix.nim
	web/news.txt
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,