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/octave
File: octave.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("octave", function() {
[13] Fix | Delete
function wordRegexp(words) {
[14] Fix | Delete
return new RegExp("^((" + words.join(")|(") + "))\\b");
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
var singleOperators = new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]");
[18] Fix | Delete
var singleDelimiters = new RegExp('^[\\(\\[\\{\\},:=;]');
[19] Fix | Delete
var doubleOperators = new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))");
[20] Fix | Delete
var doubleDelimiters = new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))");
[21] Fix | Delete
var tripleDelimiters = new RegExp("^((>>=)|(<<=))");
[22] Fix | Delete
var expressionEnd = new RegExp("^[\\]\\)]");
[23] Fix | Delete
var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*");
[24] Fix | Delete
[25] Fix | Delete
var builtins = wordRegexp([
[26] Fix | Delete
'error', 'eval', 'function', 'abs', 'acos', 'atan', 'asin', 'cos',
[27] Fix | Delete
'cosh', 'exp', 'log', 'prod', 'sum', 'log10', 'max', 'min', 'sign', 'sin', 'sinh',
[28] Fix | Delete
'sqrt', 'tan', 'reshape', 'break', 'zeros', 'default', 'margin', 'round', 'ones',
[29] Fix | Delete
'rand', 'syn', 'ceil', 'floor', 'size', 'clear', 'zeros', 'eye', 'mean', 'std', 'cov',
[30] Fix | Delete
'det', 'eig', 'inv', 'norm', 'rank', 'trace', 'expm', 'logm', 'sqrtm', 'linspace', 'plot',
[31] Fix | Delete
'title', 'xlabel', 'ylabel', 'legend', 'text', 'grid', 'meshgrid', 'mesh', 'num2str',
[32] Fix | Delete
'fft', 'ifft', 'arrayfun', 'cellfun', 'input', 'fliplr', 'flipud', 'ismember'
[33] Fix | Delete
]);
[34] Fix | Delete
[35] Fix | Delete
var keywords = wordRegexp([
[36] Fix | Delete
'return', 'case', 'switch', 'else', 'elseif', 'end', 'endif', 'endfunction',
[37] Fix | Delete
'if', 'otherwise', 'do', 'for', 'while', 'try', 'catch', 'classdef', 'properties', 'events',
[38] Fix | Delete
'methods', 'global', 'persistent', 'endfor', 'endwhile', 'printf', 'sprintf', 'disp', 'until',
[39] Fix | Delete
'continue', 'pkg'
[40] Fix | Delete
]);
[41] Fix | Delete
[42] Fix | Delete
[43] Fix | Delete
// tokenizers
[44] Fix | Delete
function tokenTranspose(stream, state) {
[45] Fix | Delete
if (!stream.sol() && stream.peek() === '\'') {
[46] Fix | Delete
stream.next();
[47] Fix | Delete
state.tokenize = tokenBase;
[48] Fix | Delete
return 'operator';
[49] Fix | Delete
}
[50] Fix | Delete
state.tokenize = tokenBase;
[51] Fix | Delete
return tokenBase(stream, state);
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
[55] Fix | Delete
function tokenComment(stream, state) {
[56] Fix | Delete
if (stream.match(/^.*%}/)) {
[57] Fix | Delete
state.tokenize = tokenBase;
[58] Fix | Delete
return 'comment';
[59] Fix | Delete
};
[60] Fix | Delete
stream.skipToEnd();
[61] Fix | Delete
return 'comment';
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
function tokenBase(stream, state) {
[65] Fix | Delete
// whitespaces
[66] Fix | Delete
if (stream.eatSpace()) return null;
[67] Fix | Delete
[68] Fix | Delete
// Handle one line Comments
[69] Fix | Delete
if (stream.match('%{')){
[70] Fix | Delete
state.tokenize = tokenComment;
[71] Fix | Delete
stream.skipToEnd();
[72] Fix | Delete
return 'comment';
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
if (stream.match(/^[%#]/)){
[76] Fix | Delete
stream.skipToEnd();
[77] Fix | Delete
return 'comment';
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
// Handle Number Literals
[81] Fix | Delete
if (stream.match(/^[0-9\.+-]/, false)) {
[82] Fix | Delete
if (stream.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)) {
[83] Fix | Delete
stream.tokenize = tokenBase;
[84] Fix | Delete
return 'number'; };
[85] Fix | Delete
if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; };
[86] Fix | Delete
if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; };
[87] Fix | Delete
}
[88] Fix | Delete
if (stream.match(wordRegexp(['nan','NaN','inf','Inf']))) { return 'number'; };
[89] Fix | Delete
[90] Fix | Delete
// Handle Strings
[91] Fix | Delete
if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; } ;
[92] Fix | Delete
if (stream.match(/^'([^']|(''))*'/)) { return 'string'; } ;
[93] Fix | Delete
[94] Fix | Delete
// Handle words
[95] Fix | Delete
if (stream.match(keywords)) { return 'keyword'; } ;
[96] Fix | Delete
if (stream.match(builtins)) { return 'builtin'; } ;
[97] Fix | Delete
if (stream.match(identifiers)) { return 'variable'; } ;
[98] Fix | Delete
[99] Fix | Delete
if (stream.match(singleOperators) || stream.match(doubleOperators)) { return 'operator'; };
[100] Fix | Delete
if (stream.match(singleDelimiters) || stream.match(doubleDelimiters) || stream.match(tripleDelimiters)) { return null; };
[101] Fix | Delete
[102] Fix | Delete
if (stream.match(expressionEnd)) {
[103] Fix | Delete
state.tokenize = tokenTranspose;
[104] Fix | Delete
return null;
[105] Fix | Delete
};
[106] Fix | Delete
[107] Fix | Delete
[108] Fix | Delete
// Handle non-detected items
[109] Fix | Delete
stream.next();
[110] Fix | Delete
return 'error';
[111] Fix | Delete
};
[112] Fix | Delete
[113] Fix | Delete
[114] Fix | Delete
return {
[115] Fix | Delete
startState: function() {
[116] Fix | Delete
return {
[117] Fix | Delete
tokenize: tokenBase
[118] Fix | Delete
};
[119] Fix | Delete
},
[120] Fix | Delete
[121] Fix | Delete
token: function(stream, state) {
[122] Fix | Delete
var style = state.tokenize(stream, state);
[123] Fix | Delete
if (style === 'number' || style === 'variable'){
[124] Fix | Delete
state.tokenize = tokenTranspose;
[125] Fix | Delete
}
[126] Fix | Delete
return style;
[127] Fix | Delete
}
[128] Fix | Delete
};
[129] Fix | Delete
});
[130] Fix | Delete
[131] Fix | Delete
CodeMirror.defineMIME("text/x-octave", "octave");
[132] Fix | Delete
[133] Fix | Delete
});
[134] Fix | Delete
[135] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function