From f3de3fd858960d4674534b42bb07948188c962fe Mon Sep 17 00:00:00 2001 From: noah morrison Date: Fri, 14 Nov 2014 22:23:45 -0500 Subject: [PATCH] Move the last literal yield up higher Moved it above the standalone checking --- entei.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entei.py b/entei.py index c1e218d..e68ae40 100755 --- a/entei.py +++ b/entei.py @@ -76,6 +76,10 @@ def tokenize(template): while not template.is_finished: literal = grab_literal() + if template.is_finished: + yield ('literal', literal) + break + if literal.find('\n') != -1 or is_standalone: padding = literal.split('\n')[-1] if padding.isspace() or padding == '': @@ -83,10 +87,6 @@ def tokenize(template): else: is_standalone = False - if template.is_finished: - yield ('literal', literal) - break - tag_key = get(1) tag_type = tag_types.get(tag_key, 'variable') if tag_type != 'variable': -- 2.47.3