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/protobuf
File: protobuf.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", "i");
[14] Fix | Delete
};
[15] Fix | Delete
[16] Fix | Delete
var keywordArray = [
[17] Fix | Delete
"package", "message", "import", "syntax",
[18] Fix | Delete
"required", "optional", "repeated", "reserved", "default", "extensions", "packed",
[19] Fix | Delete
"bool", "bytes", "double", "enum", "float", "string",
[20] Fix | Delete
"int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64"
[21] Fix | Delete
];
[22] Fix | Delete
var keywords = wordRegexp(keywordArray);
[23] Fix | Delete
[24] Fix | Delete
CodeMirror.registerHelper("hintWords", "protobuf", keywordArray);
[25] Fix | Delete
[26] Fix | Delete
var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*");
[27] Fix | Delete
[28] Fix | Delete
function tokenBase(stream) {
[29] Fix | Delete
// whitespaces
[30] Fix | Delete
if (stream.eatSpace()) return null;
[31] Fix | Delete
[32] Fix | Delete
// Handle one line Comments
[33] Fix | Delete
if (stream.match("//")) {
[34] Fix | Delete
stream.skipToEnd();
[35] Fix | Delete
return "comment";
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
// Handle Number Literals
[39] Fix | Delete
if (stream.match(/^[0-9\.+-]/, false)) {
[40] Fix | Delete
if (stream.match(/^[+-]?0x[0-9a-fA-F]+/))
[41] Fix | Delete
return "number";
[42] Fix | Delete
if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))
[43] Fix | Delete
return "number";
[44] Fix | Delete
if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))
[45] Fix | Delete
return "number";
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
// Handle Strings
[49] Fix | Delete
if (stream.match(/^"([^"]|(""))*"/)) { return "string"; }
[50] Fix | Delete
if (stream.match(/^'([^']|(''))*'/)) { return "string"; }
[51] Fix | Delete
[52] Fix | Delete
// Handle words
[53] Fix | Delete
if (stream.match(keywords)) { return "keyword"; }
[54] Fix | Delete
if (stream.match(identifiers)) { return "variable"; } ;
[55] Fix | Delete
[56] Fix | Delete
// Handle non-detected items
[57] Fix | Delete
stream.next();
[58] Fix | Delete
return null;
[59] Fix | Delete
};
[60] Fix | Delete
[61] Fix | Delete
CodeMirror.defineMode("protobuf", function() {
[62] Fix | Delete
return {token: tokenBase};
[63] Fix | Delete
});
[64] Fix | Delete
[65] Fix | Delete
CodeMirror.defineMIME("text/x-protobuf", "protobuf");
[66] Fix | Delete
});
[67] Fix | Delete
[68] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function