Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/webidl
File: webidl.js
// CodeMirror, copyright (c) by Marijn Haverbeke and others
[0] Fix | Delete
// Distributed under an MIT license: http://codemirror.net/LICENSE
[1] Fix | Delete
[2] Fix | Delete
(function(mod) {
[3] Fix | Delete
if (typeof exports == "object" && typeof module == "object") // CommonJS
[4] Fix | Delete
mod(require("../../lib/codemirror"));
[5] Fix | Delete
else if (typeof define == "function" && define.amd) // AMD
[6] Fix | Delete
define(["../../lib/codemirror"], mod);
[7] Fix | Delete
else // Plain browser env
[8] Fix | Delete
mod(CodeMirror);
[9] Fix | Delete
})(function(CodeMirror) {
[10] Fix | Delete
"use strict";
[11] Fix | Delete
[12] Fix | Delete
function wordRegexp(words) {
[13] Fix | Delete
return new RegExp("^((" + words.join(")|(") + "))\\b");
[14] Fix | Delete
};
[15] Fix | Delete
[16] Fix | Delete
var builtinArray = [
[17] Fix | Delete
"Clamp",
[18] Fix | Delete
"Constructor",
[19] Fix | Delete
"EnforceRange",
[20] Fix | Delete
"Exposed",
[21] Fix | Delete
"ImplicitThis",
[22] Fix | Delete
"Global", "PrimaryGlobal",
[23] Fix | Delete
"LegacyArrayClass",
[24] Fix | Delete
"LegacyUnenumerableNamedProperties",
[25] Fix | Delete
"LenientThis",
[26] Fix | Delete
"NamedConstructor",
[27] Fix | Delete
"NewObject",
[28] Fix | Delete
"NoInterfaceObject",
[29] Fix | Delete
"OverrideBuiltins",
[30] Fix | Delete
"PutForwards",
[31] Fix | Delete
"Replaceable",
[32] Fix | Delete
"SameObject",
[33] Fix | Delete
"TreatNonObjectAsNull",
[34] Fix | Delete
"TreatNullAs",
[35] Fix | Delete
"EmptyString",
[36] Fix | Delete
"Unforgeable",
[37] Fix | Delete
"Unscopeable"
[38] Fix | Delete
];
[39] Fix | Delete
var builtins = wordRegexp(builtinArray);
[40] Fix | Delete
[41] Fix | Delete
var typeArray = [
[42] Fix | Delete
"unsigned", "short", "long", // UnsignedIntegerType
[43] Fix | Delete
"unrestricted", "float", "double", // UnrestrictedFloatType
[44] Fix | Delete
"boolean", "byte", "octet", // Rest of PrimitiveType
[45] Fix | Delete
"Promise", // PromiseType
[46] Fix | Delete
"ArrayBuffer", "DataView", "Int8Array", "Int16Array", "Int32Array",
[47] Fix | Delete
"Uint8Array", "Uint16Array", "Uint32Array", "Uint8ClampedArray",
[48] Fix | Delete
"Float32Array", "Float64Array", // BufferRelatedType
[49] Fix | Delete
"ByteString", "DOMString", "USVString", "sequence", "object", "RegExp",
[50] Fix | Delete
"Error", "DOMException", "FrozenArray", // Rest of NonAnyType
[51] Fix | Delete
"any", // Rest of SingleType
[52] Fix | Delete
"void" // Rest of ReturnType
[53] Fix | Delete
];
[54] Fix | Delete
var types = wordRegexp(typeArray);
[55] Fix | Delete
[56] Fix | Delete
var keywordArray = [
[57] Fix | Delete
"attribute", "callback", "const", "deleter", "dictionary", "enum", "getter",
[58] Fix | Delete
"implements", "inherit", "interface", "iterable", "legacycaller", "maplike",
[59] Fix | Delete
"partial", "required", "serializer", "setlike", "setter", "static",
[60] Fix | Delete
"stringifier", "typedef", // ArgumentNameKeyword except
[61] Fix | Delete
// "unrestricted"
[62] Fix | Delete
"optional", "readonly", "or"
[63] Fix | Delete
];
[64] Fix | Delete
var keywords = wordRegexp(keywordArray);
[65] Fix | Delete
[66] Fix | Delete
var atomArray = [
[67] Fix | Delete
"true", "false", // BooleanLiteral
[68] Fix | Delete
"Infinity", "NaN", // FloatLiteral
[69] Fix | Delete
"null" // Rest of ConstValue
[70] Fix | Delete
];
[71] Fix | Delete
var atoms = wordRegexp(atomArray);
[72] Fix | Delete
[73] Fix | Delete
CodeMirror.registerHelper("hintWords", "webidl",
[74] Fix | Delete
builtinArray.concat(typeArray).concat(keywordArray).concat(atomArray));
[75] Fix | Delete
[76] Fix | Delete
var startDefArray = ["callback", "dictionary", "enum", "interface"];
[77] Fix | Delete
var startDefs = wordRegexp(startDefArray);
[78] Fix | Delete
[79] Fix | Delete
var endDefArray = ["typedef"];
[80] Fix | Delete
var endDefs = wordRegexp(endDefArray);
[81] Fix | Delete
[82] Fix | Delete
var singleOperators = /^[:<=>?]/;
[83] Fix | Delete
var integers = /^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/;
[84] Fix | Delete
var floats = /^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/;
[85] Fix | Delete
var identifiers = /^_?[A-Za-z][0-9A-Z_a-z-]*/;
[86] Fix | Delete
var identifiersEnd = /^_?[A-Za-z][0-9A-Z_a-z-]*(?=\s*;)/;
[87] Fix | Delete
var strings = /^"[^"]*"/;
[88] Fix | Delete
var multilineComments = /^\/\*.*?\*\//;
[89] Fix | Delete
var multilineCommentsStart = /^\/\*.*/;
[90] Fix | Delete
var multilineCommentsEnd = /^.*?\*\//;
[91] Fix | Delete
[92] Fix | Delete
function readToken(stream, state) {
[93] Fix | Delete
// whitespace
[94] Fix | Delete
if (stream.eatSpace()) return null;
[95] Fix | Delete
[96] Fix | Delete
// comment
[97] Fix | Delete
if (state.inComment) {
[98] Fix | Delete
if (stream.match(multilineCommentsEnd)) {
[99] Fix | Delete
state.inComment = false;
[100] Fix | Delete
return "comment";
[101] Fix | Delete
}
[102] Fix | Delete
stream.skipToEnd();
[103] Fix | Delete
return "comment";
[104] Fix | Delete
}
[105] Fix | Delete
if (stream.match("//")) {
[106] Fix | Delete
stream.skipToEnd();
[107] Fix | Delete
return "comment";
[108] Fix | Delete
}
[109] Fix | Delete
if (stream.match(multilineComments)) return "comment";
[110] Fix | Delete
if (stream.match(multilineCommentsStart)) {
[111] Fix | Delete
state.inComment = true;
[112] Fix | Delete
return "comment";
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
// integer and float
[116] Fix | Delete
if (stream.match(/^-?[0-9\.]/, false)) {
[117] Fix | Delete
if (stream.match(integers) || stream.match(floats)) return "number";
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
// string
[121] Fix | Delete
if (stream.match(strings)) return "string";
[122] Fix | Delete
[123] Fix | Delete
// identifier
[124] Fix | Delete
if (state.startDef && stream.match(identifiers)) return "def";
[125] Fix | Delete
[126] Fix | Delete
if (state.endDef && stream.match(identifiersEnd)) {
[127] Fix | Delete
state.endDef = false;
[128] Fix | Delete
return "def";
[129] Fix | Delete
}
[130] Fix | Delete
[131] Fix | Delete
if (stream.match(keywords)) return "keyword";
[132] Fix | Delete
[133] Fix | Delete
if (stream.match(types)) {
[134] Fix | Delete
var lastToken = state.lastToken;
[135] Fix | Delete
var nextToken = (stream.match(/^\s*(.+?)\b/, false) || [])[1];
[136] Fix | Delete
[137] Fix | Delete
if (lastToken === ":" || lastToken === "implements" ||
[138] Fix | Delete
nextToken === "implements" || nextToken === "=") {
[139] Fix | Delete
// Used as identifier
[140] Fix | Delete
return "builtin";
[141] Fix | Delete
} else {
[142] Fix | Delete
// Used as type
[143] Fix | Delete
return "variable-3";
[144] Fix | Delete
}
[145] Fix | Delete
}
[146] Fix | Delete
[147] Fix | Delete
if (stream.match(builtins)) return "builtin";
[148] Fix | Delete
if (stream.match(atoms)) return "atom";
[149] Fix | Delete
if (stream.match(identifiers)) return "variable";
[150] Fix | Delete
[151] Fix | Delete
// other
[152] Fix | Delete
if (stream.match(singleOperators)) return "operator";
[153] Fix | Delete
[154] Fix | Delete
// unrecognized
[155] Fix | Delete
stream.next();
[156] Fix | Delete
return null;
[157] Fix | Delete
};
[158] Fix | Delete
[159] Fix | Delete
CodeMirror.defineMode("webidl", function() {
[160] Fix | Delete
return {
[161] Fix | Delete
startState: function() {
[162] Fix | Delete
return {
[163] Fix | Delete
// Is in multiline comment
[164] Fix | Delete
inComment: false,
[165] Fix | Delete
// Last non-whitespace, matched token
[166] Fix | Delete
lastToken: "",
[167] Fix | Delete
// Next token is a definition
[168] Fix | Delete
startDef: false,
[169] Fix | Delete
// Last token of the statement is a definition
[170] Fix | Delete
endDef: false
[171] Fix | Delete
};
[172] Fix | Delete
},
[173] Fix | Delete
token: function(stream, state) {
[174] Fix | Delete
var style = readToken(stream, state);
[175] Fix | Delete
[176] Fix | Delete
if (style) {
[177] Fix | Delete
var cur = stream.current();
[178] Fix | Delete
state.lastToken = cur;
[179] Fix | Delete
if (style === "keyword") {
[180] Fix | Delete
state.startDef = startDefs.test(cur);
[181] Fix | Delete
state.endDef = state.endDef || endDefs.test(cur);
[182] Fix | Delete
} else {
[183] Fix | Delete
state.startDef = false;
[184] Fix | Delete
}
[185] Fix | Delete
}
[186] Fix | Delete
[187] Fix | Delete
return style;
[188] Fix | Delete
}
[189] Fix | Delete
};
[190] Fix | Delete
});
[191] Fix | Delete
[192] Fix | Delete
CodeMirror.defineMIME("text/x-webidl", "webidl");
[193] Fix | Delete
});
[194] Fix | Delete
[195] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function