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
+2 -1
View File
@@ -3,6 +3,7 @@ pub mod env;
pub mod eval;
pub mod exec;
pub mod interpreter;
pub mod module;
pub use env::Env;
pub use interpreter::Interpreter;
@@ -12,7 +13,7 @@ use std::rc::Rc;
use std::cell::RefCell;
use std::fmt;
pub type NativeFn = Rc<dyn Fn(Vec<Value>) -> Result<Value, crate::error::RuntimeError>>;
pub type NativeFn = Rc<dyn Fn(&mut super::Interpreter, Vec<Value>) -> Result<Value, crate::error::RuntimeError>>;
#[derive(Clone)]
pub enum Value {