✨ Highlights
- Complete Lox language support: variables, assignments, control flow, functions, and closures.
- Classes with
initconstructors, instance methods, and dynamic properties. - Single inheritance with
superand properthisbinding. - Dynamic object property access and mutation.
- Tree-walk interpreter with detailed error reporting.
🏗️ Architecture
- Full scanner (lexical analysis).
- Recursive descent parser covering the full Lox grammar.
- Static resolver for variable depth tracking (faster lookups).
- Interpreter using an arena-style environment to manage scopes/closures without borrow-checker fights.
- Error handling with line info and panic-mode recovery.
🚀 Usage
cargo build --release
./target/release/rslox # REPL🔍 Example (classes & inheritance)
class Animal {
init(name) { this.name = name; }
speak() { print this.name; }
}
class Dog < Animal {
speak() {
super.speak();
print "Woof!";
}
}
var dog = Dog("Rex");
dog.speak();
✅ Tests
cargo test📄 Notes
See RELEASE_NOTES.md for full details and CHANGELOG.md for history.