Commit Graph
6 Commits
Author SHA1 Message Date
Giulio Agostini 842216729b wip:
Add type system and refator for having only epression
2026-07-06 10:43:17 +02:00
Giulio Agostini 9f15a00b98 Add static variable resolution with scope tracking
- Add distance-based get_at on EnvironmentStack
- Add distance-based assign_at on EnvironmentStack
- Introduce ErrorSink to accumulate diagnostics across passes
- Implement Resolver with a ScopeStack and per-node distance map
- Extend interpreter to store locals distances for runtime lookup
- Add tests for resolution behavior and error accumulation
  Add static variable resolution with scope tracking
2026-06-30 15:05:34 +02:00
Giulio Agostini d40fe2a550 Introduce NodeId for AST and synthetic slices 2026-06-30 14:05:46 +02:00
Giulio Agostini ef8abda048 Move variable resolution to middleend
- Introduce AST-based visitor and resolver in middleend
- Update guard field and parser to use AstNode<Expr>
- Remove backend variable_resolution and adjust exports
- Expose middleend in the library
2026-06-30 09:47:22 +02:00
Giulio Agostini 29c86d278d Make environment generic and adapt closures
Added unit test
2026-06-29 20:50:29 +02:00
Giulio Agostini 07cedc27bf Add .idea to gitignore and prep return value types Add middleend module
for AST return value tracking

The changes introduce support for tracking return values and labels
across AST nodes. The key changes include:

- Adding ReturnValue type to BaseValue - Adding return_type field to
LoxFunction - Adding label field to Block statements - Creating
middleend crawler module for AST traversal Add return value types to AST

This accurately captures both changes: adding `.idea/` to gitignore and
adding return value types to the AST structure. The changes include
adding return value fields to statement nodes and adjusting the
interpreter logic accordingly.
2025-10-10 10:18:02 +02:00