-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
area:coreCore compiler (parser, generator, IR, transform)Core compiler (parser, generator, IR, transform)high-priorityHigh priority taskHigh priority tasktype:featureNew feature or functionalityNew feature or functionality
Description
Description
Implement the ModuleResolver to handle hierarchical module loading with mod name; declarations.
This is part of the nested module system implementation (#53), broken down into manageable sub-issues.
Tasks
- Create
module_resolver.rswithModuleResolverstruct - Implement
resolve_module_declaration()formod foo;→foo.lumosorfoo/mod.lumos - Add module tree construction (parent-child relationships)
- Implement path resolution for
crate::,super::,self:: - Add circular module dependency detection
- Update
FileResolverto useModuleResolver - Add module resolution tests (10+ test cases)
Acceptance Criteria
-
mod models;correctly resolves tomodels.lumosormodels/mod.lumos - Module tree structure tracks parent-child relationships
-
crate::models::Userresolves from any module -
super::types::UserIdresolves relative to parent - Circular module dependencies detected with clear error
- All existing tests pass + 10 new module resolution tests
Technical Details
Resolution Algorithm:
For mod foo; in file path/to/file.lumos:
- Check
path/to/foo.lumos(sibling file) - If not found, check
path/to/foo/mod.lumos(directory module) - If neither exists, error: module not found
Path Resolution:
crate::- Absolute from rootsuper::- Parent moduleself::- Current modulemodule::- Relative child
Estimated Time
4-6 hours
Dependencies
- Depends On: #53a (completed - AST foundations with visibility)
- Blocks: #53c (generator updates)
- Part Of: Add nested module support to LUMOS #53 (nested module support)
Priority
High - Core functionality needed for module system
Metadata
Metadata
Assignees
Labels
area:coreCore compiler (parser, generator, IR, transform)Core compiler (parser, generator, IR, transform)high-priorityHigh priority taskHigh priority tasktype:featureNew feature or functionalityNew feature or functionality