better treatment of var/let/const/type sections in the templating system

This commit is contained in:
Araq 2013-03-29 15:28:13 +01:00
commit 905fb85789

View file

@ -98,6 +98,12 @@ proc parseLine(p: var TTmplParser) =
of wElif, wOf, wElse, wExcept, wFinally: of wElif, wOf, wElse, wExcept, wFinally:
LLStreamWrite(p.outp, repeatChar(p.indent - 2)) LLStreamWrite(p.outp, repeatChar(p.indent - 2))
LLStreamWrite(p.outp, substr(p.x, d)) LLStreamWrite(p.outp, substr(p.x, d))
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: else:
LLStreamWrite(p.outp, repeatChar(p.indent)) LLStreamWrite(p.outp, repeatChar(p.indent))
LLStreamWrite(p.outp, substr(p.x, d)) LLStreamWrite(p.outp, substr(p.x, d))