17 lines
735 B
TypeScript
17 lines
735 B
TypeScript
import type { Bytecode } from "./bytecode"
|
|
import type { Value, TypeScriptFunction } from "./value"
|
|
import { VM } from "./vm"
|
|
|
|
export async function run(bytecode: Bytecode, functions?: Record<string, TypeScriptFunction>): Promise<Value> {
|
|
const vm = new VM(bytecode, functions)
|
|
return await vm.run()
|
|
}
|
|
|
|
export { type Bytecode, toBytecode, type ProgramItem } from "./bytecode"
|
|
export { bytecodeToString } from "./format"
|
|
export { wrapNative, type ParamInfo, extractParamInfo } from "./function"
|
|
export { OpCode } from "./opcode"
|
|
export { Scope } from "./scope"
|
|
export type { Value, TypeScriptFunction, NativeFunction } from "./value"
|
|
export { toValue, toString, toNumber, fromValue, toNull } from "./value"
|
|
export { VM } from "./vm" |