mqualifiedmacro.nim 257 B

1234567891011
  1. template t*(x:untyped): untyped =
  2. echo "template t"
  3. import macros
  4. macro m*(name: static string, x: untyped): untyped =
  5. let newName = ident(name)
  6. result = quote do:
  7. type `newName` = object
  8. if result.kind == nnkStmtList:
  9. result = result[^1]