MCPcopy
hub / github.com/SilentVoid13/Templater / expressionInner

Function expressionInner

src/editor/mode/javascript.js:660–708  ·  view source on GitHub ↗
(type, value, noComma)

Source from the content-addressed store, hash-verified

658 return cont(pushlex(")"), maybeexpression, expect(")"), poplex);
659 }
660 function expressionInner(type, value, noComma) {
661 if (cx.state.fatArrowAt == cx.stream.start) {
662 var body = noComma ? arrowBodyNoComma : arrowBody;
663 if (type == "(")
664 return cont(
665 pushcontext,
666 pushlex(")"),
667 commasep(funarg, ")"),
668 poplex,
669 expect("=>"),
670 body,
671 popcontext
672 );
673 else if (type == "variable")
674 return pass(
675 pushcontext,
676 pattern,
677 expect("=>"),
678 body,
679 popcontext
680 );
681 }
682
683 var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
684 if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
685 if (type == "function") return cont(functiondef, maybeop);
686 if (type == "class" || (isTS && value == "interface")) {
687 cx.marked = "keyword";
688 return cont(pushlex("form"), classExpression, poplex);
689 }
690 if (type == "keyword c" || type == "async")
691 return cont(noComma ? expressionNoComma : expression);
692 if (type == "(")
693 return cont(
694 pushlex(")"),
695 maybeexpression,
696 expect(")"),
697 poplex,
698 maybeop
699 );
700 if (type == "operator" || type == "spread")
701 return cont(noComma ? expressionNoComma : expression);
702 if (type == "[")
703 return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
704 if (type == "{") return contCommasep(objprop, "}", null, maybeop);
705 if (type == "quasi") return pass(quasi, maybeop);
706 if (type == "new") return cont(maybeTarget(noComma));
707 return cont();
708 }
709 function maybeexpression(type) {
710 if (type.match(/[;\}\)\],]/)) return pass();
711 return pass(expression);

Callers 2

expressionFunction · 0.85
expressionNoCommaFunction · 0.85

Calls 7

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

Tested by

no test coverage detected