deprecated macros.emit
This commit is contained in:
parent
c30e9b9b75
commit
c416346d38
1 changed files with 2 additions and 1 deletions
|
|
@ -884,7 +884,7 @@ proc boolVal*(n: NimNode): bool {.compileTime, noSideEffect.} =
|
||||||
else: n == bindSym"true" # hacky solution for now
|
else: n == bindSym"true" # hacky solution for now
|
||||||
|
|
||||||
when not defined(booting):
|
when not defined(booting):
|
||||||
template emit*(e: static[string]): stmt =
|
template emit*(e: static[string]): stmt {.deprecated.} =
|
||||||
## accepts a single string argument and treats it as nim code
|
## accepts a single string argument and treats it as nim code
|
||||||
## that should be inserted verbatim in the program
|
## that should be inserted verbatim in the program
|
||||||
## Example:
|
## Example:
|
||||||
|
|
@ -892,6 +892,7 @@ when not defined(booting):
|
||||||
## .. code-block:: nim
|
## .. code-block:: nim
|
||||||
## emit("echo " & '"' & "hello world".toUpper & '"')
|
## emit("echo " & '"' & "hello world".toUpper & '"')
|
||||||
##
|
##
|
||||||
|
## Deprecated since version 0.15 since it's so rarely useful.
|
||||||
macro payload: stmt {.gensym.} =
|
macro payload: stmt {.gensym.} =
|
||||||
result = parseStmt(e)
|
result = parseStmt(e)
|
||||||
payload()
|
payload()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue