230 releases

new 0.6.48 Nov 20, 2024
0.6.47-nightly.4 Oct 20, 2024
0.6.40 Jul 24, 2024
0.6.33 Mar 21, 2024
0.5.13 Nov 26, 2022

#988 in Parser implementations

Download history 352/week @ 2024-07-31 417/week @ 2024-08-07 627/week @ 2024-08-14 349/week @ 2024-08-21 397/week @ 2024-08-28 453/week @ 2024-09-04 182/week @ 2024-09-11 469/week @ 2024-09-18 671/week @ 2024-09-25 804/week @ 2024-10-02 479/week @ 2024-10-09 850/week @ 2024-10-16 158/week @ 2024-10-23 424/week @ 2024-10-30 347/week @ 2024-11-06 89/week @ 2024-11-13

1,058 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–26MB
~392K SLoC