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/pegjs
File: pegjs.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"), require("../javascript/javascript"));
[5] Fix | Delete
else if (typeof define == "function" && define.amd) // AMD
[6] Fix | Delete
define(["../../lib/codemirror", "../javascript/javascript"], 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
CodeMirror.defineMode("pegjs", function (config) {
[13] Fix | Delete
var jsMode = CodeMirror.getMode(config, "javascript");
[14] Fix | Delete
[15] Fix | Delete
function identifier(stream) {
[16] Fix | Delete
return stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
return {
[20] Fix | Delete
startState: function () {
[21] Fix | Delete
return {
[22] Fix | Delete
inString: false,
[23] Fix | Delete
stringType: null,
[24] Fix | Delete
inComment: false,
[25] Fix | Delete
inCharacterClass: false,
[26] Fix | Delete
braced: 0,
[27] Fix | Delete
lhs: true,
[28] Fix | Delete
localState: null
[29] Fix | Delete
};
[30] Fix | Delete
},
[31] Fix | Delete
token: function (stream, state) {
[32] Fix | Delete
if (stream)
[33] Fix | Delete
[34] Fix | Delete
//check for state changes
[35] Fix | Delete
if (!state.inString && !state.inComment && ((stream.peek() == '"') || (stream.peek() == "'"))) {
[36] Fix | Delete
state.stringType = stream.peek();
[37] Fix | Delete
stream.next(); // Skip quote
[38] Fix | Delete
state.inString = true; // Update state
[39] Fix | Delete
}
[40] Fix | Delete
if (!state.inString && !state.inComment && stream.match(/^\/\*/)) {
[41] Fix | Delete
state.inComment = true;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
//return state
[45] Fix | Delete
if (state.inString) {
[46] Fix | Delete
while (state.inString && !stream.eol()) {
[47] Fix | Delete
if (stream.peek() === state.stringType) {
[48] Fix | Delete
stream.next(); // Skip quote
[49] Fix | Delete
state.inString = false; // Clear flag
[50] Fix | Delete
} else if (stream.peek() === '\\') {
[51] Fix | Delete
stream.next();
[52] Fix | Delete
stream.next();
[53] Fix | Delete
} else {
[54] Fix | Delete
stream.match(/^.[^\\\"\']*/);
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
return state.lhs ? "property string" : "string"; // Token style
[58] Fix | Delete
} else if (state.inComment) {
[59] Fix | Delete
while (state.inComment && !stream.eol()) {
[60] Fix | Delete
if (stream.match(/\*\//)) {
[61] Fix | Delete
state.inComment = false; // Clear flag
[62] Fix | Delete
} else {
[63] Fix | Delete
stream.match(/^.[^\*]*/);
[64] Fix | Delete
}
[65] Fix | Delete
}
[66] Fix | Delete
return "comment";
[67] Fix | Delete
} else if (state.inCharacterClass) {
[68] Fix | Delete
while (state.inCharacterClass && !stream.eol()) {
[69] Fix | Delete
if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) {
[70] Fix | Delete
state.inCharacterClass = false;
[71] Fix | Delete
}
[72] Fix | Delete
}
[73] Fix | Delete
} else if (stream.peek() === '[') {
[74] Fix | Delete
stream.next();
[75] Fix | Delete
state.inCharacterClass = true;
[76] Fix | Delete
return 'bracket';
[77] Fix | Delete
} else if (stream.match(/^\/\//)) {
[78] Fix | Delete
stream.skipToEnd();
[79] Fix | Delete
return "comment";
[80] Fix | Delete
} else if (state.braced || stream.peek() === '{') {
[81] Fix | Delete
if (state.localState === null) {
[82] Fix | Delete
state.localState = CodeMirror.startState(jsMode);
[83] Fix | Delete
}
[84] Fix | Delete
var token = jsMode.token(stream, state.localState);
[85] Fix | Delete
var text = stream.current();
[86] Fix | Delete
if (!token) {
[87] Fix | Delete
for (var i = 0; i < text.length; i++) {
[88] Fix | Delete
if (text[i] === '{') {
[89] Fix | Delete
state.braced++;
[90] Fix | Delete
} else if (text[i] === '}') {
[91] Fix | Delete
state.braced--;
[92] Fix | Delete
}
[93] Fix | Delete
};
[94] Fix | Delete
}
[95] Fix | Delete
return token;
[96] Fix | Delete
} else if (identifier(stream)) {
[97] Fix | Delete
if (stream.peek() === ':') {
[98] Fix | Delete
return 'variable';
[99] Fix | Delete
}
[100] Fix | Delete
return 'variable-2';
[101] Fix | Delete
} else if (['[', ']', '(', ')'].indexOf(stream.peek()) != -1) {
[102] Fix | Delete
stream.next();
[103] Fix | Delete
return 'bracket';
[104] Fix | Delete
} else if (!stream.eatSpace()) {
[105] Fix | Delete
stream.next();
[106] Fix | Delete
}
[107] Fix | Delete
return null;
[108] Fix | Delete
}
[109] Fix | Delete
};
[110] Fix | Delete
}, "javascript");
[111] Fix | Delete
[112] Fix | Delete
});
[113] Fix | Delete
[114] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function