190 releases

new 0.6.36 May 7, 2024
0.6.36-nightly.0 Apr 29, 2024
0.6.33 Mar 21, 2024
0.6.28 Dec 30, 2023
0.5.13 Nov 26, 2022

#1128 in Programming languages

Download history 274/week @ 2024-01-20 257/week @ 2024-01-27 289/week @ 2024-02-03 313/week @ 2024-02-10 729/week @ 2024-02-17 446/week @ 2024-02-24 455/week @ 2024-03-02 626/week @ 2024-03-09 494/week @ 2024-03-16 257/week @ 2024-03-23 491/week @ 2024-03-30 362/week @ 2024-04-06 509/week @ 2024-04-13 306/week @ 2024-04-20 362/week @ 2024-04-27 399/week @ 2024-05-04

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

MIT/Apache

1MB
25K 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–8.5MB
~73K SLoC