MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / parseCall

Method parseCall

packages/core/src/constraints/parser.ts:208–230  ·  view source on GitHub ↗
(name: string, namePosition: number)

Source from the content-addressed store, hash-verified

206 }
207
208 private parseCall(name: string, namePosition: number): ExprNode {
209 if (!isKnownConstraintFunctionName(name)) {
210 this.fail(`Unknown function "${name}"`, namePosition);
211 }
212 this.expect("(");
213 if (name === "steps") return this.parseStepsCall(name);
214
215 const args: ExprNode[] = [];
216 this.skipWhitespace();
217 if (this.consumeIf(")")) {
218 return { kind: "call", name, args: Object.freeze(args) };
219 }
220
221 while (true) {
222 args.push(this.parseExpr());
223 this.skipWhitespace();
224 if (this.consumeIf(",")) continue;
225 if (this.consumeIf(")")) break;
226 this.fail('Expected "," or ")" in function call');
227 }
228
229 return { kind: "call", name, args: Object.freeze(args) };
230 }
231
232 private parseStepsCall(name: string): ExprNode {
233 const args: ExprNode[] = [];

Callers 1

parseNamedAtomMethod · 0.95

Calls 8

failMethod · 0.95
expectMethod · 0.95
parseStepsCallMethod · 0.95
skipWhitespaceMethod · 0.95
consumeIfMethod · 0.95
parseExprMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected