Add & register more basic commands
This commit is contained in:
18
src/vm/commands/suffix.ts
Normal file
18
src/vm/commands/suffix.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import {Command, ParseContext, StrTerm} from "./command.js";
|
||||
import {LexInput} from "../lexer.js";
|
||||
|
||||
export class Suffix extends Command<{ with: StrTerm }> {
|
||||
attemptParse(context: ParseContext): { with: StrTerm } {
|
||||
return {
|
||||
with: context.popTerm(),
|
||||
}
|
||||
}
|
||||
|
||||
getDisplayName(): string {
|
||||
return 'suffix'
|
||||
}
|
||||
|
||||
isParseCandidate(token: LexInput): boolean {
|
||||
return this.isKeyword(token, 'suffix')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user