MCPcopy
hub / github.com/eolinker/goku_lite / advance

Function advance

console/static/src/libs/ace-builds/src/worker-javascript.js:3955–4016  ·  view source on GitHub ↗
(id, t)

Source from the content-addressed store, hash-verified

3953 }
3954
3955 function advance(id, t) {
3956
3957 switch (state.tokens.curr.id) {
3958 case "(number)":
3959 if (state.tokens.next.id === ".") {
3960 warning("W005", state.tokens.curr);
3961 }
3962 break;
3963 case "-":
3964 if (state.tokens.next.id === "-" || state.tokens.next.id === "--") {
3965 warning("W006");
3966 }
3967 break;
3968 case "+":
3969 if (state.tokens.next.id === "+" || state.tokens.next.id === "++") {
3970 warning("W007");
3971 }
3972 break;
3973 }
3974
3975 if (id && state.tokens.next.id !== id) {
3976 if (t) {
3977 if (state.tokens.next.id === "(end)") {
3978 error("E019", t, t.id);
3979 } else {
3980 error("E020", state.tokens.next, id, t.id, t.line, state.tokens.next.value);
3981 }
3982 } else if (state.tokens.next.type !== "(identifier)" || state.tokens.next.value !== id) {
3983 warning("W116", state.tokens.next, id, state.tokens.next.value);
3984 }
3985 }
3986
3987 state.tokens.prev = state.tokens.curr;
3988 state.tokens.curr = state.tokens.next;
3989 for (;;) {
3990 state.tokens.next = lookahead.shift() || lex.token();
3991
3992 if (!state.tokens.next) { // No more tokens left, give up
3993 quit("E041", state.tokens.curr.line);
3994 }
3995
3996 if (state.tokens.next.id === "(end)" || state.tokens.next.id === "(error)") {
3997 return;
3998 }
3999
4000 if (state.tokens.next.check) {
4001 state.tokens.next.check();
4002 }
4003
4004 if (state.tokens.next.isSpecial) {
4005 if (state.tokens.next.type === "falls through") {
4006 state.tokens.curr.caseFallsThrough = true;
4007 } else {
4008 doOption();
4009 }
4010 } else {
4011 if (state.tokens.next.id !== "(endline)") {
4012 break;

Callers 15

expressionFunction · 0.85
commaFunction · 0.85
optionalidentifierFunction · 0.85
identifierFunction · 0.85
parseFinalSemicolonFunction · 0.85
statementFunction · 0.85
statementsFunction · 0.85
directivesFunction · 0.85
blockFunction · 0.85
propertyNameFunction · 0.85

Calls 5

warningFunction · 0.85
errorFunction · 0.85
quitFunction · 0.85
doOptionFunction · 0.85
checkMethod · 0.45

Tested by

no test coverage detected