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,
)
| 643 | self.handle_exception(source=source) |
| 644 | |
| 645 | def preprocess( |
| 646 | self, |
| 647 | source: str, |
| 648 | name: t.Optional[str] = None, |
| 649 | filename: t.Optional[str] = None, |
| 650 | ) -> str: |
| 651 | """Preprocesses the source with all extensions. This is automatically |
| 652 | called for all parsing and compiling methods but *not* for :meth:`lex` |
| 653 | because there you usually only want the actual source tokenized. |
| 654 | """ |
| 655 | return reduce( |
| 656 | lambda s, e: e.preprocess(s, name, filename), |
| 657 | self.iter_extensions(), |
| 658 | str(source), |
| 659 | ) |
| 660 | |
| 661 | def _tokenize( |
| 662 | self, |
no test coverage detected