Add chunk command, add limit param to split command
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {Command, CommandData, ParseContext, StrLVal} from "./command.js";
|
||||
import {Command, CommandData, ParseContext, StrLVal, wrapString} from "./command.js";
|
||||
import {Executable} from "../parse.js";
|
||||
import {LexInput} from "../lexer.js";
|
||||
import {StrVM} from "../vm.js";
|
||||
@@ -26,7 +26,7 @@ export class Over extends Command<OverData> {
|
||||
|
||||
async execute(vm: StrVM, data: OverData): Promise<StrVM> {
|
||||
return vm.tapInPlace(async parentCtx => {
|
||||
const oldValue = parentCtx.resolveRequired(data.subject)
|
||||
const oldValue = parentCtx.resolve(data.subject) || wrapString('')
|
||||
const newValue = await vm.runInChild(async (child, childCtx) => {
|
||||
await childCtx.replaceSubject(() => oldValue)
|
||||
await data.exec.command.execute(child, data.exec.data)
|
||||
|
||||
Reference in New Issue
Block a user