Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Aug 2, 2021
1 parent 757402e commit adfd352
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions compiler/semtempl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,17 @@ proc addLocalDecl(c: var TemplCtx, n: var PNode, k: TSymKind) =
if (n.kind == nkPragmaExpr and n.len >= 2 and n[1].kind == nkPragma):
let pragmaNode = n[1]
for i in 0..<pragmaNode.len:
openScope(c)
pragmaNode[i] = semTemplBody(c, pragmaNode[i])
closeScope(c)
let ni = pragmaNode[i]
# see D20210801T100514
var found = false
for a in templatePragmas:
if ni.ident == getIdent(c.c.cache, $a):
found = true
break
if not found:
openScope(c)
pragmaNode[i] = semTemplBody(c, pragmaNode[i])
closeScope(c)
let ident = getIdentNode(c, n)
if not isTemplParam(c, ident):
if n.kind != nkSym:
Expand Down Expand Up @@ -337,10 +345,6 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode =
semIdeForTemplateOrGenericCheck(c.c.config, n, c.cursorInBody)
case n.kind
of nkIdent:
# see D20210801T100514
for a in templatePragmas:
if n.ident == getIdent(c.c.cache, $a):
return n
if n.ident.id in c.toInject: return n
let s = qualifiedLookUp(c.c, n, {})
if s != nil:
Expand Down

0 comments on commit adfd352

Please sign in to comment.