(id,t)
| 101 | j+=1;} |
| 102 | return t;} |
| 103 | var badbreak={')':true,']':true,'++':true,'--':true};function advance(id,t){var l;switch(token.id){case'(number)':if(nexttoken.id==='.'){warning("A dot following a number can be confused with a decimal point.",token);} |
| 104 | break;case'-':if(nexttoken.id==='-'||nexttoken.id==='--'){warning("Confusing minusses.");} |
| 105 | break;case'+':if(nexttoken.id==='+'||nexttoken.id==='++'){warning("Confusing plusses.");} |
| 106 | break;} |
| 107 | if(token.type==='(string)'||token.identifier){anonname=token.value;} |
| 108 | if(id&&nexttoken.id!==id){if(t){if(nexttoken.id==='(end)'){warning("Unmatched '{a}'.",t,t.id);}else{warning("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",nexttoken,id,t.id,t.line+1,nexttoken.value);}}else if(nexttoken.type!=='(identifier)'||nexttoken.value!==id){warning("Expected '{a}' and instead saw '{b}'.",nexttoken,id,nexttoken.value);}} |
| 109 | prevtoken=token;token=nexttoken;for(;;){nexttoken=lookahead.shift()||lex.token();if(nexttoken.type==='special'){doOption();}else{if(nexttoken.id==='<!['){if(option.adsafe){error("ADsafe violation.",nexttoken);} |
| 110 | if(xtype==='html'){error("Unexpected '{a}'.",nexttoken,'<![');} |
| 111 | if(xmode==='script'){nexttoken=lex.token();if(nexttoken.value!=='CDATA'){error("Missing '{a}'.",nexttoken,'CDATA');} |
| 112 | nexttoken=lex.token();if(nexttoken.id!=='['){error("Missing '{a}'.",nexttoken,'[');} |
| 113 | xmode='CDATA';}else if(xmode==='xml'){lex.skip(']]>');}else{error("Unexpected '{a}'.",nexttoken,'<![');}}else if(nexttoken.id===']]>'){if(xmode==='CDATA'){xmode='script';}else{error("Unexpected '{a}'.",nexttoken,']]>');}}else if(nexttoken.id!=='(endline)'){break;} |
| 114 | if(xmode==='"'||xmode==="'"){error("Missing '{a}'.",token,xmode);} |
| 115 | l=!xmode&&!option.laxbreak&&(token.type==='(string)'||token.type==='(number)'||token.type==='(identifier)'||badbreak[token.id]);}} |
| 116 | if(l){switch(nexttoken.id){case'{':case'}':case']':case'.':break;case')':switch(token.id){case')':case'}':case']':break;default:warning("Line breaking error '{a}'.",token,')');} |
| 117 | break;default:warning("Line breaking error '{a}'.",token,token.value);}} |
| 118 | if(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;}}} |
| 119 | function parse(rbp,initial){var left,o;if(nexttoken.id==='(end)'){error("Unexpected early end of program.",token);} |
| 120 | advance();if(option.adsafe&&predefined[token.value]===true&&(nexttoken.id!=='('&&nexttoken.id!=='.')){warning('ADsafe violation.',token);} |
| 121 | if(initial){anonname='anonymous';funct['(verb)']=token.value;} |
no test coverage detected