MCPcopy Create free account
hub / github.com/nodejs/node / parse

Method parse

deps/v8/third_party/jinja2/environment.py:594–611  ·  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: str,
        name: t.Optional[str] = None,
        filename: t.Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

592
593 @internalcode
594 def parse(
595 self,
596 source: str,
597 name: t.Optional[str] = None,
598 filename: t.Optional[str] = None,
599 ) -> nodes.Template:
600 """Parse the sourcecode and return the abstract syntax tree. This
601 tree of nodes is used by the compiler to convert the template into
602 executable source- or bytecode. This is useful for debugging or to
603 extract information from templates.
604
605 If you are :ref:`developing Jinja extensions <writing-extensions>`
606 this gives you a good overview of the node tree generated.
607 """
608 try:
609 return self._parse(source, name, filename)
610 except TemplateSyntaxError:
611 self.handle_exception(source=source)
612
613 def _parse(
614 self, source: str, name: t.Optional[str], filename: t.Optional[str]

Callers 1

babel_extractFunction · 0.95

Calls 2

_parseMethod · 0.95
handle_exceptionMethod · 0.95

Tested by

no test coverage detected