summaryrefslogtreecommitdiff
path: root/bottle.py
diff options
context:
space:
mode:
Diffstat (limited to 'bottle.py')
-rwxr-xr-xbottle.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/bottle.py b/bottle.py
index 8e446a8..0f79a71 100755
--- a/bottle.py
+++ b/bottle.py
@@ -4010,7 +4010,6 @@ class SimpleTemplate(BaseTemplate):
class StplSyntaxError(TemplateError):
-
pass
@@ -4152,15 +4151,18 @@ class StplParser(object):
self.paren_depth -= 1
code_line += _pc
elif _blk1: # Start-block keyword (if/for/while/def/try/...)
- code_line, self.indent_mod = _blk1, -1
+ code_line = _blk1
self.indent += 1
+ self.indent_mod -= 1
elif _blk2: # Continue-block keyword (else/elif/except/...)
- code_line, self.indent_mod = _blk2, -1
- elif _end: # The non-standard 'end'-keyword (ends a block)
- self.indent -= 1
+ code_line = _blk2
+ self.indent_mod -= 1
elif _cend: # The end-code-block template token (usually '%>')
if multiline: multiline = False
else: code_line += _cend
+ elif _end:
+ self.indent -= 1
+ self.indent_mod += 1
else: # \n
self.write_code(code_line.strip(), comment)
self.lineno += 1