MCPcopy
hub / github.com/jquerytools/jquerytools / jsonValue

Function jsonValue

lib/jslint.js:341–350  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

339advance();}
340reachable('continue');});stmt('return',function(){nolinebreak(this);if(nexttoken.id!==';'&&!nexttoken.reach){nonadjacent(token,nexttoken);parse(20);}
341reachable('return');});stmt('throw',function(){nolinebreak(this);nonadjacent(token,nexttoken);parse(20);reachable('throw');});reserve('void');reserve('class');reserve('const');reserve('enum');reserve('export');reserve('extends');reserve('goto');reserve('import');reserve('super');function jsonValue(){function jsonObject(){var t=nexttoken;advance('{');if(nexttoken.id!=='}'){for(;;){if(nexttoken.id==='(end)'){error("Missing '}' to match '{' from line {a}.",nexttoken,t.line+1);}else if(nexttoken.id==='}'){warning("Unexpected comma.",token);break;}else if(nexttoken.id===','){error("Unexpected comma.",nexttoken);}else if(nexttoken.id!=='(string)'){warning("Expected a string and instead saw {a}.",nexttoken,nexttoken.value);}
342advance();advance(':');jsonValue();if(nexttoken.id!==','){break;}
343advance(',');}}
344advance('}');}
345function jsonArray(){var t=nexttoken;advance('[');if(nexttoken.id!==']'){for(;;){if(nexttoken.id==='(end)'){error("Missing ']' to match '[' from line {a}.",nexttoken,t.line+1);}else if(nexttoken.id===']'){warning("Unexpected comma.",token);break;}else if(nexttoken.id===','){error("Unexpected comma.",nexttoken);}
346jsonValue();if(nexttoken.id!==','){break;}
347advance(',');}}
348advance(']');}
349switch(nexttoken.id){case'{':jsonObject();break;case'[':jsonArray();break;case'true':case'false':case'null':case'(number)':case'(string)':advance();break;case'-':advance('-');if(token.character!==nexttoken.from){warning("Unexpected space after '-'.",token);}
350adjacent(token,nexttoken);advance('(number)');break;default:error("Expected a JSON value.",nexttoken);}}
351var itself=function(s,o){var a,i;JSLINT.errors=[];predefined=Object.beget(standard);if(o){a=o.predef;if(a instanceof Array){for(i=0;i<a.length;i+=1){predefined[a[i]]=true;}}
352if(o.adsafe){o.browser=false;o.debug=false;o.eqeqeq=true;o.evil=false;o.forin=false;o.glovar=true;o.nomen=true;o.on=false;o.rhino=false;o.sidebar=false;o.undef=true;o.widget=false;predefined.Date=false;predefined['eval']=false;predefined.Function=false;predefined.Object=false;predefined.ADSAFE=true;}
353option=o;}else{option={};}

Callers 3

jsonObjectFunction · 0.85
jsonArrayFunction · 0.85
itselfFunction · 0.85

Calls 6

jsonObjectFunction · 0.85
jsonArrayFunction · 0.85
advanceFunction · 0.85
warningFunction · 0.85
adjacentFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected