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

Function comma

console/static/src/libs/ace-builds/src/worker-javascript.js:4152–4203  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

4150 }
4151
4152 function comma(opts) {
4153 opts = opts || {};
4154
4155 if (!opts.peek) {
4156 nobreakcomma(state.tokens.curr, state.tokens.next);
4157 advance(",");
4158 } else {
4159 nobreakcomma(state.tokens.prev, state.tokens.curr);
4160 }
4161
4162 if (state.tokens.next.identifier && !(opts.property && state.inES5())) {
4163 switch (state.tokens.next.value) {
4164 case "break":
4165 case "case":
4166 case "catch":
4167 case "continue":
4168 case "default":
4169 case "do":
4170 case "else":
4171 case "finally":
4172 case "for":
4173 case "if":
4174 case "in":
4175 case "instanceof":
4176 case "return":
4177 case "switch":
4178 case "throw":
4179 case "try":
4180 case "var":
4181 case "let":
4182 case "while":
4183 case "with":
4184 error("E024", state.tokens.next, state.tokens.next.value);
4185 return false;
4186 }
4187 }
4188
4189 if (state.tokens.next.type === "(punctuator)") {
4190 switch (state.tokens.next.value) {
4191 case "}":
4192 case "]":
4193 case ",":
4194 if (opts.allowTrailing) {
4195 return true;
4196 }
4197 case ")":
4198 error("E024", state.tokens.next, state.tokens.next.value);
4199 return false;
4200 }
4201 }
4202 return true;
4203 }
4204
4205 function symbol(s, p) {
4206 var x = state.syntax[s];

Callers 3

functionparamsFunction · 0.85
blockVariableStatementFunction · 0.85

Calls 3

nobreakcommaFunction · 0.85
advanceFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected