Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "rey-vscode"]
path = rey-vscode
url = https://github.com/rey-language/rey-vscode.git:
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# Changelog

## [feature] — 2026-03-23
- Implemented full import system for Rey with compile-time resolution.
- Added `export pub` function modifier and import visibility enforcement:
- `export pub func` => importable
- `pub func` => not importable
- `func` => private
- Added parser/AST support for:
- `import file.symbol`
- `import file.{a,b}`
- `import module`
- `import module::file`
- `import module::{a,b}`
- Added import resolver pipeline (`compiler/v1/src/imports.rs`) and integrated it into compiler entry flow.
- Implemented resolver lookup order:
1. current file directory
2. project root (entry file directory)
3. `~/.reyc/std/src` for `std` prefix
4. `~/.reyc/packages`
- Added module semantics:
- `module/main.rey` required for `import module`
- module namespace auto-collects all `export pub` functions from `.rey` files in folder
- `module::file` resolves direct file namespace
- Added import diagnostics for:
- file not found
- missing module `main.rey`
- function not found
- function is `pub` but not `export pub`
- circular imports
- duplicate imports
- Added runtime/typecheck namespace dispatch support for `namespace.func()`.
- Added import fixtures under `tests/imports/` for success and all required error cases.

## [release] — 2026-03-19
- Shipped `rey v0.0.6-pre`
- **Implemented full Struct System**:
- Data structures with named fields.
- Instance methods with direct field scoping (no more `self.x` inside methods for fields!).
- Static-style methods for construction and utilities.
- Visibility control with `pub` (private by default).
- Method overloading support.
- Struct literals for easy instantiation.
- Added `structs.rey` comprehensive test file.
- Improved field access error messages with "did you mean?" suggestions using Levenshtein distance.

## [release] — 2026-03-19
- Shipped `rey v0.0.5-pre`
- Added string interpolation syntax `"{var}"` and mixed type string conversions (`"a" + 1`)
Expand Down
2 changes: 1 addition & 1 deletion compiler/v1/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ pub mod ty;

pub use expr::Expr;
pub use literal::Literal;
pub use stmt::{Parameter, Stmt};
pub use stmt::{FunctionVisibility, ImportKind, Parameter, Stmt};
pub use ty::Type;
20 changes: 20 additions & 0 deletions compiler/v1/src/ast/stmt.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
use super::{Expr, Type};
use crate::lexer::span::Span;

#[derive(Debug, Clone, PartialEq)]
pub struct Parameter {
pub name: String,
pub ty: Option<Type>,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FunctionVisibility {
Private,
Pub,
ExportPub,
}

#[derive(Debug, Clone, PartialEq)]
pub enum ImportKind {
FileSymbols { module: String, symbols: Vec<String> },
ModuleNamespace { module: String },
ModuleItems { module: String, items: Vec<String> },
}

#[derive(Debug, Clone, PartialEq)]
pub enum Stmt {
VarDecl {
Expand All @@ -16,10 +31,15 @@ pub enum Stmt {
},
FuncDecl {
name: String,
visibility: FunctionVisibility,
params: Vec<Parameter>,
return_ty: Option<Type>,
body: Vec<Stmt>,
},
Import {
kind: ImportKind,
span: Span,
},
If {
condition: Expr,
then_branch: Vec<Stmt>,
Expand Down
Loading