summary refs log tree commit diff stats
path: root/tests/run/tmacros1.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/tmacros1.nim')
-rwxr-xr-xtests/run/tmacros1.nim32
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/run/tmacros1.nim b/tests/run/tmacros1.nim
deleted file mode 100755
index 8cf2a5aa7..000000000
--- a/tests/run/tmacros1.nim
+++ /dev/null
@@ -1,32 +0,0 @@
-discard """
-  output: "Got: 'nnkIntLit' hi"
-"""
-
-import
-  macros, strutils
-
-macro outterMacro*(n: stmt): stmt =
-  var j : string = "hi"
-  proc innerProc(i: int): string =
-    echo "Using arg ! " & n.repr
-    result = "Got: '" & $n.kind & "' " & $j
-  if n.kind != TNimrodNodeKind.nnkMacroStmt:
-    error("Macro " & n[0].repr & " requires a block.")
-  var callNode = n[0]
-  expectKind(callNode, TNimrodNodeKind.nnkCall)
-  if callNode.len != 2 or callNode[1].kind != TNimrodNodeKind.nnkIdent:
-    error("Macro " & callNode.repr &
-      " requires the ident passed as parameter (eg: " & callNode.repr & 
-      "(the_name_you_want)): statements.")
-  result = newNimNode(TNimrodNodeKind.nnkStmtList)
-  var ass : PNimrodNode = newNimNode(TNimrodNodeKind.nnkAsgn)
-  ass.add(newIdentNode(callNode[1].ident))
-  ass.add(newStrLitNode(innerProc(4)))
-  result.add(ass)
-
-var str: string
-outterMacro(str):
-  "hellow"
-echo str
-
-