Lox language implemented in Python. Inspired by Bob Nystrom's Crafting Interpreters
- booleans, numbers, strings and nil datatypes
- dynamic typing
- control flow. if, while, for statement
- closures
- recursion
- class
- inheritance
more at examples
Make sure you have python 3.7 installed, other versions are not tested. Here I use python venv, and I highly suggest you do also:
$ git clone https://github.com/Excited-ccccly/pylox $ cd pylox/ $ mkdir .venv $ python -m venv .venv $ source .venv/bin/activate $ pip install -r requirements.txt & pip install -r requirements.dev.txt $ python setup.py develop
more at CONTRIBUTING
This project will register a command, pylox, in your environment(venv or system). If you use venv as I suggested, pylox will only be avaliable in venv and you have to activate venv before use pylox to interpret
Execute pylox with a script filepath argument to interpret it
$ pylox tests/data/interpreter/visitor_pattern_in_lox.lox
or without a argument to enter REPL mode
$ pylox
- In REPL mode, user have to input a blank line to get code interpreted.