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/rpm
File: rpm.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("rpm-changes", function() {
[13] Fix | Delete
var headerSeperator = /^-+$/;
[14] Fix | Delete
var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /;
[15] Fix | Delete
var simpleEmail = /^[\w+.-]+@[\w.-]+/;
[16] Fix | Delete
[17] Fix | Delete
return {
[18] Fix | Delete
token: function(stream) {
[19] Fix | Delete
if (stream.sol()) {
[20] Fix | Delete
if (stream.match(headerSeperator)) { return 'tag'; }
[21] Fix | Delete
if (stream.match(headerLine)) { return 'tag'; }
[22] Fix | Delete
}
[23] Fix | Delete
if (stream.match(simpleEmail)) { return 'string'; }
[24] Fix | Delete
stream.next();
[25] Fix | Delete
return null;
[26] Fix | Delete
}
[27] Fix | Delete
};
[28] Fix | Delete
});
[29] Fix | Delete
[30] Fix | Delete
CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes");
[31] Fix | Delete
[32] Fix | Delete
// Quick and dirty spec file highlighting
[33] Fix | Delete
[34] Fix | Delete
CodeMirror.defineMode("rpm-spec", function() {
[35] Fix | Delete
var arch = /^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;
[36] Fix | Delete
[37] Fix | Delete
var preamble = /^[a-zA-Z0-9()]+:/;
[38] Fix | Delete
var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/;
[39] Fix | Delete
var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros
[40] Fix | Delete
var control_flow_simple = /^%(else|endif)/; // rpm control flow macros
[41] Fix | Delete
var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros
[42] Fix | Delete
[43] Fix | Delete
return {
[44] Fix | Delete
startState: function () {
[45] Fix | Delete
return {
[46] Fix | Delete
controlFlow: false,
[47] Fix | Delete
macroParameters: false,
[48] Fix | Delete
section: false
[49] Fix | Delete
};
[50] Fix | Delete
},
[51] Fix | Delete
token: function (stream, state) {
[52] Fix | Delete
var ch = stream.peek();
[53] Fix | Delete
if (ch == "#") { stream.skipToEnd(); return "comment"; }
[54] Fix | Delete
[55] Fix | Delete
if (stream.sol()) {
[56] Fix | Delete
if (stream.match(preamble)) { return "header"; }
[57] Fix | Delete
if (stream.match(section)) { return "atom"; }
[58] Fix | Delete
}
[59] Fix | Delete
[60] Fix | Delete
if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT'
[61] Fix | Delete
if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}'
[62] Fix | Delete
[63] Fix | Delete
if (stream.match(control_flow_simple)) { return "keyword"; }
[64] Fix | Delete
if (stream.match(control_flow_complex)) {
[65] Fix | Delete
state.controlFlow = true;
[66] Fix | Delete
return "keyword";
[67] Fix | Delete
}
[68] Fix | Delete
if (state.controlFlow) {
[69] Fix | Delete
if (stream.match(operators)) { return "operator"; }
[70] Fix | Delete
if (stream.match(/^(\d+)/)) { return "number"; }
[71] Fix | Delete
if (stream.eol()) { state.controlFlow = false; }
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
if (stream.match(arch)) {
[75] Fix | Delete
if (stream.eol()) { state.controlFlow = false; }
[76] Fix | Delete
return "number";
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
// Macros like '%make_install' or '%attr(0775,root,root)'
[80] Fix | Delete
if (stream.match(/^%[\w]+/)) {
[81] Fix | Delete
if (stream.match(/^\(/)) { state.macroParameters = true; }
[82] Fix | Delete
return "keyword";
[83] Fix | Delete
}
[84] Fix | Delete
if (state.macroParameters) {
[85] Fix | Delete
if (stream.match(/^\d+/)) { return "number";}
[86] Fix | Delete
if (stream.match(/^\)/)) {
[87] Fix | Delete
state.macroParameters = false;
[88] Fix | Delete
return "keyword";
[89] Fix | Delete
}
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
// Macros like '%{defined fedora}'
[93] Fix | Delete
if (stream.match(/^%\{\??[\w \-\:\!]+\}/)) {
[94] Fix | Delete
if (stream.eol()) { state.controlFlow = false; }
[95] Fix | Delete
return "def";
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
//TODO: Include bash script sub-parser (CodeMirror supports that)
[99] Fix | Delete
stream.next();
[100] Fix | Delete
return null;
[101] Fix | Delete
}
[102] Fix | Delete
};
[103] Fix | Delete
});
[104] Fix | Delete
[105] Fix | Delete
CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec");
[106] Fix | Delete
[107] Fix | Delete
});
[108] Fix | Delete
[109] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function