I'm dabbling with Nimrod macros, but get this error: Error: invalid control flow: break.
Here's my code:
macro forever (n: stmt): stmt =
result = newNimNode (nnkWhileStmt)
result.add (parseExpr ("true"))
result.add (n)
#result.treeRepr.echo
var i = 0
forever:
if i > 10:
break
echo (i)
inc i
How do you handle flow control when you have break or continue statement in a macro? Is it possible and how, or is it a restriction of the macro system. Thanks!