diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-05-05 07:05:50 -0700 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-05-05 07:05:50 -0700 |
commit | 906a0961e303859f23d67fa2b5e03e0913dc55c4 (patch) | |
tree | 5854f8692ea6fd1687d9eade464a998e871a409b /pystache | |
parent | 06e290786eec127290be976dcfce08081b01c08d (diff) | |
download | pystache-906a0961e303859f23d67fa2b5e03e0913dc55c4.tar.gz |
Reordered if block.
Diffstat (limited to 'pystache')
-rw-r--r-- | pystache/parser.py | 7 |
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. |