43 lines
1.2 KiB
Markdown
43 lines
1.2 KiB
Markdown
# SLS Python
|
|
|
|
This directory contains a minimal Python project skeleton intended to reimplement
|
|
functionality from the C `SLS` project found at the repository root.
|
|
|
|
Layout
|
|
- `src/sls/` — Python package with module skeletons: `lexer`, `parser`, `interpreter`, `builtin`, `repl`, and `cli`.
|
|
- `tests/` — pytest tests (start with `test_import.py`).
|
|
- `pyproject.toml` — project metadata and `sls` console script entrypoint.
|
|
- `requirements-dev.txt` — developer/test tools.
|
|
|
|
Quick start
|
|
|
|
Create a venv and install editable package + dev requirements:
|
|
|
|
```bash
|
|
python -m venv .venv
|
|
source .venv/bin/activate
|
|
pip install -e SLS_Python
|
|
pip install -r SLS_Python/requirements-dev.txt
|
|
```
|
|
|
|
Run tests:
|
|
|
|
```bash
|
|
pytest -q
|
|
```
|
|
|
|
Run the REPL:
|
|
|
|
```bash
|
|
sls repl
|
|
```
|
|
|
|
Next steps (suggested)
|
|
- Port `lexer.c` to `src/sls/lexer.py` and add comprehensive tokenization tests.
|
|
- Port `parser` and `interpreter` incrementally, keeping tests for parity.
|
|
- Add CI (GitHub Actions) and type checking (`mypy`).
|
|
|
|
If you want, I can now:
|
|
- Run the tests in this environment (if you want me to configure the Python env), or
|
|
- Start porting a specific module from the C implementation (lexer is a good first target).
|