diff options
author | Araq <rumpf_a@web.de> | 2013-03-29 15:28:13 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-03-29 15:28:13 +0100 |
commit | 905fb8578979513829b7d6d1da6722d20d306430 (patch) | |
tree | cb82aee2badab0d63e195a82f3b35fa114a553d9 /compiler | |
parent | b21dda385c0cc82fb102ed014f6a343fbea8fd4b (diff) | |
download | Nim-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.nim | 8 |
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 |