12 lines
423 B
TypeScript
12 lines
423 B
TypeScript
import type { Bytecode } from "./bytecode"
|
|
import { type Value } from "./value"
|
|
import { VM } from "./vm"
|
|
|
|
export async function run(bytecode: Bytecode): Promise<Value> {
|
|
const vm = new VM(bytecode)
|
|
return await vm.run()
|
|
}
|
|
|
|
export { type Bytecode, toBytecode, type ProgramItem } from "./bytecode"
|
|
export { type Value, toValue, toString, toNumber, fromValue, toNull, wrapNative } from "./value"
|
|
export { VM } from "./vm" |