Skip to content

Commit

Permalink
keep logic only for colon exprs
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Sep 26, 2024
1 parent 40e1fd3 commit 3dd4e95
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/semtempl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,12 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode =
of nkPostfix:
result[1] = semTemplBody(c, n[1])
of nkPragma:
result = semTemplBodySons(c, n)
for i in 0 ..< n.len:
let x = n[i]
if x.kind == nkExprColonExpr:
x[1] = semTemplBody(c, x[1])
else:
result[i] = semTemplBody(c, x)
of nkBracketExpr:
if n.typ == nil:
# if a[b] is nested inside a typed expression, don't convert it
Expand Down

0 comments on commit 3dd4e95

Please sign in to comment.