feat: 模块系统 mod + pub — 多文件编译支持

This commit is contained in:
2026-06-06 16:09:30 +08:00
parent e02cc7b1d6
commit fa734b8a23
9 changed files with 197 additions and 22 deletions
+7
View File
@@ -0,0 +1,7 @@
mod math_mod;
fn main() -> i64 {
let result = math_mod::add(3, 4);
print_i64(result); // 7
return 0;
}
+3
View File
@@ -0,0 +1,3 @@
pub fn add(a: i64, b: i64) -> i64 {
return a + b;
}