MCPcopy
hub / github.com/jquerytools/jquerytools / parse

Function parse

lib/jslint.js:119–126  ·  view source on GitHub ↗
(rbp,initial)

Source from the content-addressed store, hash-verified

117break;default:warning("Line breaking error '{a}'.",token,token.value);}}
118if(xtype==='widget'&&xmode==='script'&&nexttoken.id){l=nexttoken.id.charAt(0);if(l==='<'||l==='&'){nexttoken.nud=nexttoken.led=null;nexttoken.lbp=0;nexttoken.reach=true;}}}
119function parse(rbp,initial){var left,o;if(nexttoken.id==='(end)'){error("Unexpected early end of program.",token);}
120advance();if(option.adsafe&&predefined[token.value]===true&&(nexttoken.id!=='('&&nexttoken.id!=='.')){warning('ADsafe violation.',token);}
121if(initial){anonname='anonymous';funct['(verb)']=token.value;}
122if(initial===true&&token.fud){left=token.fud();}else{if(token.nud){o=token.exps;left=token.nud();}else{if(nexttoken.type==='(number)'&&token.id==='.'){warning("A leading decimal point can be confused with a dot: '.{a}'.",token,nexttoken.value);advance();return token;}else{error("Expected an identifier and instead saw '{a}'.",token,token.id);}}
123while(rbp<nexttoken.lbp){o=nexttoken.exps;advance();if(token.led){left=token.led(left);}else{error("Expected an operator and instead saw '{a}'.",token,token.id);}}
124if(initial&&!o){warning("Expected an assignment or function call and instead saw an expression.",token);}}
125if(!option.evil&&left&&left.value==='eval'){warning("eval is evil.",left);}
126return left;}
127function adjacent(left,right){left=left||token;right=right||nexttoken;if(option.white){if(left.character!==right.from&&left.line===right.line){warning("Unexpected space after '{a}'.",nexttoken,left.value);}}}
128function nospace(left,right){left=left||token;right=right||nexttoken;if(option.white&&!left.comment){if(left.line===right.line){adjacent(left,right);}}}
129function nonadjacent(left,right){left=left||token;right=right||nexttoken;if(option.white){if(left.character===right.from){warning("Missing space after '{a}'.",nexttoken,left.value);}}}

Callers 10

prefixFunction · 0.85
infixFunction · 0.85
relationFunction · 0.85
assignopFunction · 0.85
bitwiseFunction · 0.85
bitwiseassignopFunction · 0.85
statementFunction · 0.85
statementsFunction · 0.85
jslint.jsFile · 0.85
varstatementFunction · 0.85

Calls 3

errorFunction · 0.85
advanceFunction · 0.85
warningFunction · 0.85

Tested by

no test coverage detected