made tsequtils green again
This commit is contained in:
parent
22188a0647
commit
f3980eb24a
5 changed files with 45 additions and 8 deletions
|
|
@ -217,10 +217,19 @@ template emit*(s: expr): stmt =
|
|||
## Example:
|
||||
##
|
||||
## emit("echo " & '"' & "hello world".toUpper & '"')
|
||||
##
|
||||
block:
|
||||
const evaluated = s
|
||||
eval: result = evaluated.parseStmt
|
||||
##
|
||||
block:
|
||||
const evaluated = s
|
||||
eval: result = evaluated.parseStmt
|
||||
when false:
|
||||
template once(x: expr): expr =
|
||||
block:
|
||||
const y = x
|
||||
y
|
||||
|
||||
macro `payload`(x: stmt): stmt = result = once(s).parseStmt
|
||||
`payload`()
|
||||
|
||||
|
||||
proc expectKind*(n: PNimrodNode, k: TNimrodNodeKind) {.compileTime.} =
|
||||
## checks that `n` is of kind `k`. If this is not the case,
|
||||
|
|
@ -323,7 +332,7 @@ proc lispRepr*(n: PNimrodNode): string {.compileTime.} =
|
|||
|
||||
macro dumpTree*(s: stmt): stmt = echo s[1].treeRepr
|
||||
## Accepts a block of nimrod code and prints the parsed abstract syntax
|
||||
## tree using the `toTree` function.
|
||||
## tree using the `toTree` function. Printing is done *at compile time*.
|
||||
##
|
||||
## You can use this as a tool to explore the Nimrod's abstract syntax
|
||||
## tree and to discover what kind of nodes must be created to represent
|
||||
|
|
@ -331,7 +340,7 @@ macro dumpTree*(s: stmt): stmt = echo s[1].treeRepr
|
|||
|
||||
macro dumpLisp*(s: stmt): stmt = echo s[1].lispRepr
|
||||
## Accepts a block of nimrod code and prints the parsed abstract syntax
|
||||
## tree using the `toLisp` function.
|
||||
## tree using the `toLisp` function. Printing is done *at compile time*.
|
||||
##
|
||||
## See `dumpTree`.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue