# Path: jinja2/nodes.py
# class Impossible(Exception):
# class NodeType(type):
# class Node(object):
# class Stmt(Node):
# class Helper(Node):
# class Template(Node):
# class Output(Stmt):
# class Extends(Stmt):
# class For(Stmt):
# class If(Stmt):
# class Macro(Stmt):
# class CallBlock(Stmt):
# class FilterBlock(Stmt):
# class Block(Stmt):
# class Include(Stmt):
# class Import(Stmt):
# class FromImport(Stmt):
# class ExprStmt(Stmt):
# class Assign(Stmt):
# class Expr(Node):
# class BinExpr(Expr):
# class UnaryExpr(Expr):
# class Name(Expr):
# class Literal(Expr):
# class Const(Literal):
# class TemplateData(Literal):
# class Tuple(Literal):
# class List(Literal):
# class Dict(Literal):
# class Pair(Helper):
# class Keyword(Helper):
# class CondExpr(Expr):
# class Filter(Expr):
# class Test(Expr):
# class Call(Expr):
# class Getitem(Expr):
# class Getattr(Expr):
# class Slice(Expr):
# class Concat(Expr):
# class Compare(Expr):
# class Operand(Helper):
# class Mul(BinExpr):
# class Div(BinExpr):
# class FloorDiv(BinExpr):
# class Add(BinExpr):
# class Sub(BinExpr):
# class Mod(BinExpr):
# class Pow(BinExpr):
# class And(BinExpr):
# class Or(BinExpr):
# class Not(UnaryExpr):
# class Neg(UnaryExpr):
# class Pos(UnaryExpr):
# class EnvironmentAttribute(Expr):
# class ExtensionAttribute(Expr):
# class ImportedName(Expr):
# class InternalName(Expr):
# class MarkSafe(Expr):
# class ContextReference(Expr):
# class Continue(Stmt):
# class Break(Stmt):
#     def __new__(cls, name, bases, d):
#     def __init__(self, *fields, **attributes):
#     def iter_fields(self, exclude=None, only=None):
#     def iter_child_nodes(self, exclude=None, only=None):
#     def find(self, node_type):
#     def find_all(self, node_type):
#     def set_ctx(self, ctx):
#     def set_lineno(self, lineno, override=False):
#     def set_environment(self, environment):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __repr__(self):
#     def as_const(self):
#     def can_assign(self):
#     def as_const(self):
#     def as_const(self):
#     def can_assign(self):
#     def as_const(self):
#     def from_untrusted(cls, value, lineno=None, environment=None):
#     def as_const(self):
#     def as_const(self):
#     def can_assign(self):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self, obj=None):
#     def as_const(self):
#     def as_const(self):
#     def can_assign(self):
#     def as_const(self):
#     def can_assign(self):
#     def as_const(self):
#         def const(obj):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self):
#     def __init__(self):
#     def as_const(self):
# def _failing_new(*args, **kwargs):
# 
# Path: jinja2/exceptions.py
# class TemplateSyntaxError(TemplateError):
#     """Raised to tell the user that there is a problem with the template."""
# 
#     def __init__(self, message, lineno, name=None, filename=None):
#         if not isinstance(message, unicode):
#             message = message.decode('utf-8', 'replace')
#         TemplateError.__init__(self, message.encode('utf-8'))
#         self.lineno = lineno
#         self.name = name
#         self.filename = filename
#         self.source = None
#         self.message = message
# 
#     def __unicode__(self):
#         location = 'line %d' % self.lineno
#         name = self.filename or self.name
#         if name:
#             location = 'File "%s", %s' % (name, location)
#         lines = [self.message, '  ' + location]
# 
#         # if the source is set, add the line to the output
#         if self.source is not None:
#             try:
#                 line = self.source.splitlines()[self.lineno - 1]
#             except IndexError:
#                 line = None
#             if line:
#                 lines.append('    ' + line.strip())
# 
#         return u'\n'.join(lines)
# 
#     def __str__(self):
#         return unicode(self).encode('utf-8')
# 
# class TemplateAssertionError(TemplateSyntaxError):
#     """Like a template syntax error, but covers cases where something in the
#     template caused an error at compile time that wasn't necessarily caused
#     by a syntax error.  However it's a direct subclass of
#     :exc:`TemplateSyntaxError` and has the same attributes.
#     """


from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
            value = self.parse_expression()
            items.append(nodes.Pair(key, value, lineno=key.lineno))
        self.stream.expect('rbrace')
        return nodes.Dict(items, lineno=token.lineno)

    def parse_postfix(self, node):
        while 1:
            token_type = self.stream.current.type
            if token_type is 'dot' or token_type is 'lbracket':
                node = self.parse_subscript(node)
            elif token_type is 'lparen':
                node = self.parse_call(node)
            elif token_type is 'pipe':
                node = self.parse_filter(node)
            elif token_type is 'name' and self.stream.current.value == 'is':
                node = self.parse_test(node)
            else:
                break
        return node

    def parse_subscript(self, node):
        token = self.stream.next()
        if token.type is 'dot':
            attr_token = self.stream.current
            self.stream.next()
            if attr_token.type is 'name':
                return nodes.Getattr(node, attr_token.value, 'load',
                                     lineno=token.lineno)
            elif attr_token.type is not 'integer':
                self.fail('expected name or number', attr_token.lineno)

