Helper class to raise parser errors.
(msg: str)
| 1866 | |
| 1867 | |
| 1868 | def Error(msg: str) -> ParserElement: |
| 1869 | """Helper class to raise parser errors.""" |
| 1870 | def raise_error(s: str, loc: int, toks: ParseResults) -> T.Any: |
| 1871 | raise ParseFatalException(s, loc, msg) |
| 1872 | |
| 1873 | return Empty().set_parse_action(raise_error) |
| 1874 | |
| 1875 | |
| 1876 | class ParserState: |