MCPcopy Create free account
hub / github.com/TextGeneratorio/text-generator.io / maybeoperatorNoComma

Function maybeoperatorNoComma

static/libs/javascript.js:460–482  ·  view source on GitHub ↗
(type, value, noComma)

Source from the content-addressed store, hash-verified

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

Tested by

no test coverage detected