24 lines
574 B
TypeScript
24 lines
574 B
TypeScript
import {Command, CommandData, ParseContext, StrLVal} from "./command.js";
|
|
import {Executable} from "../parse.js";
|
|
import {LexInput} from "../lexer.js";
|
|
|
|
export type LineData = {
|
|
exec: Executable<CommandData>,
|
|
}
|
|
|
|
export class Line extends Command<LineData> {
|
|
async attemptParse(context: ParseContext): Promise<LineData> {
|
|
return {
|
|
exec: await context.popExecutable(),
|
|
}
|
|
}
|
|
|
|
getDisplayName(): string {
|
|
return 'line'
|
|
}
|
|
|
|
isParseCandidate(token: LexInput): boolean {
|
|
return this.isKeyword(token, 'line')
|
|
}
|
|
}
|