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 { return this.isKeyword(token, 'clear') } attemptParse(context: ParseContext): {} { return {} } getDisplayName(): string { return 'clear' } execute(vm: StrVM): Awaitable { return vm.inPlace(ctx => ctx.replaceSubject(sub => sub.replaceWith(''))) } }