19 lines
462 B
TypeScript
19 lines
462 B
TypeScript
|
|
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')
|
||
|
|
}
|
||
|
|
}
|