2023-06-22 16:43:33 +10:00
|
|
|
import { Program } from '../lang/abstractSyntaxTree'
|
|
|
|
import { ProgramMemory, _executor } from '../lang/executor'
|
|
|
|
import { EngineCommandManager } from '../lang/std/engineConnection'
|
|
|
|
|
|
|
|
export async function executor(
|
|
|
|
ast: Program,
|
|
|
|
pm: ProgramMemory = { root: {}, pendingMemory: {} }
|
|
|
|
): Promise<ProgramMemory> {
|
2023-06-23 14:19:15 +10:00
|
|
|
const engineCommandManager = new EngineCommandManager({
|
|
|
|
setIsStreamReady: () => {},
|
|
|
|
setMediaStream: () => {},
|
|
|
|
})
|
2023-06-22 16:43:33 +10:00
|
|
|
engineCommandManager.startNewSession()
|
|
|
|
const programMemory = await _executor(ast, pm, engineCommandManager)
|
|
|
|
await engineCommandManager.waitForAllCommands()
|
|
|
|
return programMemory
|
|
|
|
}
|