diff options
author | Cody Taylor <codemister99@yahoo.com> | 2015-03-24 20:57:02 -0400 |
---|---|---|
committer | Cody Taylor <codemister99@yahoo.com> | 2015-03-24 20:57:47 -0400 |
commit | 52e8c0a3deaae9017c76a17196aeac8b027b933e (patch) | |
tree | 77179e4d936cd6e6de938ef98bc1e8fc5f88c0a1 /mako/codegen.py | |
parent | b6d0479034e4f379576caa6eb9ef3e32369c333f (diff) | |
download | external_python_mako-52e8c0a3deaae9017c76a17196aeac8b027b933e.tar.gz external_python_mako-52e8c0a3deaae9017c76a17196aeac8b027b933e.tar.bz2 external_python_mako-52e8c0a3deaae9017c76a17196aeac8b027b933e.zip |
Add STOP_RENDERING keyword; exiting of a template.
Signed-off-by: Cody Taylor <codemister99@yahoo.com>
Diffstat (limited to 'mako/codegen.py')
-rw-r--r-- | mako/codegen.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mako/codegen.py b/mako/codegen.py index 4b0bda8..0226415 100644 --- a/mako/codegen.py +++ b/mako/codegen.py @@ -19,7 +19,7 @@ MAGIC_NUMBER = 10 # names which are hardwired into the # template and are not accessed via the # context itself -RESERVED_NAMES = set(['context', 'loop', 'UNDEFINED']) +RESERVED_NAMES = set(['context', 'loop', 'UNDEFINED', 'STOP_RENDERING']) def compile(node, uri, @@ -215,6 +215,7 @@ class _GenerateRenderMethod(object): (", ".join(self.compiler.future_imports),)) self.printer.writeline("from mako import runtime, filters, cache") self.printer.writeline("UNDEFINED = runtime.UNDEFINED") + self.printer.writeline("STOP_RENDERING = runtime.STOP_RENDERING") self.printer.writeline("__M_dict_builtin = dict") self.printer.writeline("__M_locals_builtin = locals") self.printer.writeline("_magic_number = %r" % MAGIC_NUMBER) |