diff options
-rwxr-xr-x | compiler/semstmts.nim | 2 | ||||
-rwxr-xr-x | tests/compile/tmacro1.nim | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 27d7d405b..53b8951e8 100755 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1081,7 +1081,7 @@ proc SemStmt(c: PContext, n: PNode): PNode = # transformed into regular try blocks: # # var f = fopen("somefile") | var f = fopen("somefile") - # finally: fcsole(f) | try: + # finally: fclose(f) | try: # ... | ... # | finally: # | fclose(f) diff --git a/tests/compile/tmacro1.nim b/tests/compile/tmacro1.nim index e96997c47..52c86e7e9 100755 --- a/tests/compile/tmacro1.nim +++ b/tests/compile/tmacro1.nim @@ -19,3 +19,12 @@ macro test*(a: stmt): stmt = test: "hi" +macro dump(n: stmt): stmt = + dump(n) + if kind(n) == nnkNone: + nil + else: + hint($kind(n)) + for i in countUp(0, len(n)-1): + nil + |