# Path: jinja2/nodes.py
# class Impossible(Exception):
# class NodeType(type):
# class Node(object):
# class Stmt(Node):
# class Helper(Node):
# class Template(Node):
# class Output(Stmt):
# class Extends(Stmt):
# class For(Stmt):
# class If(Stmt):
# class Macro(Stmt):
# class CallBlock(Stmt):
# class FilterBlock(Stmt):
# class Block(Stmt):
# class Include(Stmt):
# class Import(Stmt):
# class FromImport(Stmt):
# class ExprStmt(Stmt):
# class Assign(Stmt):
# class Expr(Node):
# class BinExpr(Expr):
# class UnaryExpr(Expr):
# class Name(Expr):
# class Literal(Expr):
# class Const(Literal):
# class TemplateData(Literal):
# class Tuple(Literal):
# class List(Literal):
# class Dict(Literal):
# class Pair(Helper):
# class Keyword(Helper):
# class CondExpr(Expr):
# class Filter(Expr):
# class Test(Expr):
# class Call(Expr):
# class Getitem(Expr):
# class Getattr(Expr):
# class Slice(Expr):
# class Concat(Expr):
# class Compare(Expr):
# class Operand(Helper):
# class Mul(BinExpr):
# class Div(BinExpr):
# class FloorDiv(BinExpr):
# class Add(BinExpr):
# class Sub(BinExpr):
# class Mod(BinExpr):
# class Pow(BinExpr):
# class And(BinExpr):
# class Or(BinExpr):
# class Not(UnaryExpr):
# class Neg(UnaryExpr):
# class Pos(UnaryExpr):
# class EnvironmentAttribute(Expr):
# class ExtensionAttribute(Expr):
# class ImportedName(Expr):
# class InternalName(Expr):
# class MarkSafe(Expr):
# class ContextReference(Expr):
# class Continue(Stmt):
# class Break(Stmt):
#     def __new__(cls, name, bases, d):
#     def __init__(self, *fields, **attributes):
#     def iter_fields(self, exclude=None, only=None):
#     def iter_child_nodes(self, exclude=None, only=None):
#     def find(self, node_type):
#     def find_all(self, node_type):
#     def set_ctx(self, ctx):
#     def set_lineno(self, lineno, override=False):
#     def set_environment(self, environment):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __repr__(self):
#     def as_const(self):
#     def can_assign(self):
#     def as_const(self):
#     def as_const(self):
#     def can_assign(self):
#     def as_const(self):
#     def from_untrusted(cls, value, lineno=None, environment=None):
#     def as_const(self):
#     def as_const(self):
#     def can_assign(self):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self, obj=None):
#     def as_const(self):
#     def as_const(self):
#     def can_assign(self):
#     def as_const(self):
#     def can_assign(self):
#     def as_const(self):
#         def const(obj):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self):
#     def as_const(self):
#     def __init__(self):
#     def as_const(self):
# def _failing_new(*args, **kwargs):
# 
# Path: jinja2/exceptions.py
# class TemplateSyntaxError(TemplateError):
#     """Raised to tell the user that there is a problem with the template."""
# 
#     def __init__(self, message, lineno, name=None, filename=None):
#         if not isinstance(message, unicode):
#             message = message.decode('utf-8', 'replace')
#         TemplateError.__init__(self, message.encode('utf-8'))
#         self.lineno = lineno
#         self.name = name
#         self.filename = filename
#         self.source = None
#         self.message = message
# 
#     def __unicode__(self):
#         location = 'line %d' % self.lineno
#         name = self.filename or self.name
#         if name:
#             location = 'File "%s", %s' % (name, location)
#         lines = [self.message, '  ' + location]
# 
#         # if the source is set, add the line to the output
#         if self.source is not None:
#             try:
#                 line = self.source.splitlines()[self.lineno - 1]
#             except IndexError:
#                 line = None
#             if line:
#                 lines.append('    ' + line.strip())
# 
#         return u'\n'.join(lines)
# 
#     def __str__(self):
#         return unicode(self).encode('utf-8')
# 
# class TemplateAssertionError(TemplateSyntaxError):
#     """Like a template syntax error, but covers cases where something in the
#     template caused an error at compile time that wasn't necessarily caused
#     by a syntax error.  However it's a direct subclass of
#     :exc:`TemplateSyntaxError` and has the same attributes.
#     """


# Path: jinja2/parser.py
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError

            value = self.parse_expression()
            items.append(nodes.Pair(key, value, lineno=key.lineno))
        self.stream.expect('rbrace')
        return nodes.Dict(items, lineno=token.lineno)

    def parse_postfix(self, node):
        while 1:
            token_type = self.stream.current.type
            if token_type is 'dot' or token_type is 'lbracket':
                node = self.parse_subscript(node)
            elif token_type is 'lparen':
                node = self.parse_call(node)
            elif token_type is 'pipe':
                node = self.parse_filter(node)
            elif token_type is 'name' and self.stream.current.value == 'is':
                node = self.parse_test(node)
            else:
                break
        return node

    def parse_subscript(self, node):
        token = self.stream.next()
        if token.type is 'dot':
            attr_token = self.stream.current
            self.stream.next()
            if attr_token.type is 'name':
                return nodes.Getattr(node, attr_token.value, 'load',
                                     lineno=token.lineno)
            elif attr_token.type is not 'integer':
                self.fail('expected name or number', attr_token.lineno)

            arg = nodes.Const(attr_token.value, lineno=attr_token.lineno)