185 releases

new 0.6.35-nightly.0 Apr 11, 2024
0.6.33 Mar 21, 2024
0.6.28 Dec 30, 2023
0.6.26 Nov 25, 2023
0.5.13 Nov 26, 2022

#1133 in Programming languages

Download history 232/week @ 2023-12-22 223/week @ 2023-12-29 286/week @ 2024-01-05 240/week @ 2024-01-12 267/week @ 2024-01-19 256/week @ 2024-01-26 281/week @ 2024-02-02 313/week @ 2024-02-09 686/week @ 2024-02-16 472/week @ 2024-02-23 462/week @ 2024-03-01 585/week @ 2024-03-08 506/week @ 2024-03-15 311/week @ 2024-03-22 467/week @ 2024-03-29 325/week @ 2024-04-05

1,686 downloads per month
Used in 7 crates (4 directly)

MIT/Apache

1MB
24K 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

~1.6–9.5MB
~73K SLoC