Add & register more basic commands

This commit is contained in:
2025-11-11 21:37:32 -06:00
parent c437958406
commit bfc9459b69
27 changed files with 514 additions and 3 deletions

View File

@@ -0,0 +1,24 @@
import {Command, ParseContext, StrTerm} from "./command.js";
import {LexInput} from "../lexer.js";
export type EncloseData = {
left?: StrTerm,
right?: StrTerm,
}
export class Enclose extends Command<EncloseData> {
attemptParse(context: ParseContext): EncloseData {
return {
left: context.popOptionalTerm(),
right: context.popOptionalTerm(),
}
}
getDisplayName(): string {
return 'enclose'
}
isParseCandidate(token: LexInput): boolean {
return this.isKeyword(token, 'enclose')
}
}