]> Devi Nivas Git - chevron.git/commitdiff
Remove is_finished
authorDaniel Morrison <dan@morrison.ph>
Sun, 16 Nov 2014 04:04:57 +0000 (23:04 -0500)
committerDaniel Morrison <dan@morrison.ph>
Sun, 16 Nov 2014 04:04:57 +0000 (23:04 -0500)
entei.py

index 959e4e1048582b9c081971eef1bcbf4d7a1262e1..67b471f4937150d1caf0ea9ef18027fd27bc4056 100755 (executable)
--- 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