1#![allow(clippy::result_large_err)]
2
3pub mod accel;
4pub(crate) mod bytecode;
5pub(crate) mod call;
6pub(crate) mod compiler;
7pub mod indexing;
8pub(crate) mod instr {
9 pub use crate::bytecode::instr::{ArgSpec, EndExpr, Instr};
10}
11pub(crate) mod interpreter;
12pub(crate) mod layout;
13pub(crate) mod object;
14pub(crate) mod ops;
15pub(crate) mod runtime;
16
17pub use bytecode::{compile, compile_semantic_function_registry};
18pub use bytecode::{
19 ArgSpec, AsyncMetadata, AwaitSite, Bytecode, EmitLabel, EndExpr, FunctionBytecode,
20 FunctionRegistry, Instr, SpawnSite, StackEffect,
21};
22#[cfg(feature = "native-accel")]
23pub use bytecode::{
24 FusionCandidateGroup, FusionInstructionKind, FusionInstructionWindow, FusionMetadata,
25};
26pub use call::builtins::{push_dynamic_eval_options, set_dynamic_eval_options};
27pub use compiler::CompileError;
28pub use interpreter::api::{
29 set_call_stack_limit, set_error_namespace, DEFAULT_CALLSTACK_LIMIT, DEFAULT_ERROR_NAMESPACE,
30};
31pub use interpreter::runner::{
32 interpret, interpret_function, interpret_function_with_counts, interpret_with_vars,
33 invoke_semantic_function_value,
34};
35pub use interpreter::state::{InterpreterOutcome, InterpreterState};
36pub use layout::{
37 derive_layout, LayoutError, VmAssemblyLayout, VmEntrypointLayout, VmFunctionLayout, VmSlotId,
38};
39pub use runtime::workspace::{
40 push_pending_workspace, take_updated_workspace_assigned_report, take_updated_workspace_state,
41 PendingWorkspaceGuard, WorkspaceAssignedReport,
42};
43
44#[doc(hidden)]
45pub fn reset_thread_state_for_tests() {
46 runtime::call_stack::reset_thread_state_for_tests();
47 runtime::globals::reset_thread_state_for_tests();
48 runtime::workspace::reset_thread_state_for_tests();
49}
50
51pub async fn call_method_or_member_index_named_with_outputs(
52 base: runmat_builtins::Value,
53 name: String,
54 args: Vec<runmat_builtins::Value>,
55 requested_outputs: usize,
56 _fallback_policy: runmat_hir::CallableFallbackPolicy,
57) -> Result<runmat_builtins::Value, runmat_runtime::RuntimeError> {
58 call::closures::call_method_or_member_index_named_with_outputs(
59 base,
60 name,
61 args,
62 requested_outputs,
63 None,
64 )
65 .await
66}