Sign in

    oboard/moonbit-eval/value does not have a README file

    RuntimeArgument

    pub(all) struct RuntimeArgument {
    value : RuntimeValue
    kind :
    ArgumentKind

    }

    RuntimeEnvironment

    pub(all) struct RuntimeEnvironment {
    values : Map[String, RuntimeValue]
    mutable_vars : Map[String, Bool]
    parent : RuntimeEnvironment?
    }

    RuntimeEnvironment::copy

    深拷贝环境 - 完全复制所有内容

    RuntimeEnvironment::create_closure_env

    fn RuntimeEnvironment::create_closure_env(self : RuntimeEnvironment) -> RuntimeEnvironment
    为闭包创建捕获环境 - 实现正确的变量捕获语义

    RuntimeEnvironment::new

    RuntimeValue

    pub(all) enum RuntimeValue {
    Unit
    Bool(Bool)
    Int(Int)
    UInt(UInt)
    Int64(Int64)
    UInt64(UInt64)
    Float(Float)
    Double(Double)
    Char(Char)
    Byte(Byte)
    String(String)
    Tuple(Array[RuntimeValue])
    Array(Array[RuntimeValue])
    Struct(Ref[Map[String, RuntimeValue]])
    Closure(
    Func
    , RuntimeEnvironment)
    Constructor(String, Array[RuntimeValue])
    Break(RuntimeValue?)
    Continue(Array[RuntimeValue])
    }
    运行时值 - 解释器实际操作的数据类型
    impl Eq for RuntimeValue

    RuntimeValue::from_expr

    将@syntax.Expr转换为RuntimeValue

    RuntimeValue::from_option

    fn RuntimeValue::from_option(self : RuntimeValue?) -> RuntimeValue

    RuntimeValue::is_mutable

    fn RuntimeValue::is_mutable(self : RuntimeValue) -> Bool
    检查值是否为可变类型

    RuntimeValue::is_reference

    fn RuntimeValue::is_reference(self : RuntimeValue) -> Bool
    检查值是否为引用类型

    RuntimeValue::to_expr

    将RuntimeValue转换为表达式(用于输出)

    infer_type_from_constant

    fn infer_type_from_constant(c :
    Constant
    ) -> String
    从常量推导类型

    runtime_value_infix

    fn runtime_value_infix(op : String, lhs : RuntimeValue, rhs : RuntimeValue) -> RuntimeValue
    RuntimeValue 之间的中缀运算 - 消除对 constant_infix 的依赖

    type_to_string

    fn type_to_string(ty :
    Type
    ) -> String