255 releases
| 0.6.53 | Aug 12, 2025 |
|---|---|
| 0.6.53-nightly.5 | Feb 25, 2025 |
| 0.6.52-nightly.1 | Jan 29, 2025 |
| 0.6.51-nightly.0 | Dec 29, 2024 |
| 0.5.13 | Nov 26, 2022 |
#1187 in Parser implementations
239 downloads per month
Used in 8 crates
(4 directly)
1MB
26K
SLoC
Implements Parser for Erg. Parser parses the source code to generate AST.
The generated ASTs are guaranteed to be identical if the source code is identical.
However, identical ASTs may be generated even if the source code is (a bit) different.
Erg parser
Use erg_parser as a Python library
erg_parser can be built as a Python library by using pyo3/maturin.
Example
import erg_parser
module = erg_parser.parse("x = 1")
for chunk in module:
if isinstance(chunk, erg_parser.expr.Def):
assert chunk.sig.inspect() == "x"
Debug install (using venv)
python -m venv .venv
source .venv/bin/activate
maturin develop --features pylib_parser
Release install
maturin build -i python --release --features pylib_parser
pip install <output wheel>
Dependencies
~2–28MB
~355K SLoC