mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
removed 'system.eval'
This commit is contained in:
@@ -494,7 +494,7 @@ const
|
||||
|
||||
from strutils import cmpIgnoreStyle, format
|
||||
|
||||
proc ExpectKind*(n: PNimrodNode; k: set[TNimrodNodeKind]) {.compileTime.} =
|
||||
proc expectKind*(n: PNimrodNode; k: set[TNimrodNodeKind]) {.compileTime.} =
|
||||
assert n.kind in k, "Expected one of $1, got $2".format(k, n.kind)
|
||||
|
||||
proc newProc*(name = newEmptyNode(); params: openarray[PNimrodNode] = [];
|
||||
|
||||
@@ -2619,12 +2619,13 @@ type
|
||||
PNimrodNode* {.magic: "PNimrodNode".} = ref TNimrodNode
|
||||
## represents a Nimrod AST node. Macros operate on this type.
|
||||
|
||||
template eval*(blk: stmt): stmt =
|
||||
## executes a block of code at compile time just as if it was a macro
|
||||
## optionally, the block can return an AST tree that will replace the
|
||||
## eval expression
|
||||
macro payload: stmt {.gensym.} = blk
|
||||
payload()
|
||||
when false:
|
||||
template eval*(blk: stmt): stmt =
|
||||
## executes a block of code at compile time just as if it was a macro
|
||||
## optionally, the block can return an AST tree that will replace the
|
||||
## eval expression
|
||||
macro payload: stmt {.gensym.} = blk
|
||||
payload()
|
||||
|
||||
when hostOS != "standalone":
|
||||
proc insert*(x: var string, item: string, i = 0) {.noSideEffect.} =
|
||||
|
||||
Reference in New Issue
Block a user