MCPcopy Index your code
hub / github.com/dchester/jsonpath / parseArrayInitialiser

Function parseArrayInitialiser

jsonpath.js:1998–2020  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1996 // 11.1.4 Array Initialiser
1997
1998 function parseArrayInitialiser() {
1999 var elements = [], startToken;
2000
2001 startToken = lookahead;
2002 expect('[');
2003
2004 while (!match(']')) {
2005 if (match(',')) {
2006 lex();
2007 elements.push(null);
2008 } else {
2009 elements.push(parseAssignmentExpression());
2010
2011 if (!match(']')) {
2012 expect(',');
2013 }
2014 }
2015 }
2016
2017 lex();
2018
2019 return delegate.markEnd(delegate.createArrayExpression(elements), startToken);
2020 }
2021
2022 // 11.1.5 Object Initialiser
2023

Callers 1

parsePrimaryExpressionFunction · 0.85

Calls 4

expectFunction · 0.85
matchFunction · 0.85
lexFunction · 0.70

Tested by

no test coverage detected