()
| 360 | |
| 361 | |
| 362 | def python_fallback_runner(): |
| 363 | from parse import compile as py_compile, with_pattern as py_with_pattern |
| 364 | |
| 365 | @py_with_pattern(r"[ab]") |
| 366 | def ab(text): |
| 367 | return {"a": 1, "b": 2}[text] |
| 368 | |
| 369 | parser = py_compile("test {result:ab}", extra_types={"ab": ab}) |
| 370 | |
| 371 | def run(lines): |
| 372 | for line in lines: |
| 373 | parser.parse(line) |
| 374 | |
| 375 | return run |
| 376 | |
| 377 | |
| 378 | def rust_fallback_runner(): |