Sid Gifari File Manager
π Root
/
home2
/
compro23
/
luaoficial.com.br
/
wp-content
/
plugins
/
wp-file-manager
/
lib
/
codemirror
/
mode
/
apl
/
Editing: apl.js
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("apl", function() { var builtInOps = { ".": "innerProduct", "\\": "scan", "/": "reduce", "βΏ": "reduce1Axis", "β": "scan1Axis", "Β¨": "each", "β£": "power" }; var builtInFuncs = { "+": ["conjugate", "add"], "β": ["negate", "subtract"], "Γ": ["signOf", "multiply"], "Γ·": ["reciprocal", "divide"], "β": ["ceiling", "greaterOf"], "β": ["floor", "lesserOf"], "β£": ["absolute", "residue"], "β³": ["indexGenerate", "indexOf"], "?": ["roll", "deal"], "β": ["exponentiate", "toThePowerOf"], "β": ["naturalLog", "logToTheBase"], "β": ["piTimes", "circularFuncs"], "!": ["factorial", "binomial"], "βΉ": ["matrixInverse", "matrixDivide"], "<": [null, "lessThan"], "β€": [null, "lessThanOrEqual"], "=": [null, "equals"], ">": [null, "greaterThan"], "β₯": [null, "greaterThanOrEqual"], "β ": [null, "notEqual"], "β‘": ["depth", "match"], "β’": [null, "notMatch"], "β": ["enlist", "membership"], "β·": [null, "find"], "βͺ": ["unique", "union"], "β©": [null, "intersection"], "βΌ": ["not", "without"], "β¨": [null, "or"], "β§": [null, "and"], "β±": [null, "nor"], "β²": [null, "nand"], "β΄": ["shapeOf", "reshape"], ",": ["ravel", "catenate"], "βͺ": [null, "firstAxisCatenate"], "β½": ["reverse", "rotate"], "β": ["axis1Reverse", "axis1Rotate"], "β": ["transpose", null], "β": ["first", "take"], "β": [null, "drop"], "β": ["enclose", "partitionWithAxis"], "β": ["diclose", "pick"], "β·": [null, "index"], "β": ["gradeUp", null], "β": ["gradeDown", null], "β€": ["encode", null], "β₯": ["decode", null], "β": ["format", "formatByExample"], "β": ["execute", null], "β£": ["stop", "left"], "β’": ["pass", "right"] }; var isOperator = /[\.\/βΏβΒ¨β£]/; var isNiladic = /β¬/; var isFunction = /[\+βΓΓ·βββ£β³\?βββ!βΉ<β€=>β₯β β‘β’ββ·βͺβ©βΌβ¨β§β±β²β΄,βͺβ½βββββββ·βββ€β₯βββ£β’]/; var isArrow = /β/; var isComment = /[β#].*$/; var stringEater = function(type) { var prev; prev = false; return function(c) { prev = c; if (c === type) { return prev === "\\"; } return true; }; }; return { startState: function() { return { prev: false, func: false, op: false, string: false, escape: false }; }, token: function(stream, state) { var ch, funcName; if (stream.eatSpace()) { return null; } ch = stream.next(); if (ch === '"' || ch === "'") { stream.eatWhile(stringEater(ch)); stream.next(); state.prev = true; return "string"; } if (/[\[{\(]/.test(ch)) { state.prev = false; return null; } if (/[\]}\)]/.test(ch)) { state.prev = true; return null; } if (isNiladic.test(ch)) { state.prev = false; return "niladic"; } if (/[Β―\d]/.test(ch)) { if (state.func) { state.func = false; state.prev = false; } else { state.prev = true; } stream.eatWhile(/[\w\.]/); return "number"; } if (isOperator.test(ch)) { return "operator apl-" + builtInOps[ch]; } if (isArrow.test(ch)) { return "apl-arrow"; } if (isFunction.test(ch)) { funcName = "apl-"; if (builtInFuncs[ch] != null) { if (state.prev) { funcName += builtInFuncs[ch][1]; } else { funcName += builtInFuncs[ch][0]; } } state.func = true; state.prev = false; return "function " + funcName; } if (isComment.test(ch)) { stream.skipToEnd(); return "comment"; } if (ch === "β" && stream.peek() === ".") { stream.next(); return "function jot-dot"; } stream.eatWhile(/[\w\$_]/); state.prev = true; return "keyword"; } }; }); CodeMirror.defineMIME("text/apl", "apl"); });
Save
Cancel