244 releases

new 0.6.52-nightly.0 Jan 17, 2025
0.6.51-nightly.0 Dec 29, 2024
0.6.49-nightly.0 Nov 26, 2024
0.6.40 Jul 24, 2024
0.5.13 Nov 26, 2022

#1051 in Parser implementations

Download history 591/week @ 2024-09-28 593/week @ 2024-10-05 662/week @ 2024-10-12 645/week @ 2024-10-19 116/week @ 2024-10-26 485/week @ 2024-11-02 296/week @ 2024-11-09 279/week @ 2024-11-16 330/week @ 2024-11-23 111/week @ 2024-11-30 462/week @ 2024-12-07 455/week @ 2024-12-14 533/week @ 2024-12-21 398/week @ 2024-12-28 378/week @ 2025-01-04 251/week @ 2025-01-11

1,578 downloads per month
Used in 8 crates (4 directly)

MIT/Apache

1MB
26K SLoC

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>

lib.rs:

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.

Dependencies

~2–25MB
~359K SLoC