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

Method parse_include

src/jinja2/parser.py:345–355  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

343 return node
344
345 def parse_include(self) -> nodes.Include:
346 node = nodes.Include(lineno=next(self.stream).lineno)
347 node.template = self.parse_expression()
348 if self.stream.current.test("name:ignore") and self.stream.look().test(
349 "name:missing"
350 ):
351 node.ignore_missing = True
352 self.stream.skip(2)
353 else:
354 node.ignore_missing = False
355 return self.parse_import_context(node, True)
356
357 def parse_import(self) -> nodes.Import:
358 node = nodes.Import(lineno=next(self.stream).lineno)

Callers

nothing calls this directly

Calls 5

parse_expressionMethod · 0.95
parse_import_contextMethod · 0.95
lookMethod · 0.80
skipMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected