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/d
File: d.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.defineMode("d", function(config, parserConfig) {
[13] Fix | Delete
var indentUnit = config.indentUnit,
[14] Fix | Delete
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
[15] Fix | Delete
keywords = parserConfig.keywords || {},
[16] Fix | Delete
builtin = parserConfig.builtin || {},
[17] Fix | Delete
blockKeywords = parserConfig.blockKeywords || {},
[18] Fix | Delete
atoms = parserConfig.atoms || {},
[19] Fix | Delete
hooks = parserConfig.hooks || {},
[20] Fix | Delete
multiLineStrings = parserConfig.multiLineStrings;
[21] Fix | Delete
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
[22] Fix | Delete
[23] Fix | Delete
var curPunc;
[24] Fix | Delete
[25] Fix | Delete
function tokenBase(stream, state) {
[26] Fix | Delete
var ch = stream.next();
[27] Fix | Delete
if (hooks[ch]) {
[28] Fix | Delete
var result = hooks[ch](stream, state);
[29] Fix | Delete
if (result !== false) return result;
[30] Fix | Delete
}
[31] Fix | Delete
if (ch == '"' || ch == "'" || ch == "`") {
[32] Fix | Delete
state.tokenize = tokenString(ch);
[33] Fix | Delete
return state.tokenize(stream, state);
[34] Fix | Delete
}
[35] Fix | Delete
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
[36] Fix | Delete
curPunc = ch;
[37] Fix | Delete
return null;
[38] Fix | Delete
}
[39] Fix | Delete
if (/\d/.test(ch)) {
[40] Fix | Delete
stream.eatWhile(/[\w\.]/);
[41] Fix | Delete
return "number";
[42] Fix | Delete
}
[43] Fix | Delete
if (ch == "/") {
[44] Fix | Delete
if (stream.eat("+")) {
[45] Fix | Delete
state.tokenize = tokenComment;
[46] Fix | Delete
return tokenNestedComment(stream, state);
[47] Fix | Delete
}
[48] Fix | Delete
if (stream.eat("*")) {
[49] Fix | Delete
state.tokenize = tokenComment;
[50] Fix | Delete
return tokenComment(stream, state);
[51] Fix | Delete
}
[52] Fix | Delete
if (stream.eat("/")) {
[53] Fix | Delete
stream.skipToEnd();
[54] Fix | Delete
return "comment";
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
if (isOperatorChar.test(ch)) {
[58] Fix | Delete
stream.eatWhile(isOperatorChar);
[59] Fix | Delete
return "operator";
[60] Fix | Delete
}
[61] Fix | Delete
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
[62] Fix | Delete
var cur = stream.current();
[63] Fix | Delete
if (keywords.propertyIsEnumerable(cur)) {
[64] Fix | Delete
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
[65] Fix | Delete
return "keyword";
[66] Fix | Delete
}
[67] Fix | Delete
if (builtin.propertyIsEnumerable(cur)) {
[68] Fix | Delete
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
[69] Fix | Delete
return "builtin";
[70] Fix | Delete
}
[71] Fix | Delete
if (atoms.propertyIsEnumerable(cur)) return "atom";
[72] Fix | Delete
return "variable";
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
function tokenString(quote) {
[76] Fix | Delete
return function(stream, state) {
[77] Fix | Delete
var escaped = false, next, end = false;
[78] Fix | Delete
while ((next = stream.next()) != null) {
[79] Fix | Delete
if (next == quote && !escaped) {end = true; break;}
[80] Fix | Delete
escaped = !escaped && next == "\\";
[81] Fix | Delete
}
[82] Fix | Delete
if (end || !(escaped || multiLineStrings))
[83] Fix | Delete
state.tokenize = null;
[84] Fix | Delete
return "string";
[85] Fix | Delete
};
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
function tokenComment(stream, state) {
[89] Fix | Delete
var maybeEnd = false, ch;
[90] Fix | Delete
while (ch = stream.next()) {
[91] Fix | Delete
if (ch == "/" && maybeEnd) {
[92] Fix | Delete
state.tokenize = null;
[93] Fix | Delete
break;
[94] Fix | Delete
}
[95] Fix | Delete
maybeEnd = (ch == "*");
[96] Fix | Delete
}
[97] Fix | Delete
return "comment";
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
function tokenNestedComment(stream, state) {
[101] Fix | Delete
var maybeEnd = false, ch;
[102] Fix | Delete
while (ch = stream.next()) {
[103] Fix | Delete
if (ch == "/" && maybeEnd) {
[104] Fix | Delete
state.tokenize = null;
[105] Fix | Delete
break;
[106] Fix | Delete
}
[107] Fix | Delete
maybeEnd = (ch == "+");
[108] Fix | Delete
}
[109] Fix | Delete
return "comment";
[110] Fix | Delete
}
[111] Fix | Delete
[112] Fix | Delete
function Context(indented, column, type, align, prev) {
[113] Fix | Delete
this.indented = indented;
[114] Fix | Delete
this.column = column;
[115] Fix | Delete
this.type = type;
[116] Fix | Delete
this.align = align;
[117] Fix | Delete
this.prev = prev;
[118] Fix | Delete
}
[119] Fix | Delete
function pushContext(state, col, type) {
[120] Fix | Delete
var indent = state.indented;
[121] Fix | Delete
if (state.context && state.context.type == "statement")
[122] Fix | Delete
indent = state.context.indented;
[123] Fix | Delete
return state.context = new Context(indent, col, type, null, state.context);
[124] Fix | Delete
}
[125] Fix | Delete
function popContext(state) {
[126] Fix | Delete
var t = state.context.type;
[127] Fix | Delete
if (t == ")" || t == "]" || t == "}")
[128] Fix | Delete
state.indented = state.context.indented;
[129] Fix | Delete
return state.context = state.context.prev;
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
// Interface
[133] Fix | Delete
[134] Fix | Delete
return {
[135] Fix | Delete
startState: function(basecolumn) {
[136] Fix | Delete
return {
[137] Fix | Delete
tokenize: null,
[138] Fix | Delete
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
[139] Fix | Delete
indented: 0,
[140] Fix | Delete
startOfLine: true
[141] Fix | Delete
};
[142] Fix | Delete
},
[143] Fix | Delete
[144] Fix | Delete
token: function(stream, state) {
[145] Fix | Delete
var ctx = state.context;
[146] Fix | Delete
if (stream.sol()) {
[147] Fix | Delete
if (ctx.align == null) ctx.align = false;
[148] Fix | Delete
state.indented = stream.indentation();
[149] Fix | Delete
state.startOfLine = true;
[150] Fix | Delete
}
[151] Fix | Delete
if (stream.eatSpace()) return null;
[152] Fix | Delete
curPunc = null;
[153] Fix | Delete
var style = (state.tokenize || tokenBase)(stream, state);
[154] Fix | Delete
if (style == "comment" || style == "meta") return style;
[155] Fix | Delete
if (ctx.align == null) ctx.align = true;
[156] Fix | Delete
[157] Fix | Delete
if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state);
[158] Fix | Delete
else if (curPunc == "{") pushContext(state, stream.column(), "}");
[159] Fix | Delete
else if (curPunc == "[") pushContext(state, stream.column(), "]");
[160] Fix | Delete
else if (curPunc == "(") pushContext(state, stream.column(), ")");
[161] Fix | Delete
else if (curPunc == "}") {
[162] Fix | Delete
while (ctx.type == "statement") ctx = popContext(state);
[163] Fix | Delete
if (ctx.type == "}") ctx = popContext(state);
[164] Fix | Delete
while (ctx.type == "statement") ctx = popContext(state);
[165] Fix | Delete
}
[166] Fix | Delete
else if (curPunc == ctx.type) popContext(state);
[167] Fix | Delete
else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement"))
[168] Fix | Delete
pushContext(state, stream.column(), "statement");
[169] Fix | Delete
state.startOfLine = false;
[170] Fix | Delete
return style;
[171] Fix | Delete
},
[172] Fix | Delete
[173] Fix | Delete
indent: function(state, textAfter) {
[174] Fix | Delete
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
[175] Fix | Delete
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
[176] Fix | Delete
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
[177] Fix | Delete
var closing = firstChar == ctx.type;
[178] Fix | Delete
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
[179] Fix | Delete
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
[180] Fix | Delete
else return ctx.indented + (closing ? 0 : indentUnit);
[181] Fix | Delete
},
[182] Fix | Delete
[183] Fix | Delete
electricChars: "{}"
[184] Fix | Delete
};
[185] Fix | Delete
});
[186] Fix | Delete
[187] Fix | Delete
function words(str) {
[188] Fix | Delete
var obj = {}, words = str.split(" ");
[189] Fix | Delete
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
[190] Fix | Delete
return obj;
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
var blockKeywords = "body catch class do else enum for foreach foreach_reverse if in interface mixin " +
[194] Fix | Delete
"out scope struct switch try union unittest version while with";
[195] Fix | Delete
[196] Fix | Delete
CodeMirror.defineMIME("text/x-d", {
[197] Fix | Delete
name: "d",
[198] Fix | Delete
keywords: words("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue " +
[199] Fix | Delete
"debug default delegate delete deprecated export extern final finally function goto immutable " +
[200] Fix | Delete
"import inout invariant is lazy macro module new nothrow override package pragma private " +
[201] Fix | Delete
"protected public pure ref return shared short static super synchronized template this " +
[202] Fix | Delete
"throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters " +
[203] Fix | Delete
blockKeywords),
[204] Fix | Delete
blockKeywords: words(blockKeywords),
[205] Fix | Delete
builtin: words("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte " +
[206] Fix | Delete
"ucent uint ulong ushort wchar wstring void size_t sizediff_t"),
[207] Fix | Delete
atoms: words("exit failure success true false null"),
[208] Fix | Delete
hooks: {
[209] Fix | Delete
"@": function(stream, _state) {
[210] Fix | Delete
stream.eatWhile(/[\w\$_]/);
[211] Fix | Delete
return "meta";
[212] Fix | Delete
}
[213] Fix | Delete
}
[214] Fix | Delete
});
[215] Fix | Delete
[216] Fix | Delete
});
[217] Fix | Delete
[218] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function