19 lines
463 B
TypeScript
19 lines
463 B
TypeScript
|
|
import { LexInput } from "../lexer.js";
|
||
|
|
import {Command, ParseContext, StrTerm} from "./command.js";
|
||
|
|
|
||
|
|
export class Contains extends Command<{ find: StrTerm }> {
|
||
|
|
attemptParse(context: ParseContext): { find: StrTerm } {
|
||
|
|
return {
|
||
|
|
find: context.popTerm(),
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
getDisplayName(): string {
|
||
|
|
return 'contains'
|
||
|
|
}
|
||
|
|
|
||
|
|
isParseCandidate(token: LexInput): boolean {
|
||
|
|
return this.isKeyword(token, 'contains')
|
||
|
|
}
|
||
|
|
}
|