17 lines
438 B
TypeScript
17 lines
438 B
TypeScript
|
|
import {Command, ParseContext, StrTerm} from "./command.js";
|
||
|
|
import {LexInput} from "../lexer.js";
|
||
|
|
|
||
|
|
export class Load extends Command<{ path?: StrTerm }> {
|
||
|
|
isParseCandidate(token: LexInput): boolean {
|
||
|
|
return this.isKeyword(token, 'load')
|
||
|
|
}
|
||
|
|
|
||
|
|
attemptParse(context: ParseContext): { path?: StrTerm } {
|
||
|
|
return { path: context.popOptionalTerm() }
|
||
|
|
}
|
||
|
|
|
||
|
|
getDisplayName(): string {
|
||
|
|
return 'load'
|
||
|
|
}
|
||
|
|
}
|