MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / expressionInner

Function expressionInner

lib/web/CodeMirror/mode/javascript/javascript.js:426–446  ·  view source on GitHub ↗
(type, value, noComma)

Source from the content-addressed store, hash-verified

424 return cont(pushlex(")"), maybeexpression, expect(")"), poplex)
425 }
426 function expressionInner(type, value, noComma) {
427 if (cx.state.fatArrowAt == cx.stream.start) {
428 var body = noComma ? arrowBodyNoComma : arrowBody;
429 if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
430 else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
431 }
432
433 var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
434 if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
435 if (type == "function") return cont(functiondef, maybeop);
436 if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); }
437 if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression);
438 if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
439 if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
440 if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
441 if (type == "{") return contCommasep(objprop, "}", null, maybeop);
442 if (type == "quasi") return pass(quasi, maybeop);
443 if (type == "new") return cont(maybeTarget(noComma));
444 if (type == "import") return cont(expression);
445 return cont();
446 }
447 function maybeexpression(type) {
448 if (type.match(/[;\}\)\],]/)) return pass();
449 return pass(expression);

Callers 2

expressionFunction · 0.85
expressionNoCommaFunction · 0.85

Calls 7

contCommasepFunction · 0.85
maybeTargetFunction · 0.85
contFunction · 0.70
pushlexFunction · 0.70
commasepFunction · 0.70
expectFunction · 0.70
passFunction · 0.70

Tested by

no test coverage detected