127ef98486
Introduces a new enum which represents the different types of possible values, and modifies the rest of the existing code to wrap/unwrap these enum variants correctly. Notably in the vm module, a new macro has been introduced that makes it possible to encode a type expectation and return a runtime error in case of a type mismatch. Change-Id: I325b5e31e395c62d8819ab2af6d398e1277333c0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2570 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI |
||
---|---|---|
.. | ||
src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
default.nix | ||
README.md | ||
rustfmt.toml |
This is an interpreter for the Lox language, based on the book "Crafting Interpreters".
The book's original code uses Java, but I don't want to use Java, so I've decided to take on the extra complexity of porting it to Rust.
Note: This implements the first of two Lox interpreters.