Lines Matching refs:lineno
55 def fail(self, msg, lineno=None, exc=TemplateSyntaxError): argument
60 if lineno is None:
61 lineno = self.stream.current.lineno
62 raise exc(msg, lineno, self.name, self.filename)
64 def _fail_ut_eof(self, name, end_token_stack, lineno): argument
97 self.fail(" ".join(message), lineno)
99 def fail_unknown_tag(self, name, lineno=None): argument
104 return self._fail_ut_eof(name, self._end_token_stack, lineno)
106 def fail_eof(self, end_tokens=None, lineno=None): argument
111 return self._fail_ut_eof(None, stack, lineno)
121 def free_identifier(self, lineno=None): argument
125 nodes.Node.__init__(rv, f"fi{self._last_identifier}", lineno=lineno)
132 self.fail("tag name expected", token.lineno)
151 self.fail_unknown_tag(token.value, token.lineno)
185 lineno = next(self.stream).lineno
189 return nodes.Assign(target, expr, lineno=lineno)
192 return nodes.AssignBlock(target, filter_node, body, lineno=lineno)
196 lineno = self.stream.expect("name:for").lineno
211 return nodes.For(target, iter, body, else_, test, recursive, lineno=lineno)
215 node = result = nodes.If(lineno=self.stream.expect("name:if").lineno)
223 node = nodes.If(lineno=self.stream.current.lineno)
232 node = nodes.With(lineno=next(self.stream).lineno)
249 node = nodes.ScopedEvalContextModifier(lineno=next(self.stream).lineno)
255 node = nodes.Block(lineno=next(self.stream).lineno)
273 node = nodes.Extends(lineno=next(self.stream).lineno)
288 node = nodes.Include(lineno=next(self.stream).lineno)
300 node = nodes.Import(lineno=next(self.stream).lineno)
307 node = nodes.FromImport(lineno=next(self.stream).lineno)
332 target.lineno,
365 node = nodes.CallBlock(lineno=next(self.stream).lineno)
374 self.fail("expected call", node.lineno)
379 node = nodes.FilterBlock(lineno=next(self.stream).lineno)
385 node = nodes.Macro(lineno=next(self.stream).lineno)
392 node = nodes.Output(lineno=next(self.stream).lineno)
419 target = nodes.NSRef(token.value, attr.value, lineno=token.lineno)
422 target = nodes.Name(token.value, "store", lineno=token.lineno)
433 f"can't assign to {target.__class__.__name__.lower()!r}", target.lineno
447 lineno = self.stream.current.lineno
455 expr1 = nodes.CondExpr(expr2, expr1, expr3, lineno=lineno)
456 lineno = self.stream.current.lineno
460 lineno = self.stream.current.lineno
464 left = nodes.Or(left, right, lineno=lineno)
465 lineno = self.stream.current.lineno
469 lineno = self.stream.current.lineno
473 left = nodes.And(left, right, lineno=lineno)
474 lineno = self.stream.current.lineno
479 lineno = next(self.stream).lineno
480 return nodes.Not(self.parse_not(), lineno=lineno)
484 lineno = self.stream.current.lineno
501 lineno = self.stream.current.lineno
504 return nodes.Compare(expr, ops, lineno=lineno)
507 lineno = self.stream.current.lineno
513 left = cls(left, right, lineno=lineno)
514 lineno = self.stream.current.lineno
518 lineno = self.stream.current.lineno
525 return nodes.Concat(args, lineno=lineno)
528 lineno = self.stream.current.lineno
534 left = cls(left, right, lineno=lineno)
535 lineno = self.stream.current.lineno
539 lineno = self.stream.current.lineno
544 left = nodes.Pow(left, right, lineno=lineno)
545 lineno = self.stream.current.lineno
550 lineno = self.stream.current.lineno
553 node = nodes.Neg(self.parse_unary(False), lineno=lineno)
556 node = nodes.Pos(self.parse_unary(False), lineno=lineno)
568 node = nodes.Const(token.value in ("true", "True"), lineno=token.lineno)
570 node = nodes.Const(None, lineno=token.lineno)
572 node = nodes.Name(token.value, "load", lineno=token.lineno)
577 lineno = token.lineno
581 node = nodes.Const("".join(buf), lineno=lineno)
584 node = nodes.Const(token.value, lineno=token.lineno)
594 self.fail(f"unexpected {describe_token(token)!r}", token.lineno)
622 lineno = self.stream.current.lineno
644 lineno = self.stream.current.lineno
660 return nodes.Tuple(args, "load", lineno=lineno)
672 return nodes.List(items, lineno=token.lineno)
685 items.append(nodes.Pair(key, value, lineno=key.lineno))
687 return nodes.Dict(items, lineno=token.lineno)
724 node, attr_token.value, "load", lineno=token.lineno
727 self.fail("expected name or number", attr_token.lineno)
728 arg = nodes.Const(attr_token.value, lineno=attr_token.lineno)
729 return nodes.Getitem(node, arg, "load", lineno=token.lineno)
740 arg = nodes.Tuple(args, "load", lineno=token.lineno)
741 return nodes.Getitem(node, arg, "load", lineno=token.lineno)
742 self.fail("expected subscript expression", token.lineno)
745 lineno = self.stream.current.lineno
773 return nodes.Slice(lineno=lineno, *args)
784 self.fail("invalid syntax for function call expression", token.lineno)
810 kwargs.append(nodes.Keyword(key, value, lineno=value.lineno))
821 return nodes.Call(node, args, kwargs, dyn_args, dyn_kwargs, lineno=token.lineno)
839 node, name, args, kwargs, dyn_args, dyn_kwargs, lineno=token.lineno
876 node, name, args, kwargs, dyn_args, dyn_kwargs, lineno=token.lineno
879 node = nodes.Not(node, lineno=token.lineno)
892 lineno = data_buffer[0].lineno
893 body.append(nodes.Output(data_buffer[:], lineno=lineno))
901 add_data(nodes.TemplateData(token.value, lineno=token.lineno))
932 result = nodes.Template(self.subparse(), lineno=1)