Skip to content

Instantly share code, notes, and snippets.

@dom96
Created April 3, 2018 23:24
Show Gist options
  • Save dom96/111f0da681029315b4dba481373e63da to your computer and use it in GitHub Desktop.
Save dom96/111f0da681029315b4dba481373e63da to your computer and use it in GitHub Desktop.
import macros
macro replace(node: untyped): untyped =
result = node
# StmtList
# Command
# Ident ident"echo"
# IntLit 42
result[0][1] = newStrLitNode("Hello World")
replace:
echo 42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment