MCPcopy Index your code
hub / github.com/nodejs/node / parse

Method parse

tools/inspector_protocol/jinja2/environment.py:480–493  ·  view source on GitHub ↗

Parse the sourcecode and return the abstract syntax tree. This tree of nodes is used by the compiler to convert the template into executable source- or bytecode. This is useful for debugging or to extract information from templates. If you are :ref:`developing Jinj

(self, source, name=None, filename=None)

Source from the content-addressed store, hash-verified

478
479 @internalcode
480 def parse(self, source, name=None, filename=None):
481 """Parse the sourcecode and return the abstract syntax tree. This
482 tree of nodes is used by the compiler to convert the template into
483 executable source- or bytecode. This is useful for debugging or to
484 extract information from templates.
485
486 If you are :ref:`developing Jinja2 extensions <writing-extensions>`
487 this gives you a good overview of the node tree generated.
488 """
489 try:
490 return self._parse(source, name, filename)
491 except TemplateSyntaxError:
492 exc_info = sys.exc_info()
493 self.handle_exception(exc_info, source_hint=source)
494
495 def _parse(self, source, name, filename):
496 """Internal parsing function used by `parse` and `compile`."""

Callers 1

babel_extractFunction · 0.95

Calls 3

_parseMethod · 0.95
handle_exceptionMethod · 0.95
exc_infoMethod · 0.80

Tested by

no test coverage detected