MCPcopy Create free account
hub / github.com/openai/plugins / optionalMany

Method optionalMany

plugins/shopify/skills/shopify-admin/scripts/validate.mjs:3176–3185  ·  view source on GitHub ↗

* Returns a list of parse nodes, determined by the parseFn. * It can be empty only if open token is missing otherwise it will always return non-empty list * that begins with a lex token of openKind and ends with a lex token of closeKind. * Advances the parser to the next lex tok

(openKind, parseFn, closeKind)

Source from the content-addressed store, hash-verified

3174 * Advances the parser to the next lex token after the closing token.
3175 */
3176 optionalMany(openKind, parseFn, closeKind) {
3177 if (this.expectOptionalToken(openKind)) {
3178 const nodes = [];
3179 do {
3180 nodes.push(parseFn.call(this));
3181 } while (!this.expectOptionalToken(closeKind));
3182 return nodes;
3183 }
3184 return [];
3185 }
3186 /**
3187 * Returns a non-empty list of parse nodes, determined by the parseFn.
3188 * This list begins with a lex token of openKind and ends with a lex token of closeKind.

Callers 7

parseArgumentsMethod · 0.45
parseFieldsDefinitionMethod · 0.45
parseArgumentDefsMethod · 0.45
parseSchemaExtensionMethod · 0.45

Calls 1

expectOptionalTokenMethod · 0.45

Tested by

no test coverage detected