2025-11-12 03:37:32 +00:00
|
|
|
import {Command, ParseContext} from "./command.js";
|
|
|
|
|
import {LexInput} from "../lexer.js";
|
2026-02-10 00:09:47 +00:00
|
|
|
import {Awaitable} from "../../util/types.js";
|
|
|
|
|
import {StrVM} from "../vm.js";
|
2025-11-12 03:37:32 +00:00
|
|
|
|
|
|
|
|
export class Lower extends Command<{}> {
|
|
|
|
|
isParseCandidate(token: LexInput): boolean {
|
|
|
|
|
return this.isKeyword(token, 'lower')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
attemptParse(context: ParseContext): {} {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDisplayName(): string {
|
|
|
|
|
return 'lower'
|
|
|
|
|
}
|
2026-02-10 00:09:47 +00:00
|
|
|
|
|
|
|
|
execute(vm: StrVM): Awaitable<StrVM> {
|
|
|
|
|
return vm.inPlace(ctx =>
|
|
|
|
|
ctx.replaceSubject(sub =>
|
|
|
|
|
sub.modify(s => s.toLowerCase())))
|
|
|
|
|
}
|
2025-11-12 03:37:32 +00:00
|
|
|
}
|