Start reimplementation in typescript
This commit is contained in:
16
src/vm/commands/load.ts
Normal file
16
src/vm/commands/load.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user