Skip to content

Commit

Permalink
spec: avoid double stmtlist wrapping
Browse files Browse the repository at this point in the history
nimskull is helpful enough to keep stuff wrapped for us, so make sure
we don't double wrap it.
  • Loading branch information
alaviss committed Jan 19, 2024
1 parent 2b43e02 commit cb69c7e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cps/spec.nim
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ proc isScopeExit*(n: NormNode): bool =

template rewriteIt*(n: typed; body: untyped): NormNode =
var it {.inject.} = normalizingRewrites:
macros.newStmtList n
if n.kind notin {nnkStmtList, nnkStmtListExpr}:
macros.newStmtList n
else:
n
body
workaroundRewrites it

Expand Down

0 comments on commit cb69c7e

Please sign in to comment.