Implement output/clipboard interfaces, stub implementations, and implement execute()s for Copy and Paste

This commit is contained in:
2026-02-10 00:06:16 -06:00
parent f36621c646
commit 06ff1b396f
5 changed files with 80 additions and 14 deletions

View File

@@ -5,6 +5,7 @@ import {Lexer} from "./vm/lexer.js";
import {Parser} from "./vm/parser.js";
import {commands} from "./vm/commands/index.js";
import {Executor} from "./vm/vm.js";
import {ConsoleDisplay, FakeClipboard, OutputManager} from "./vm/output.js";
const lifecycle = new Lifecycle()
const input = new Input()
@@ -17,8 +18,13 @@ lexer.subscribe(token => log.verbose('token', token))
const parser = new Parser(commands, lexer)
parser.subscribe(exec => log.verbose('exec', exec))
const exec = new Executor(parser)
exec.subscribe(state => state.output())
const output: OutputManager = {
display: new ConsoleDisplay,
clipboard: new FakeClipboard,
}
const exec = new Executor(output, parser)
exec.subscribe(state => state.outputSubject())
input.setupPrompt()