diff options
author | Araq <rumpf_a@web.de> | 2014-01-13 01:22:03 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-01-13 01:22:03 +0100 |
commit | 51ee524109cf7e3e86c676bc1676063a01bfd979 (patch) | |
tree | 0f611cc00834f0452a3f8ed1729c7b62f676f237 /lib/core | |
parent | 4045d7829b0ab9c8749aa701515a53c279db9958 (diff) | |
parent | 1280c56f386111b542c8f0effdd3e5cbc5e84622 (diff) | |
download | Nim-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.nim | 22 |
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, |