From: Daniel Morrison Date: Sun, 16 Nov 2014 04:04:57 +0000 (-0500) Subject: Remove is_finished X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=549294852929feb85dbff49d71701b245365451a;p=chevron.git Remove is_finished --- diff --git a/entei.py b/entei.py index 959e4e1..67b471f 100755 --- a/entei.py +++ b/entei.py @@ -51,16 +51,15 @@ def tokenize(template): except AttributeError: pass - template.is_finished = False is_standalone = True open_sections = [] l_del = '{{' r_del = '}}' - while not template.is_finished: + while template: literal, template = template.split(l_del, 1) # If the template is completed - if template.is_finished: + if not template: # Then yield the literal and leave yield ('literal', literal) break @@ -144,13 +143,6 @@ def tokenize(template): # Otherwise we aren't a standalone is_standalone = False - # Now we need to backtrack - - # If the template is finished - if template.is_finished: - # Tell it that it has more work - template.is_finished = False - # If we're a set delimiter tag if tag_type == 'set delimiter?': # Then step back the length of the stuff we grabbed