[WIP] Start implementing execution in the new TS version

This commit is contained in:
2026-02-09 18:09:47 -06:00
parent aaff8a5011
commit 82eda43dad
19 changed files with 378 additions and 10 deletions

View File

@@ -1,5 +1,7 @@
import {Command, ParseContext} from "./command.js";
import {LexInput} from "../lexer.js";
import {StrVM} from "../vm.js";
import {Awaitable} from "../../util/types.js";
export class Clear extends Command<{}> {
isParseCandidate(token: LexInput): boolean {
@@ -13,4 +15,10 @@ export class Clear extends Command<{}> {
getDisplayName(): string {
return 'clear'
}
execute(vm: StrVM): Awaitable<StrVM> {
return vm.inPlace(ctx =>
ctx.replaceSubject(sub =>
sub.replaceWith('')))
}
}