summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-03-29 15:28:13 +0100
committerAraq <rumpf_a@web.de>2013-03-29 15:28:13 +0100
commit905fb8578979513829b7d6d1da6722d20d306430 (patch)
treecb82aee2badab0d63e195a82f3b35fa114a553d9 /compiler
parentb21dda385c0cc82fb102ed014f6a343fbea8fd4b (diff)
downloadNim-905fb8578979513829b7d6d1da6722d20d306430.tar.gz
better treatment of var/let/const/type sections in the templating system
Diffstat (limited to 'compiler')
-rw-r--r--compiler/filter_tmpl.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/filter_tmpl.nim b/compiler/filter_tmpl.nim
index fd7ab60dc..d16639d08 100644
--- a/compiler/filter_tmpl.nim
+++ b/compiler/filter_tmpl.nim
@@ -98,7 +98,13 @@ proc parseLine(p: var TTmplParser) =
     of wElif, wOf, wElse, wExcept, wFinally: 
       LLStreamWrite(p.outp, repeatChar(p.indent - 2))
       LLStreamWrite(p.outp, substr(p.x, d))
-    else: 
+    of wLet, wVar, wConst, wType:
+      LLStreamWrite(p.outp, repeatChar(p.indent))
+      LLStreamWrite(p.outp, substr(p.x, d))
+      if not p.x.contains({':', '='}):
+        # no inline element --> treat as block:
+        inc(p.indent, 2)
+    else:
       LLStreamWrite(p.outp, repeatChar(p.indent))
       LLStreamWrite(p.outp, substr(p.x, d))
     p.state = psDirective