diff options
author | def <dennis@felsin9.de> | 2015-03-17 17:50:32 +0100 |
---|---|---|
committer | def <dennis@felsin9.de> | 2015-03-17 17:50:32 +0100 |
commit | fd4e6299057b0ce59a89553e7c32a9ea62da14db (patch) | |
tree | 45bb61ec52b415ffd07caae7c5b7fc10a0d99577 /tests/macros/tdumpast2.nim | |
parent | 8e651fa0d456786df15445e10e14b9d4e96c21ff (diff) | |
download | Nim-fd4e6299057b0ce59a89553e7c32a9ea62da14db.tar.gz |
Rename PNimrodNode to NimNode
Diffstat (limited to 'tests/macros/tdumpast2.nim')
-rw-r--r-- | tests/macros/tdumpast2.nim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/macros/tdumpast2.nim b/tests/macros/tdumpast2.nim index 2a7024a01..6b694fa77 100644 --- a/tests/macros/tdumpast2.nim +++ b/tests/macros/tdumpast2.nim @@ -1,13 +1,13 @@ -# Dump the contents of a PNimrodNode +# Dump the contents of a NimNode import macros -proc dumpit(n: PNimrodNode): string {.compileTime.} = +proc dumpit(n: NimNode): string {.compileTime.} = if n == nil: return "nil" result = $n.kind add(result, "(") case n.kind - of nnkEmpty: discard # same as nil node in this representation + of nnkEmpty: discard # same as nil node in this representation of nnkNilLit: add(result, "nil") of nnkCharLit..nnkInt64Lit: add(result, $n.intVal) of nnkFloatLit..nnkFloat64Lit: add(result, $n.floatVal) @@ -20,17 +20,17 @@ proc dumpit(n: PNimrodNode): string {.compileTime.} = add(result, ", ") add(result, dumpit(n[j])) add(result, ")") - -macro dumpAST(n: stmt): stmt {.immediate.} = + +macro dumpAST(n: stmt): stmt {.immediate.} = # dump AST as a side-effect and return the inner node let n = callsite() echo dumpit(n) result = n[1] - + dumpAST: proc add(x, y: int): int = return x + y - + proc sub(x, y: int): int = return x - y |