The commit rewrites the environment to use a stack of hash maps for
managing variable scopes. This replaces the old parent-reference
approach with a simpler and more efficient stack-based model.
Key changes: - Rename Environment to EnvironmentStack - Store scopes in
a Vec of HashMaps - Add push/pop scope operations for block handling -
Update interpreter to properly manage scope lifetimes - Clean up error
handling with helper functions
The commit adds while loop statements and improves token display
formatting:
- Implements while loop syntax and evaluation - Adds a new token pretty
printing module with configurable formatting - Improves token display
with colors and different output modes
This initial commit sets up the basic structure for a Rust
implementation of the Lox interpreter, including:
- Lexer for tokenizing source code - Parser for building AST - Basic
interpreter functionality - Environment for variable storage
The core components include source tracking, error handling, and basic
expression evaluation.