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,
)
| 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, |
no test coverage detected