This project is a python implementation for Lox. Read more at https://craftinginterpreters.com
Since we're implementing this in Python, the structure will be a little bit different. For example, the main class is called Yaplox, and not Lox as in the original implementation.
lox/Lox.java
is calledyaplox/yaplox.py
This project uses poetry
to manage dependencies. Some commands:
Add a new package to the dependencies use:
poetry add <Package>
To add it a a development dependency use:
poetry add -D <package>
Install the project with the command
poetry install
This project uses pre-commit. Pre-commit runs all the required tools before committing.
This useful tool will be installed with poetry install
, or manually with
pip install pre-commit
After installation run:
pre-commit install
Now every time before running git commit
the hooks defined in the
.pre-commit-config.yaml
file will be run before actually committing.
To run this manually, run:
pre-commit run --all-files
Update the .pre-commit-config.yaml
with the command:
pre-commit autoupdate
This command will go online and find the latest versions.
Update packages:
poetry update
Show installed packages:
poetry show --tree
It's possible to add --no-dev
to hide the development dependencies.