MCPcopy
hub / github.com/pallets/jinja / parse_expression

Method parse_expression

src/jinja2/parser.py:512–519  ·  view source on GitHub ↗

Parse an expression. Per default all expressions are parsed, if the optional `with_condexpr` parameter is set to `False` conditional expressions are not parsed.

(self, with_condexpr: bool = True)

Source from the content-addressed store, hash-verified

510 return target # type: ignore
511
512 def parse_expression(self, with_condexpr: bool = True) -> nodes.Expr:
513 """Parse an expression. Per default all expressions are parsed, if
514 the optional `with_condexpr` parameter is set to `False` conditional
515 expressions are not parsed.
516 """
517 if with_condexpr:
518 return self.parse_condexpr()
519 return self.parse_or()
520
521 def parse_condexpr(self) -> nodes.Expr:
522 lineno = self.stream.current.lineno

Callers 15

compile_expressionMethod · 0.95
parse_forMethod · 0.95
parse_withMethod · 0.95
parse_autoescapeMethod · 0.95
parse_extendsMethod · 0.95
parse_includeMethod · 0.95
parse_importMethod · 0.95
parse_fromMethod · 0.95
parse_signatureMethod · 0.95
parse_call_blockMethod · 0.95
parse_printMethod · 0.95
parseMethod · 0.95

Calls 2

parse_condexprMethod · 0.95
parse_orMethod · 0.95

Tested by 1

parseMethod · 0.64