summaryrefslogtreecommitdiff
path: root/pystache
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-05-05 08:58:37 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-05-05 08:58:37 -0700
commitd7fac0b90fcbd46ea819071ebf26d6b0a7fd4786 (patch)
treea6fcf91fe5570ab63782c675fdeb423dad646bca /pystache
parent8b2c78422a26f40f47ac2f2ccfe57d30991ae9d3 (diff)
downloadpystache-d7fac0b90fcbd46ea819071ebf26d6b0a7fd4786.tar.gz
Removed now unnecessary parse() arguments.
Diffstat (limited to 'pystache')
-rw-r--r--pystache/parser.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pystache/parser.py b/pystache/parser.py
index 3230058..eb2f556 100644
--- a/pystache/parser.py
+++ b/pystache/parser.py
@@ -79,7 +79,7 @@ class Parser(object):
self._delimiters = delimiters
self.compile_template_re()
- def parse(self, template, start_index=0, section_key=None):
+ def parse(self, template):
"""
Parse a template string starting at some index.
@@ -96,8 +96,9 @@ class Parser(object):
a ParsedTemplate instance.
"""
+ start_index = 0
+ content_end_index, parsed_section, section_key = None, None, None
parsed_template = ParsedTemplate()
- content_end_index, parsed_section = None, None
states = []
@@ -110,9 +111,8 @@ class Parser(object):
match_index = match.start()
end_index = match.end()
- before_tag = template[start_index : match_index]
-
- parsed_template.add(before_tag)
+ # Add string contents before the tag.
+ parsed_template.add(template[start_index:match_index])
matches = match.groupdict()
@@ -169,7 +169,7 @@ class Parser(object):
parsed_template.add(node)
- # Save the rest of the template.
+ # Add the remainder of the template.
parsed_template.add(template[start_index:])
return parsed_template