MCPcopy
hub / github.com/Unitech/pm2 / array

Function array

lib/tools/json5.js:381–414  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

379 value, // Place holder for the value function.
380
381 array = function () {
382
383// Parse an array value.
384
385 var array = [];
386
387 if (ch === '[') {
388 next('[');
389 white();
390 while (ch) {
391 if (ch === ']') {
392 next(']');
393 return array; // Potentially empty array
394 }
395 // ES5 allows omitting elements in arrays, e.g. [,] and
396 // [,null]. We don't allow this in JSON5.
397 if (ch === ',') {
398 error("Missing array element");
399 } else {
400 array.push(value());
401 }
402 white();
403 // If there's no comma after this value, this needs to
404 // be the end of the array.
405 if (ch !== ',') {
406 next(']');
407 return array;
408 }
409 next(',');
410 white();
411 }
412 }
413 error("Bad array");
414 },
415
416 object = function () {
417

Callers 1

json5.jsFile · 0.85

Calls 3

whiteFunction · 0.85
errorFunction · 0.85
nextFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…