summary refs log tree commit diff stats
path: root/compiler/semtempl.nim
diff options
context:
space:
mode:
authorAditya Siram <aditya@simspace.com>2019-05-13 18:34:32 -0500
committerAndreas Rumpf <rumpf_a@web.de>2019-05-14 01:34:32 +0200
commita6d44212415ba06ec4dff225246110d735e8ac43 (patch)
tree60577a5cd084060c1efe7ae25a9a24850e22649e /compiler/semtempl.nim
parent55cf971adfe25614da79e0e2196ea316dd1558c4 (diff)
downloadNim-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.nim6
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: