Implement output/clipboard interfaces, stub implementations, and implement execute()s for Copy and Paste
This commit is contained in:
10
src/index.ts
10
src/index.ts
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user