MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / parse_array

Method parse_array

shared/rison.ts:432–447  ·  view source on GitHub ↗
(parser: Parser)

Source from the content-addressed store, hash-verified

430 }
431
432 static parse_array(parser: Parser): JSONValue[] | undefined {
433 const ar: JSONValue[] = [];
434 let c;
435 while ((c = parser.next()) !== ')') {
436 if (!c) return parser.error("unmatched '!('");
437 if (ar.length) {
438 if (c !== ',') parser.error("missing ','");
439 } else if (c === ',') {
440 return parser.error("extra ','");
441 } else --parser.index;
442 const n = parser.readValue();
443 if (n === undefined) return undefined;
444 ar.push(n);
445 }
446 return ar;
447 }
448}

Callers

nothing calls this directly

Calls 4

errorMethod · 0.80
readValueMethod · 0.80
pushMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected