MCPcopy
hub / github.com/DHTMLX/gantt / maybeoperatorNoComma

Function maybeoperatorNoComma

samples/common/codehighlight/javascript.js:459–481  ·  view source on GitHub ↗
(type, value, noComma)

Source from the content-addressed store, hash-verified

457 return maybeoperatorNoComma(type, value, false);
458 }
459 function maybeoperatorNoComma(type, value, noComma) {
460 var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
461 var expr = noComma == false ? expression : expressionNoComma;
462 if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
463 if (type == "operator") {
464 if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
465 if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false))
466 return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
467 if (value == "?") return cont(expression, expect(":"), expr);
468 return cont(expr);
469 }
470 if (type == "quasi") { return pass(quasi, me); }
471 if (type == ";") return;
472 if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
473 if (type == ".") return cont(property, me);
474 if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
475 if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) }
476 if (type == "regexp") {
477 cx.state.lastType = cx.marked = "operator"
478 cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)
479 return cont(expr)
480 }
481 }
482 function quasi(type, value) {
483 if (type != "quasi") return pass();
484 if (value.slice(value.length - 2) != "${") return cont(quasi);

Callers 1

maybeoperatorCommaFunction · 0.85

Calls 6

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

Tested by

no test coverage detected