mirror of
https://github.com/erg-lang/erg.git
synced 2025-12-23 05:36:48 +00:00
|
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
|
||
|---|---|---|
| .. | ||
| tests | ||
| .gitignore | ||
| ast.rs | ||
| build_ast.rs | ||
| Cargo.toml | ||
| convert.rs | ||
| desugar.rs | ||
| error.rs | ||
| lex.rs | ||
| lib.rs | ||
| main.rs | ||
| parse.rs | ||
| README.md | ||
| token.rs | ||
| typespec.rs | ||
| visitor.rs | ||
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>