Replace StringRange w/ an actual StrRVal + more command implementations

This commit is contained in:
2026-02-09 22:15:33 -06:00
parent 82eda43dad
commit feba84051a
29 changed files with 502 additions and 192 deletions

View File

@@ -1,4 +1,4 @@
import {Command, ParseContext} from "./command.js";
import {Command, ParseContext, wrapString} from "./command.js";
import {LexInput} from "../lexer.js";
import {StrVM} from "../vm.js";
import {Awaitable} from "../../util/types.js";
@@ -17,8 +17,6 @@ export class Clear extends Command<{}> {
}
execute(vm: StrVM): Awaitable<StrVM> {
return vm.inPlace(ctx =>
ctx.replaceSubject(sub =>
sub.replaceWith('')))
return vm.tapInPlace(ctx => ctx.replaceSubjectAsString(''))
}
}