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