diff options
author | Aditya Siram <aditya@simspace.com> | 2019-05-13 18:34:32 -0500 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-05-14 01:34:32 +0200 |
commit | a6d44212415ba06ec4dff225246110d735e8ac43 (patch) | |
tree | 60577a5cd084060c1efe7ae25a9a24850e22649e /compiler/semtempl.nim | |
parent | 55cf971adfe25614da79e0e2196ea316dd1558c4 (diff) | |
download | Nim-a6d44212415ba06ec4dff225246110d735e8ac43.tar.gz |
Fixes #9365 : let with exportC pragma in template. (#11235)
* Fixes #9365 : let with exportC pragma in template. * Fix according to comments.
Diffstat (limited to 'compiler/semtempl.nim')
-rw-r--r-- | compiler/semtempl.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 01a0a41bb..2cbbd7b54 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -197,6 +197,12 @@ proc addLocalDecl(c: var TemplCtx, n: var PNode, k: TSymKind) = else: replaceIdentBySym(c.c, n, ident) else: + if (n.kind == nkPragmaExpr and sonsLen(n) >= 2 and n.sons[1].kind == nkPragma): + let pragmaNode = n.sons[1] + for i in 0..<pragmaNode.sons.len: + openScope(c) + pragmaNode.sons[i] = semTemplBody(c,pragmaNode.sons[i]) + closeScope(c) let ident = getIdentNode(c, n) if not isTemplParam(c, ident): # fix #2670, consider: |