str/src/vm/commands/prefix.ts

19 lines
455 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 class Prefix extends Command<{ with: StrTerm }> {
attemptParse(context: ParseContext): { with: StrTerm } {
return {
with: context.popTerm(),
}
}
getDisplayName(): string {
return 'prefix'
}
isParseCandidate(token: LexInput): boolean {
return this.isKeyword(token, 'prefix')
}
}