Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 701 Bytes

README.md

File metadata and controls

43 lines (29 loc) · 701 Bytes

LoxPy

An implementation of jlox from part II of Crafting Interpreters, written in python.

Requiremnts

  • Python3.10 or higher

Usage

After cloning the repository and navigating to the working directory:

git clone https://github.com/HETHAT/LoxPy
cd LoxPy

You can run the interpreter in prompt mode with:

python3 ./src/lox.py

To run a specific file, use:

python3 ./src/lox.py example.lox

Replace "example.lox" with the path to your Lox file.

Example

$ python3 ./src/lox
> var name = "Med";
> "Hello, " + name
Hello, Med
> -(1 + 2) * (6 / 3)
-6

More examples available here.