MCPcopy
hub / github.com/jquerytools/jquerytools / statements

Function statements

lib/jslint.js:179–187  ·  view source on GitHub ↗
(begin)

Source from the content-addressed store, hash-verified

177r=parse(0,true);if(!t.block){if(nexttoken.id!==';'){warningAt("Missing semicolon.",token.line,token.from+token.value.length);}else{adjacent(token,nexttoken);advance(';');nonadjacent(token,nexttoken);}}
178indent=i;scope=s;return r;}
179function statements(begin){var a=[];if(begin){if(option.adsafe&&nexttoken.type!=='(string)'){warning('ADsafe violation: Missing "use strict" statement.',nexttoken);}
180if(nexttoken.type==='(string)'&&nexttoken.value.slice(0,10)==='use strict'){advance();advance(';');}}
181if(option.adsafe){switch(begin){case'script':if(!adsafe_may){if(nexttoken.value!=='ADSAFE'||peek(0).id!=='.'||(peek(1).value!=='id'&&peek(1).value!=='go')){error('ADsafe violation: Missing ADSAFE.id or ADSAFE.go.',nexttoken);}}
182if(nexttoken.value==='ADSAFE'&&peek(0).id==='.'&&peek(1).value==='id'){if(adsafe_may){error('ADsafe violation.',nexttoken);}
183advance('ADSAFE');advance('.');advance('id');advance('(');if(nexttoken.value!==adsafe_id){error('ADsafe violation: id does not match.',nexttoken);}
184advance('(string)');advance(')');advance(';');adsafe_may=true;}
185break;case'lib':if(nexttoken.value==='ADSAFE'){advance('ADSAFE');advance('.');advance('lib');advance('(');advance('(string)');advance(',');parse(0);advance(')');advance(';');return a;}else{error("ADsafe lib violation.");}}}
186while(!nexttoken.reach&&nexttoken.id!=='(end)'){if(nexttoken.id===';'){warning("Unnecessary semicolon.");advance(';');}else{a.push(statement());}}
187return a;}
188function block(f){var a,b=inblock,s=scope;inblock=f;if(f){scope=Object.beget(scope);}
189nonadjacent(token,nexttoken);var t=nexttoken;if(nexttoken.id==='{'){advance('{');if(nexttoken.id!=='}'||token.line!==nexttoken.line){indent+=option.indent;if(!f&&nexttoken.from===indent+option.indent){indent+=option.indent;}
190a=statements();indent-=option.indent;indentation();}

Callers 4

blockFunction · 0.85
xmlFunction · 0.85
jslint.jsFile · 0.85
itselfFunction · 0.85

Calls 6

warningFunction · 0.85
advanceFunction · 0.85
peekFunction · 0.85
errorFunction · 0.85
parseFunction · 0.85
statementFunction · 0.85

Tested by

no test coverage detected