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

Function statement

ServerEditorWeb/ace/worker-javascript.js:3679–3765  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3677 }
3678
3679 function statement() {
3680 var values;
3681 var i = indent, r, s = scope, t = state.tokens.next;
3682
3683 if (t.id === ";") {
3684 advance(";");
3685 return;
3686 }
3687 var res = isReserved(t);
3688
3689 if (res && t.meta && t.meta.isFutureReservedWord && peek().id === ":") {
3690 warning("W024", t, t.id);
3691 res = false;
3692 }
3693 if (t.value === "module" && t.type === "(identifier)") {
3694 if (peek().type === "(identifier)") {
3695 if (!state.option.inESNext()) {
3696 warning("W119", state.tokens.curr, "module");
3697 }
3698
3699 advance("module");
3700 var name = identifier();
3701 addlabel(name, { type: "unused", token: state.tokens.curr });
3702 advance("from");
3703 advance("(string)");
3704 parseFinalSemicolon();
3705 return;
3706 }
3707 }
3708 if (_.has(["[", "{"], t.value)) {
3709 if (lookupBlockType().isDestAssign) {
3710 if (!state.option.inESNext()) {
3711 warning("W104", state.tokens.curr, "destructuring expression");
3712 }
3713 values = destructuringExpression();
3714 values.forEach(function (tok) {
3715 isundef(funct, "W117", tok.token, tok.id);
3716 });
3717 advance("=");
3718 destructuringExpressionMatch(values, expression(10, true));
3719 advance(";");
3720 return;
3721 }
3722 }
3723 if (t.identifier && !res && peek().id === ":") {
3724 advance();
3725 advance(":");
3726 scope = Object.create(s);
3727 addlabel(t.value, { type: "label" });
3728
3729 if (!state.tokens.next.labelled && state.tokens.next.value !== "{") {
3730 warning("W028", state.tokens.next, t.value, state.tokens.next.value);
3731 }
3732
3733 state.tokens.next.label = t.value;
3734 t = state.tokens.next;
3735 }
3736

Callers 3

statementsFunction · 0.85
blockFunction · 0.85

Calls 13

advanceFunction · 0.85
isReservedFunction · 0.85
peekFunction · 0.85
warningFunction · 0.85
identifierFunction · 0.85
addlabelFunction · 0.85
parseFinalSemicolonFunction · 0.85
lookupBlockTypeFunction · 0.85
destructuringExpressionFunction · 0.85
isundefFunction · 0.85
expressionFunction · 0.85

Tested by

no test coverage detected