From 905fb8578979513829b7d6d1da6722d20d306430 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 29 Mar 2013 15:28:13 +0100 Subject: better treatment of var/let/const/type sections in the templating system --- compiler/filter_tmpl.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'compiler') 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 -- cgit 1.4.1-2-gfad0