From: noah morrison Date: Sat, 15 Nov 2014 03:23:45 +0000 (-0500) Subject: Move the last literal yield up higher X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=f3de3fd858960d4674534b42bb07948188c962fe;p=chevron.git Move the last literal yield up higher Moved it above the standalone checking --- 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':