Skip to content

Instantly share code, notes, and snippets.

@SPY
Created June 21, 2015 19:56
Show Gist options
  • Save SPY/67ee9b7ba12edcec3212 to your computer and use it in GitHub Desktop.
Save SPY/67ee9b7ba12edcec3212 to your computer and use it in GitHub Desktop.
proc enumDef(x: NimNode): NimNode =
result = quote do:
type `x` = enum enOne, enTwo
macro one(x): stmt {. immediate .} =
echo treeRepr(x)
result = enumDef(x)
echo treeRepr(result)
one SuperEnum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment