erg/crates/erg_parser
Shunsuke Shibayama 1999f1119d
Some checks failed
CI / test (ubuntu-22.04, 3.10) (push) Failing after 42s
CI / test (ubuntu-22.04, 3.11.3) (push) Failing after 10s
CI / test (ubuntu-22.04, 3.7) (push) Failing after 13s
CI / test (ubuntu-22.04, 3.8) (push) Failing after 16s
CI / test (ubuntu-22.04, 3.9) (push) Failing after 7s
Docs / automatic-update (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (macos-13, 3.10) (push) Has been cancelled
CI / test (macos-13, 3.11.3) (push) Has been cancelled
CI / test (macos-13, 3.7) (push) Has been cancelled
CI / test (macos-13, 3.8) (push) Has been cancelled
CI / test (macos-13, 3.9) (push) Has been cancelled
CI / test (windows-latest, 3.10) (push) Has been cancelled
CI / test (windows-latest, 3.11.3) (push) Has been cancelled
CI / test (windows-latest, 3.7) (push) Has been cancelled
CI / test (windows-latest, 3.8) (push) Has been cancelled
CI / test (windows-latest, 3.9) (push) Has been cancelled
CI / build-check (macos-13) (push) Has been cancelled
CI / build-check (macos-latest) (push) Has been cancelled
CI / build-check (ubuntu-latest) (push) Has been cancelled
CI / build-check (windows-latest) (push) Has been cancelled
CI / publish-nightly (push) Has been cancelled
Notify / notify-change (push) Has been cancelled
feat: support pyo3 v0.25
2025-08-13 03:29:30 +09:00
..
tests chore: Lexer::lex() returns Failable<TokenStream> 2024-10-16 01:14:08 +09:00
.gitignore Rename dir: compiler -> crates 2023-01-15 12:03:19 +09:00
ast.rs feat: support pyo3 v0.25 2025-08-13 03:29:30 +09:00
build_ast.rs impl: expect the block 2024-02-20 23:41:41 +09:00
Cargo.toml fix: SharedPromise::join deadlock 2024-12-10 11:38:23 +09:00
convert.rs feat: ref/ref! with type specification 2024-12-27 02:46:58 +09:00
desugar.rs chore: desugar dict comprehension 2025-01-05 00:09:18 +09:00
error.rs chore: add ConstExpr::map 2024-10-04 13:01:30 +09:00
lex.rs chore: Lexer::lex() returns Failable<TokenStream> 2024-10-16 01:14:08 +09:00
lib.rs feat: support pyo3 v0.25 2025-08-13 03:29:30 +09:00
main.rs chore: name the spawned thread 2023-03-22 22:00:38 +09:00
parse.rs fix: clippy warns 2025-01-14 00:59:15 +09:00
README.md feat: make erg_compiler available as a Python lib 2023-11-15 11:20:10 +09:00
token.rs feat(els): impl document link 2024-10-13 00:09:16 +09:00
typespec.rs perf: reduce AST/HIR element size 2024-10-13 17:51:37 +09:00
visitor.rs feat: add ASTVisitor 2023-11-08 00:27:49 +09:00

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>