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/mumps
File: mumps.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
/*
[3] Fix | Delete
This MUMPS Language script was constructed using vbscript.js as a template.
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
(function(mod) {
[7] Fix | Delete
if (typeof exports == "object" && typeof module == "object") // CommonJS
[8] Fix | Delete
mod(require("../../lib/codemirror"));
[9] Fix | Delete
else if (typeof define == "function" && define.amd) // AMD
[10] Fix | Delete
define(["../../lib/codemirror"], mod);
[11] Fix | Delete
else // Plain browser env
[12] Fix | Delete
mod(CodeMirror);
[13] Fix | Delete
})(function(CodeMirror) {
[14] Fix | Delete
"use strict";
[15] Fix | Delete
[16] Fix | Delete
CodeMirror.defineMode("mumps", function() {
[17] Fix | Delete
function wordRegexp(words) {
[18] Fix | Delete
return new RegExp("^((" + words.join(")|(") + "))\\b", "i");
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
var singleOperators = new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]");
[22] Fix | Delete
var doubleOperators = new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))");
[23] Fix | Delete
var singleDelimiters = new RegExp("^[\\.,:]");
[24] Fix | Delete
var brackets = new RegExp("[()]");
[25] Fix | Delete
var identifiers = new RegExp("^[%A-Za-z][A-Za-z0-9]*");
[26] Fix | Delete
var commandKeywords = ["break","close","do","else","for","goto", "halt", "hang", "if", "job","kill","lock","merge","new","open", "quit", "read", "set", "tcommit", "trollback", "tstart", "use", "view", "write", "xecute", "b","c","d","e","f","g", "h", "i", "j","k","l","m","n","o", "q", "r", "s", "tc", "tro", "ts", "u", "v", "w", "x"];
[27] Fix | Delete
// The following list includes instrinsic functions _and_ special variables
[28] Fix | Delete
var intrinsicFuncsWords = ["\\$ascii", "\\$char", "\\$data", "\\$ecode", "\\$estack", "\\$etrap", "\\$extract", "\\$find", "\\$fnumber", "\\$get", "\\$horolog", "\\$io", "\\$increment", "\\$job", "\\$justify", "\\$length", "\\$name", "\\$next", "\\$order", "\\$piece", "\\$qlength", "\\$qsubscript", "\\$query", "\\$quit", "\\$random", "\\$reverse", "\\$select", "\\$stack", "\\$test", "\\$text", "\\$translate", "\\$view", "\\$x", "\\$y", "\\$a", "\\$c", "\\$d", "\\$e", "\\$ec", "\\$es", "\\$et", "\\$f", "\\$fn", "\\$g", "\\$h", "\\$i", "\\$j", "\\$l", "\\$n", "\\$na", "\\$o", "\\$p", "\\$q", "\\$ql", "\\$qs", "\\$r", "\\$re", "\\$s", "\\$st", "\\$t", "\\$tr", "\\$v", "\\$z"];
[29] Fix | Delete
var intrinsicFuncs = wordRegexp(intrinsicFuncsWords);
[30] Fix | Delete
var command = wordRegexp(commandKeywords);
[31] Fix | Delete
[32] Fix | Delete
function tokenBase(stream, state) {
[33] Fix | Delete
if (stream.sol()) {
[34] Fix | Delete
state.label = true;
[35] Fix | Delete
state.commandMode = 0;
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
// The <space> character has meaning in MUMPS. Ignoring consecutive
[39] Fix | Delete
// spaces would interfere with interpreting whether the next non-space
[40] Fix | Delete
// character belongs to the command or argument context.
[41] Fix | Delete
[42] Fix | Delete
// Examine each character and update a mode variable whose interpretation is:
[43] Fix | Delete
// >0 => command 0 => argument <0 => command post-conditional
[44] Fix | Delete
var ch = stream.peek();
[45] Fix | Delete
[46] Fix | Delete
if (ch == " " || ch == "\t") { // Pre-process <space>
[47] Fix | Delete
state.label = false;
[48] Fix | Delete
if (state.commandMode == 0)
[49] Fix | Delete
state.commandMode = 1;
[50] Fix | Delete
else if ((state.commandMode < 0) || (state.commandMode == 2))
[51] Fix | Delete
state.commandMode = 0;
[52] Fix | Delete
} else if ((ch != ".") && (state.commandMode > 0)) {
[53] Fix | Delete
if (ch == ":")
[54] Fix | Delete
state.commandMode = -1; // SIS - Command post-conditional
[55] Fix | Delete
else
[56] Fix | Delete
state.commandMode = 2;
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
// Do not color parameter list as line tag
[60] Fix | Delete
if ((ch === "(") || (ch === "\u0009"))
[61] Fix | Delete
state.label = false;
[62] Fix | Delete
[63] Fix | Delete
// MUMPS comment starts with ";"
[64] Fix | Delete
if (ch === ";") {
[65] Fix | Delete
stream.skipToEnd();
[66] Fix | Delete
return "comment";
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
// Number Literals // SIS/RLM - MUMPS permits canonic number followed by concatenate operator
[70] Fix | Delete
if (stream.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/))
[71] Fix | Delete
return "number";
[72] Fix | Delete
[73] Fix | Delete
// Handle Strings
[74] Fix | Delete
if (ch == '"') {
[75] Fix | Delete
if (stream.skipTo('"')) {
[76] Fix | Delete
stream.next();
[77] Fix | Delete
return "string";
[78] Fix | Delete
} else {
[79] Fix | Delete
stream.skipToEnd();
[80] Fix | Delete
return "error";
[81] Fix | Delete
}
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
// Handle operators and Delimiters
[85] Fix | Delete
if (stream.match(doubleOperators) || stream.match(singleOperators))
[86] Fix | Delete
return "operator";
[87] Fix | Delete
[88] Fix | Delete
// Prevents leading "." in DO block from falling through to error
[89] Fix | Delete
if (stream.match(singleDelimiters))
[90] Fix | Delete
return null;
[91] Fix | Delete
[92] Fix | Delete
if (brackets.test(ch)) {
[93] Fix | Delete
stream.next();
[94] Fix | Delete
return "bracket";
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
if (state.commandMode > 0 && stream.match(command))
[98] Fix | Delete
return "variable-2";
[99] Fix | Delete
[100] Fix | Delete
if (stream.match(intrinsicFuncs))
[101] Fix | Delete
return "builtin";
[102] Fix | Delete
[103] Fix | Delete
if (stream.match(identifiers))
[104] Fix | Delete
return "variable";
[105] Fix | Delete
[106] Fix | Delete
// Detect dollar-sign when not a documented intrinsic function
[107] Fix | Delete
// "^" may introduce a GVN or SSVN - Color same as function
[108] Fix | Delete
if (ch === "$" || ch === "^") {
[109] Fix | Delete
stream.next();
[110] Fix | Delete
return "builtin";
[111] Fix | Delete
}
[112] Fix | Delete
[113] Fix | Delete
// MUMPS Indirection
[114] Fix | Delete
if (ch === "@") {
[115] Fix | Delete
stream.next();
[116] Fix | Delete
return "string-2";
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
if (/[\w%]/.test(ch)) {
[120] Fix | Delete
stream.eatWhile(/[\w%]/);
[121] Fix | Delete
return "variable";
[122] Fix | Delete
}
[123] Fix | Delete
[124] Fix | Delete
// Handle non-detected items
[125] Fix | Delete
stream.next();
[126] Fix | Delete
return "error";
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
return {
[130] Fix | Delete
startState: function() {
[131] Fix | Delete
return {
[132] Fix | Delete
label: false,
[133] Fix | Delete
commandMode: 0
[134] Fix | Delete
};
[135] Fix | Delete
},
[136] Fix | Delete
[137] Fix | Delete
token: function(stream, state) {
[138] Fix | Delete
var style = tokenBase(stream, state);
[139] Fix | Delete
if (state.label) return "tag";
[140] Fix | Delete
return style;
[141] Fix | Delete
}
[142] Fix | Delete
};
[143] Fix | Delete
});
[144] Fix | Delete
[145] Fix | Delete
CodeMirror.defineMIME("text/x-mumps", "mumps");
[146] Fix | Delete
});
[147] Fix | Delete
[148] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function