import {Command, ParseContext} from "./command.js"; import {LexInput} from "../lexer.js"; import {StrVM} from "../vm.js"; import {Awaitable} from "../../util/types.js"; export class Upper extends Command<{}> { isParseCandidate(token: LexInput): boolean { return this.isKeyword(token, 'upper') } attemptParse(context: ParseContext): {} { return {} } getDisplayName(): string { return 'upper' } execute(vm: StrVM): Awaitable { return vm.inPlace(ctx => ctx.replaceSubject(sub => sub.modify(s => s.toUpperCase()))) } }