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

Function doOption

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

Source from the content-addressed store, hash-verified

2736 }
2737
2738 function doOption() {
2739 var nt = state.tokens.next;
2740 var body = nt.body.match(/(-\s+)?[^\s,:]+(?:\s*:\s*(-\s+)?[^\s,]+)?/g) || [];
2741 var predef = {};
2742
2743 if (nt.type === "globals") {
2744 body.forEach(function (g) {
2745 g = g.split(":");
2746 var key = (g[0] || "").trim();
2747 var val = (g[1] || "").trim();
2748
2749 if (key.charAt(0) === "-") {
2750 key = key.slice(1);
2751 val = false;
2752
2753 JSHINT.blacklist[key] = key;
2754 delete predefined[key];
2755 } else {
2756 predef[key] = (val === "true");
2757 }
2758 });
2759
2760 combine(predefined, predef);
2761
2762 for (var key in predef) {
2763 if (_.has(predef, key)) {
2764 declared[key] = nt;
2765 }
2766 }
2767 }
2768
2769 if (nt.type === "exported") {
2770 body.forEach(function (e) {
2771 exported[e] = true;
2772 });
2773 }
2774
2775 if (nt.type === "members") {
2776 membersOnly = membersOnly || {};
2777
2778 body.forEach(function (m) {
2779 var ch1 = m.charAt(0);
2780 var ch2 = m.charAt(m.length - 1);
2781
2782 if (ch1 === ch2 && (ch1 === "\"" || ch1 === "'")) {
2783 m = m
2784 .substr(1, m.length - 2)
2785 .replace("\\\"", "\"");
2786 }
2787
2788 membersOnly[m] = false;
2789 });
2790 }
2791
2792 var numvals = [
2793 "maxstatements",
2794 "maxparams",
2795 "maxdepth",

Callers 1

advanceFunction · 0.85

Calls 5

combineFunction · 0.85
checkOptionFunction · 0.85
removeIgnoredMessagesFunction · 0.85
assumeFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected