str/src/vm/commands/lines.ts

25 lines
554 B
TypeScript
Raw Normal View History

2025-11-12 03:37:32 +00:00
import {Command, ParseContext, StrTerm} from "./command.js";
import {LexInput} from "../lexer.js";
export type LinesData = {
on?: StrTerm,
with?: StrTerm,
}
export class Lines extends Command<LinesData> {
attemptParse(context: ParseContext): LinesData {
return {
on: context.popOptionalTerm(),
with: context.popOptionalTerm(),
}
}
getDisplayName(): string {
return 'lines'
}
isParseCandidate(token: LexInput): boolean {
return this.isKeyword(token, 'lines')
}
}