From 906a0961e303859f23d67fa2b5e03e0913dc55c4 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Sat, 5 May 2012 07:05:50 -0700 Subject: Reordered if block. --- pystache/parser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pystache') 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. -- cgit v1.2.1