Metadata-Version: 2.4
Name: pyparsing-rust
Version: 3.3.3
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Text Processing
License-File: LICENSE
License-File: NOTICE
Summary: Python parsing module (rustsmith Stage-1 mirror of pyparsing/pyparsing: scan kernels in Rust, same API)
Keywords: parsing,grammar,parser,rust
Home-Page: https://github.com/pyparsing/pyparsing
Author: Paul McGuire
Maintainer-email: Paul McGuire <ptmcg.gm+pyparsing@gmail.com>
License-Expression: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/John-Cusack/pyparsing-rust
Project-URL: Upstream, https://github.com/pyparsing/pyparsing

# pyparsing-rust

Stage-1 Rust mirror of [pyparsing/pyparsing](https://github.com/pyparsing/pyparsing)
(`pyparsing` 3.3.3, MIT): a runtime-constructible grammar API for Python.

## Boundary

The text-scan hot path — the remainder loops of `CharsNotIn.parseImpl`
and `White.parseImpl` — lives in the reusable `pyparsing-rust-core`
crate (no Python dependency) with a thin PyO3 binding
(`pyparsing._pyparsing`). Everything else is the upstream source
verbatim:

- ported to Rust: `CharsNotIn` / `White` scan loops (code-point exact,
  including lone surrogates);
- kept in Python: `ParserElement` dispatch (`_parseNoCache`),
  `preParse` whitespace skipping (FFI floor exceeds 1–3-char skips;
  measured), `Word`/`Regex`/`Literal` (already C-speed via `re`),
  `ParseResults`, `SkipTo`, helpers, `common`, testing, unicode,
  diagram, tools.

`pyparsing/` keeps the exact public interface; when the compiled
extension is absent the shims fall back to the upstream Python loops,
so the tree also imports without a build.

## Build

```sh
python3 -m venv .venv && . .venv/bin/activate
pip install maturin
maturin develop --release
python3 -m pytest tests/ -q
```

## Layout

- `pyparsing-core/` — reusable Rust core (`pyparsing-rust-core` on crates.io).
- `src/lib.rs` — PyO3 binding (`pyparsing._pyparsing`).
- `pyparsing/core.py` — upstream 3.3.3 plus two delegating `parseImpl`
  methods (diff against upstream shows only the delegation).
- `tests/` — upstream suite (frozen oracle; do not weaken).

<!-- RUSTSMITH-PERF:BEGIN (generated by `rustsmith release-prep`; do not hand-edit) -->
## Measured performance
No accepted optimizations yet (mirror baseline); re-run `release-prep` after `run --stage optimize` merges winners.
Artifact hashes are intentionally absent here; see `release-manifest.json`.
<!-- RUSTSMITH-PERF:END -->

