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.javais 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 installThis 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-commitAfter installation run:
pre-commit installNow 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-filesUpdate the .pre-commit-config.yaml with the command:
pre-commit autoupdateThis command will go online and find the latest versions.
Update packages:
poetry updateShow installed packages:
poetry show --treeIt's possible to add --no-dev to hide the development dependencies.