From 549294852929feb85dbff49d71701b245365451a Mon Sep 17 00:00:00 2001 From: Daniel Morrison Date: Sat, 15 Nov 2014 23:04:57 -0500 Subject: [PATCH] Remove is_finished --- entei.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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 -- 2.47.3