Skip to content

feat: implement full import system with export pub visibility#28

Closed
IMisbahk wants to merge 7 commits intomasterfrom
codex
Closed

feat: implement full import system with export pub visibility#28
IMisbahk wants to merge 7 commits intomasterfrom
codex

Conversation

@IMisbahk
Copy link
Collaborator

What

Implemented the full Rey import system end-to-end.

  • Added export pub function visibility and parser support for import syntax
  • Added compile-time import resolver pipeline in compiler/v1/src/imports.rs
  • Implemented file-level imports (file.symbol, file.{a,b})
  • Implemented module-level imports (module, module::file, module::{a,b})
  • Enforced module main.rey requirement for bare module imports
  • Added resolver order: local dir -> project root -> ~/.reyc/std/src for std prefix -> ~/.reyc/packages
  • Added compile-time diagnostics for all required cases (missing file, missing main, missing symbol, pub-not-export, circular, duplicate)
  • Added scope injection behavior and namespace dispatch (namespace.func())
  • Added comprehensive fixtures under tests/imports for success and error cases

Why

The language needed a complete import system with clear visibility semantics and reliable compile-time diagnostics. This enables modular project structure and safe symbol sharing while preserving explicit export boundaries.

Notes

Verified with:

  • cargo build
  • cargo test
  • cargo run -- ../../tests/imports/success/main.rey
  • all tests/imports/errors cases (expected failures with clear diagnostics)

@IMisbahk IMisbahk closed this Mar 22, 2026
@IMisbahk
Copy link
Collaborator Author

merge conflicts fix required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants