Warning: may cause self-inflicted loss of eyesight
import std/macros
import std/sequtils
macro If(stuff) =
stuff.expectKind(nnkCommand)
stuff[0].expectKind(nnkPar)
stuff[1].expectKind(nnkCurly)
let cond = stuff[0]
let body = newStmtList(stuff[1].children.toSeq)
quote:
if `cond`:
`body`
If (3 < 5) {
echo "This works",
If (0 == 0) {
echo "flawlessly!",
},
}
If (4 > 9) {
echo "Oh no",
echo "Anyway",
}