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

Method preprocess

deps/v8/third_party/jinja2/environment.py:640–654  ·  view source on GitHub ↗

Preprocesses the source with all extensions. This is automatically called for all parsing and compiling methods but *not* for :meth:`lex` because there you usually only want the actual source tokenized.

(
        self,
        source: str,
        name: t.Optional[str] = None,
        filename: t.Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

638 self.handle_exception(source=source)
639
640 def preprocess(
641 self,
642 source: str,
643 name: t.Optional[str] = None,
644 filename: t.Optional[str] = None,
645 ) -> str:
646 """Preprocesses the source with all extensions. This is automatically
647 called for all parsing and compiling methods but *not* for :meth:`lex`
648 because there you usually only want the actual source tokenized.
649 """
650 return reduce(
651 lambda s, e: e.preprocess(s, name, filename),
652 self.iter_extensions(),
653 str(source),
654 )
655
656 def _tokenize(
657 self,

Callers 2

babel_extractFunction · 0.95
_tokenizeMethod · 0.95

Calls 3

iter_extensionsMethod · 0.95
strFunction · 0.85
reduceFunction · 0.50

Tested by

no test coverage detected