Files
str/src/vm/commands/infile.ts

17 lines
434 B
TypeScript
Raw Normal View History

2025-11-10 23:54:20 -06:00
import {Command, ParseContext, StrTerm} from "./command.js";
import {LexInput} from "../lexer.js";
export class InFile extends Command<{ path: StrTerm }> {
isParseCandidate(token: LexInput): boolean {
return this.isKeyword(token, 'infile')
}
attemptParse(context: ParseContext): { path: StrTerm } {
return { path: context.popTerm() }
}
getDisplayName(): string {
return 'infile'
}
}