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/r
File: r.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
CodeMirror.registerHelper("wordChars", "r", /[\w.]/);
[13] Fix | Delete
[14] Fix | Delete
CodeMirror.defineMode("r", function(config) {
[15] Fix | Delete
function wordObj(str) {
[16] Fix | Delete
var words = str.split(" "), res = {};
[17] Fix | Delete
for (var i = 0; i < words.length; ++i) res[words[i]] = true;
[18] Fix | Delete
return res;
[19] Fix | Delete
}
[20] Fix | Delete
var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_");
[21] Fix | Delete
var builtins = wordObj("list quote bquote eval return call parse deparse");
[22] Fix | Delete
var keywords = wordObj("if else repeat while function for in next break");
[23] Fix | Delete
var blockkeywords = wordObj("if else repeat while function for");
[24] Fix | Delete
var opChars = /[+\-*\/^<>=!&|~$:]/;
[25] Fix | Delete
var curPunc;
[26] Fix | Delete
[27] Fix | Delete
function tokenBase(stream, state) {
[28] Fix | Delete
curPunc = null;
[29] Fix | Delete
var ch = stream.next();
[30] Fix | Delete
if (ch == "#") {
[31] Fix | Delete
stream.skipToEnd();
[32] Fix | Delete
return "comment";
[33] Fix | Delete
} else if (ch == "0" && stream.eat("x")) {
[34] Fix | Delete
stream.eatWhile(/[\da-f]/i);
[35] Fix | Delete
return "number";
[36] Fix | Delete
} else if (ch == "." && stream.eat(/\d/)) {
[37] Fix | Delete
stream.match(/\d*(?:e[+\-]?\d+)?/);
[38] Fix | Delete
return "number";
[39] Fix | Delete
} else if (/\d/.test(ch)) {
[40] Fix | Delete
stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/);
[41] Fix | Delete
return "number";
[42] Fix | Delete
} else if (ch == "'" || ch == '"') {
[43] Fix | Delete
state.tokenize = tokenString(ch);
[44] Fix | Delete
return "string";
[45] Fix | Delete
} else if (ch == "." && stream.match(/.[.\d]+/)) {
[46] Fix | Delete
return "keyword";
[47] Fix | Delete
} else if (/[\w\.]/.test(ch) && ch != "_") {
[48] Fix | Delete
stream.eatWhile(/[\w\.]/);
[49] Fix | Delete
var word = stream.current();
[50] Fix | Delete
if (atoms.propertyIsEnumerable(word)) return "atom";
[51] Fix | Delete
if (keywords.propertyIsEnumerable(word)) {
[52] Fix | Delete
// Block keywords start new blocks, except 'else if', which only starts
[53] Fix | Delete
// one new block for the 'if', no block for the 'else'.
[54] Fix | Delete
if (blockkeywords.propertyIsEnumerable(word) &&
[55] Fix | Delete
!stream.match(/\s*if(\s+|$)/, false))
[56] Fix | Delete
curPunc = "block";
[57] Fix | Delete
return "keyword";
[58] Fix | Delete
}
[59] Fix | Delete
if (builtins.propertyIsEnumerable(word)) return "builtin";
[60] Fix | Delete
return "variable";
[61] Fix | Delete
} else if (ch == "%") {
[62] Fix | Delete
if (stream.skipTo("%")) stream.next();
[63] Fix | Delete
return "variable-2";
[64] Fix | Delete
} else if (ch == "<" && stream.eat("-")) {
[65] Fix | Delete
return "arrow";
[66] Fix | Delete
} else if (ch == "=" && state.ctx.argList) {
[67] Fix | Delete
return "arg-is";
[68] Fix | Delete
} else if (opChars.test(ch)) {
[69] Fix | Delete
if (ch == "$") return "dollar";
[70] Fix | Delete
stream.eatWhile(opChars);
[71] Fix | Delete
return "operator";
[72] Fix | Delete
} else if (/[\(\){}\[\];]/.test(ch)) {
[73] Fix | Delete
curPunc = ch;
[74] Fix | Delete
if (ch == ";") return "semi";
[75] Fix | Delete
return null;
[76] Fix | Delete
} else {
[77] Fix | Delete
return null;
[78] Fix | Delete
}
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
function tokenString(quote) {
[82] Fix | Delete
return function(stream, state) {
[83] Fix | Delete
if (stream.eat("\\")) {
[84] Fix | Delete
var ch = stream.next();
[85] Fix | Delete
if (ch == "x") stream.match(/^[a-f0-9]{2}/i);
[86] Fix | Delete
else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next();
[87] Fix | Delete
else if (ch == "u") stream.match(/^[a-f0-9]{4}/i);
[88] Fix | Delete
else if (ch == "U") stream.match(/^[a-f0-9]{8}/i);
[89] Fix | Delete
else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/);
[90] Fix | Delete
return "string-2";
[91] Fix | Delete
} else {
[92] Fix | Delete
var next;
[93] Fix | Delete
while ((next = stream.next()) != null) {
[94] Fix | Delete
if (next == quote) { state.tokenize = tokenBase; break; }
[95] Fix | Delete
if (next == "\\") { stream.backUp(1); break; }
[96] Fix | Delete
}
[97] Fix | Delete
return "string";
[98] Fix | Delete
}
[99] Fix | Delete
};
[100] Fix | Delete
}
[101] Fix | Delete
[102] Fix | Delete
function push(state, type, stream) {
[103] Fix | Delete
state.ctx = {type: type,
[104] Fix | Delete
indent: state.indent,
[105] Fix | Delete
align: null,
[106] Fix | Delete
column: stream.column(),
[107] Fix | Delete
prev: state.ctx};
[108] Fix | Delete
}
[109] Fix | Delete
function pop(state) {
[110] Fix | Delete
state.indent = state.ctx.indent;
[111] Fix | Delete
state.ctx = state.ctx.prev;
[112] Fix | Delete
}
[113] Fix | Delete
[114] Fix | Delete
return {
[115] Fix | Delete
startState: function() {
[116] Fix | Delete
return {tokenize: tokenBase,
[117] Fix | Delete
ctx: {type: "top",
[118] Fix | Delete
indent: -config.indentUnit,
[119] Fix | Delete
align: false},
[120] Fix | Delete
indent: 0,
[121] Fix | Delete
afterIdent: false};
[122] Fix | Delete
},
[123] Fix | Delete
[124] Fix | Delete
token: function(stream, state) {
[125] Fix | Delete
if (stream.sol()) {
[126] Fix | Delete
if (state.ctx.align == null) state.ctx.align = false;
[127] Fix | Delete
state.indent = stream.indentation();
[128] Fix | Delete
}
[129] Fix | Delete
if (stream.eatSpace()) return null;
[130] Fix | Delete
var style = state.tokenize(stream, state);
[131] Fix | Delete
if (style != "comment" && state.ctx.align == null) state.ctx.align = true;
[132] Fix | Delete
[133] Fix | Delete
var ctype = state.ctx.type;
[134] Fix | Delete
if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state);
[135] Fix | Delete
if (curPunc == "{") push(state, "}", stream);
[136] Fix | Delete
else if (curPunc == "(") {
[137] Fix | Delete
push(state, ")", stream);
[138] Fix | Delete
if (state.afterIdent) state.ctx.argList = true;
[139] Fix | Delete
}
[140] Fix | Delete
else if (curPunc == "[") push(state, "]", stream);
[141] Fix | Delete
else if (curPunc == "block") push(state, "block", stream);
[142] Fix | Delete
else if (curPunc == ctype) pop(state);
[143] Fix | Delete
state.afterIdent = style == "variable" || style == "keyword";
[144] Fix | Delete
return style;
[145] Fix | Delete
},
[146] Fix | Delete
[147] Fix | Delete
indent: function(state, textAfter) {
[148] Fix | Delete
if (state.tokenize != tokenBase) return 0;
[149] Fix | Delete
var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx,
[150] Fix | Delete
closing = firstChar == ctx.type;
[151] Fix | Delete
if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit);
[152] Fix | Delete
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
[153] Fix | Delete
else return ctx.indent + (closing ? 0 : config.indentUnit);
[154] Fix | Delete
},
[155] Fix | Delete
[156] Fix | Delete
lineComment: "#"
[157] Fix | Delete
};
[158] Fix | Delete
});
[159] Fix | Delete
[160] Fix | Delete
CodeMirror.defineMIME("text/x-rsrc", "r");
[161] Fix | Delete
[162] Fix | Delete
});
[163] Fix | Delete
[164] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function