oboard/moonbit-eval/interpreter does not have a README file
pub suberror ControlFlow {
Raise(RuntimeValue)
Continue(Array[RuntimeValue])
Break(RuntimeValue?)
Return(RuntimeValue)
Error(String)
}pub(all) struct ClosureInterpreter {
extern_fns : Map[String, (RuntimeFunctionContext) -> RuntimeValue raise ControlFlow]
embedded_fns : Map[String, (RuntimeFunctionContext) -> RuntimeValue raise ControlFlow]
embedded_methods : Map[String, Map[String, (RuntimeFunctionContext) -> RuntimeValue raise ControlFlow]]
main : RuntimeModule
current_module : RuntimeModule
state : InterpreterState
call_stack : Array[RuntimeLocation]
}fn ClosureInterpreter::add_embedded_fn(self : ClosureInterpreter, name : String, f : (RuntimeFunctionContext) -> RuntimeValue raise ControlFlow) -> Unitfn ClosureInterpreter::add_embedded_method(self : ClosureInterpreter, type_name : String, method_name : String, f : (RuntimeFunctionContext) -> RuntimeValue raise ControlFlow) -> Unitfn ClosureInterpreter::add_extern_fn(self : ClosureInterpreter, name : String, f : (RuntimeFunctionContext) -> RuntimeValue raise ControlFlow) -> Unitfn ClosureInterpreter::bind_function_parameters(self : ClosureInterpreter, params : List[Parameter], args : List[RuntimeArgument]) -> Unit raise ControlFlowfn ClosureInterpreter::call(self : ClosureInterpreter, function : Func, mod : RuntimeModule, env : RuntimeEnvironment, args : List[RuntimeArgument], name? : String) -> RuntimeValue raise ControlFlowfn ClosureInterpreter::call_closure(self : ClosureInterpreter, function : Func, mod : RuntimeModule, env : RuntimeEnvironment, args : List[Argument], name? : String) -> RuntimeValue raise ControlFlowfn ClosureInterpreter::constants_equal(_self : ClosureInterpreter, c1 : Constant, c2 : Constant) -> Boolfn ClosureInterpreter::constants_equal_expr(self : ClosureInterpreter, expr1 : Expr, expr2 : Expr) -> Boolfn ClosureInterpreter::execute_match_runtime(self : ClosureInterpreter, value : RuntimeValue, cases : List[Case]) -> RuntimeValue raise ControlFlowfn ClosureInterpreter::get_function_type_string(self : ClosureInterpreter, value : RuntimeValue) -> Stringfn ClosureInterpreter::top_visit(self : ClosureInterpreter, node : Impl) -> RuntimeValue raise ControlFlowfn ClosureInterpreter::value_in_range(self : ClosureInterpreter, value : Expr, lhs : Pattern, rhs : Pattern, inclusive : Bool) -> Boolfn ClosureInterpreter::visit(self : ClosureInterpreter, node : Expr) -> RuntimeValue raise ControlFlowfn ClosureInterpreter::visit_scoped(self : ClosureInterpreter, node : Expr, loc : RuntimeLocation) -> RuntimeValue raise ControlFlowimpl Show for ModuleMetaimpl ToJson for ModuleMetaimpl FromJson for ModuleMetafn ModuleMeta::new(name : String, version? : String, readme? : String, repository? : String, license? : String, keywords? : Array[String], description? : String, source? : String, deps? : Map[String, String]) -> ModuleMetapub(all) enum RuntimeArgumentKind {
Positional
Labelled(String)
LabelledOption(String)
}pub(all) struct RuntimeEnvironment {
traits : Map[String, TraitDecl]
fn_aliases : Map[String, String]
type_definitions : Map[String, TypeDecl]
struct_methods : Map[String, Map[String, RuntimeValue]]
type_environment : TypeEnvironment
values : Map[String, RuntimeValue]
mutable_vars : Map[String, Bool]
parent : RuntimeEnvironment?
}impl ToJson for RuntimeEnvironmentfn RuntimeEnvironment::define_struct_method(self : RuntimeEnvironment, type_name : String, method_name : String, func : Func) -> Unitfn RuntimeEnvironment::new(parent? : RuntimeEnvironment, values? : Map[String, RuntimeValue], struct_methods? : Map[String, Map[String, RuntimeValue]]) -> RuntimeEnvironmentfn RuntimeEnvironment::set_mutable_variable(self : RuntimeEnvironment, name : String, value : RuntimeValue) -> Unitfn RuntimeEnvironment::top_func_def_to_closure(self : RuntimeEnvironment, func : Impl) -> (String?, RuntimeValue)fn RuntimeEnvironment::update(self : RuntimeEnvironment, name : String, new_value : RuntimeValue) -> Unitpub(all) struct RuntimeFunctionContext {
context : ClosureInterpreter
mod : RuntimeModule
args : Array[RuntimeArgument]
}pub enum RuntimeLocation {
FunctionCall(String)
ControlFlow(String)
LetMut(String)
}impl Show for RuntimeLocationpub(all) struct RuntimeModule {
meta : ModuleMeta
env : RuntimeEnvironment
deps : Map[String, RuntimeModule]
}impl ToJson for RuntimeModulefn RuntimeModule::cons(self : RuntimeModule, name : String, args : Array[RuntimeValue]) -> RuntimeValuefn RuntimeModule::cons_with_labels(self : RuntimeModule, name : String, labeled_args : Array[(String?, RuntimeValue, Bool)]) -> RuntimeValuefn RuntimeModule::new(pkg : String, deps~ : Map[String, RuntimeModule], builder : (RuntimeEnvironment, (String) -> (String?, RuntimeValue)) -> Map[String, (String?, RuntimeValue)]) -> RuntimeModulefn[T] RuntimeModule::with_ident(self : RuntimeModule, long_ident : LongIdent, func : (RuntimeModule, String, String) -> T raise?) -> T raise?pub(all) enum RuntimeValue {
Unit
Bool(Bool)
Int(Int)
UInt(UInt)
UInt16(UInt16)
Int64(Int64)
UInt64(UInt64)
Float(Float)
Double(Double)
BigInt(BigInt)
Char(Char)
Byte(Byte)
String(String)
Bytes(Bytes)
StringView(View)
Tuple(Array[RuntimeValue])
Array(Array[RuntimeValue])
ArrayView(ArrayView[RuntimeValue])
UninitializedArray(UninitializedArray[RuntimeValue])
Map(Map[RuntimeValue, RuntimeValue])
Struct(WithType[Map[String, RuntimeValue]])
Closure(Func, RuntimeEnvironment)
Constructor(WithType[ConstructorValue])
Exception(String)
Iter(Iter[RuntimeValue])
}impl Add for RuntimeValueimpl Compare for RuntimeValueimpl Eq for RuntimeValueimpl Hash for RuntimeValueimpl Show for RuntimeValueimpl ToJson for RuntimeValue