25 lines
554 B
TypeScript
25 lines
554 B
TypeScript
|
|
import {Command, ParseContext, StrTerm} from "./command.js";
|
||
|
|
import {LexInput} from "../lexer.js";
|
||
|
|
|
||
|
|
export type LinesData = {
|
||
|
|
on?: StrTerm,
|
||
|
|
with?: StrTerm,
|
||
|
|
}
|
||
|
|
|
||
|
|
export class Lines extends Command<LinesData> {
|
||
|
|
attemptParse(context: ParseContext): LinesData {
|
||
|
|
return {
|
||
|
|
on: context.popOptionalTerm(),
|
||
|
|
with: context.popOptionalTerm(),
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
getDisplayName(): string {
|
||
|
|
return 'lines'
|
||
|
|
}
|
||
|
|
|
||
|
|
isParseCandidate(token: LexInput): boolean {
|
||
|
|
return this.isKeyword(token, 'lines')
|
||
|
|
}
|
||
|
|
}
|