summaryrefslogtreecommitdiff
path: root/pystache
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-05-05 07:05:50 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-05-05 07:05:50 -0700
commit906a0961e303859f23d67fa2b5e03e0913dc55c4 (patch)
tree5854f8692ea6fd1687d9eade464a998e871a409b /pystache
parent06e290786eec127290be976dcfce08081b01c08d (diff)
downloadpystache-906a0961e303859f23d67fa2b5e03e0913dc55c4.tar.gz
Reordered if block.
Diffstat (limited to 'pystache')
-rw-r--r--pystache/parser.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pystache/parser.py b/pystache/parser.py
index 1202c66..806dac9 100644
--- a/pystache/parser.py
+++ b/pystache/parser.py
@@ -141,14 +141,15 @@ class Parser(object):
match_index += len(leading_whitespace)
leading_whitespace = ''
- if tag_type == '/':
+ if tag_type in ('#', '^'):
+ start_index, content_end_index, parsed_section = self.parse(template, end_index, tag_key)
+
+ elif tag_type == '/':
if tag_key != section_key:
raise ParsingError("Section end tag mismatch: %s != %s" % (tag_key, section_key))
return end_index, match_index, parsed_template
- if tag_type in ('#', '^'):
- start_index, content_end_index, parsed_section = self.parse(template, end_index, tag_key)
else:
start_index = end_index
# Variable index is now the next character to process.