summaryrefslogtreecommitdiff
path: root/jinja2/parser.py
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2008-05-28 11:26:59 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2008-05-28 11:26:59 +0200
commit9bb7e4779182490abc6e1784b0ee63d22b91b11e (patch)
treec3d0fc34b160a00e1f738118c9cf0b5e34e25822 /jinja2/parser.py
parentd71fff001dcf0d2a689c7db6003fc0e1cc0846c6 (diff)
downloadjinja2-9bb7e4779182490abc6e1784b0ee63d22b91b11e.tar.gz
some more documentation updates and minor code cleanups. Additionally True and true in the template are the same now, same for false/False and none/None.
--HG-- branch : trunk
Diffstat (limited to 'jinja2/parser.py')
-rw-r--r--jinja2/parser.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/jinja2/parser.py b/jinja2/parser.py
index 0ce4a29..7efe79c 100644
--- a/jinja2/parser.py
+++ b/jinja2/parser.py
@@ -454,9 +454,10 @@ class Parser(object):
def parse_primary(self, with_postfix=True):
token = self.stream.current
if token.type is 'name':
- if token.value in ('true', 'false'):
- node = nodes.Const(token.value == 'true', lineno=token.lineno)
- elif token.value == 'none':
+ if token.value in ('true', 'false', 'True', 'False'):
+ node = nodes.Const(token.value in ('true', 'True'),
+ lineno=token.lineno)
+ elif token.value in ('none', 'None'):
node = nodes.Const(None, lineno=token.lineno)
else:
node = nodes.Name(token.value, 'load', lineno=token.lineno)