str/src/vm/commands/outfile.ts

17 lines
437 B
TypeScript

import {Command, ParseContext, StrTerm} from "./command.js";
import {LexInput} from "../lexer.js";
export class OutFile extends Command<{ path: StrTerm }> {
isParseCandidate(token: LexInput): boolean {
return this.isKeyword(token, 'outfile')
}
attemptParse(context: ParseContext): { path: StrTerm } {
return { path: context.popTerm() }
}
getDisplayName(): string {
return 'outfile'
}
}