* reject to modify type checked AST * add flag to back out * Introduce legacy feature set.
12 lines
239 B
Nim
12 lines
239 B
Nim
discard """
|
|
errormsg: "typechecked nodes may not be modified"
|
|
"""
|
|
|
|
import macros
|
|
|
|
macro doSomething(arg: typed): untyped =
|
|
echo arg.treeREpr
|
|
result = arg
|
|
result[0] = newCall(bindSym"echo", newLit(1))
|
|
|
|
doSomething((echo(1); echo(2)))
|