mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 03:02:31 +00:00
19 lines
294 B
Nim
19 lines
294 B
Nim
|
|
# bug #5417
|
|
import macros
|
|
|
|
macro genBody: untyped =
|
|
let sbx = genSym(nskLabel, "test")
|
|
when true:
|
|
result = quote do:
|
|
block `sbx`:
|
|
break `sbx`
|
|
else:
|
|
template foo(s1, s2) =
|
|
block s1:
|
|
break s2
|
|
result = getAst foo(sbx, sbx)
|
|
|
|
proc test() =
|
|
genBody()
|