feat: 实现模块引入功能以及测试

This commit is contained in:
0264408
2026-06-17 15:57:45 +08:00
parent 9428e270af
commit e356c208a6
17 changed files with 349 additions and 49 deletions
+3
View File
@@ -36,6 +36,9 @@ pub fn register_all(env: &Rc<RefCell<Env>>) {
e.define("push".into(), Value::NativeFunction(Rc::new(core::push)), true);
e.define("pop".into(), Value::NativeFunction(Rc::new(core::pop)), true);
// require — module loader
e.define("require".into(), Value::NativeFunction(Rc::new(super::module::require_fn)), true);
// string — split, trim, substring, replace, contains, upper, lower, starts_with, ends_with
e.define("split".into(), Value::NativeFunction(Rc::new(string::split)), true);
e.define("trim".into(), Value::NativeFunction(Rc::new(string::trim)), true);