MCPcopy Index your code
hub / github.com/Macuyiko/minecraft-python / expression

Function expression

ServerEditorWeb/ace/worker-javascript.js:3063–3153  ·  view source on GitHub ↗
(rbp, initial)

Source from the content-addressed store, hash-verified

3061 }
3062
3063 function expression(rbp, initial) {
3064 var left, isArray = false, isObject = false, isLetExpr = false,
3065 isFatArrowBody = state.tokens.curr.value === "=>";
3066
3067 state.nameStack.push();
3068 if (!initial && state.tokens.next.value === "let" && peek(0).value === "(") {
3069 if (!state.option.inMoz(true)) {
3070 warning("W118", state.tokens.next, "let expressions");
3071 }
3072 isLetExpr = true;
3073 funct["(blockscope)"].stack();
3074 advance("let");
3075 advance("(");
3076 state.syntax["let"].fud.call(state.syntax["let"].fud, false);
3077 advance(")");
3078 }
3079
3080 if (state.tokens.next.id === "(end)")
3081 error("E006", state.tokens.curr);
3082
3083 if (state.tokens.next.type === "(template)") {
3084 doTemplateLiteral();
3085 }
3086
3087 var isDangerous =
3088 state.option.asi &&
3089 state.tokens.prev.line < state.tokens.curr.line &&
3090 _.contains(["]", ")"], state.tokens.prev.id) &&
3091 _.contains(["[", "("], state.tokens.curr.id);
3092
3093 if (isDangerous)
3094 warning("W014", state.tokens.curr, state.tokens.curr.id);
3095
3096 advance();
3097
3098 if (initial) {
3099 funct["(verb)"] = state.tokens.curr.value;
3100 }
3101
3102 if (initial === true && state.tokens.curr.fud) {
3103 left = state.tokens.curr.fud();
3104 } else {
3105 if (state.tokens.curr.nud) {
3106 left = state.tokens.curr.nud();
3107 } else {
3108 error("E030", state.tokens.curr, state.tokens.curr.id);
3109 }
3110
3111 while (rbp < state.tokens.next.lbp && !isEndOfExpr()) {
3112 isArray = state.tokens.curr.value === "Array";
3113 isObject = state.tokens.curr.value === "Object";
3114 if (left && (left.value || (left.first && left.first.value))) {
3115 if (left.value !== "new" ||
3116 (left.first && left.first.value && left.first.value === ".")) {
3117 isArray = false;
3118 if (left.value !== state.tokens.curr.value) {
3119 isObject = false;
3120 }

Callers 15

prefixFunction · 0.85
infixFunction · 0.85
relationFunction · 0.85
assignopFunction · 0.85
bitwiseFunction · 0.85
bitwiseassignopFunction · 0.85
statementFunction · 0.85
blockFunction · 0.85
functionparamsFunction · 0.85
doTemplateLiteralFunction · 0.85

Calls 6

peekFunction · 0.85
warningFunction · 0.85
advanceFunction · 0.85
doTemplateLiteralFunction · 0.85
isEndOfExprFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected