Current File : /home/pacjaorg/public_html/kmm/media/vendor/codemirror/mode/mathematica/mathematica.min.js |
(function(a){typeof exports=="object"&&typeof module=="object"?a(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineMode("mathematica",function(d,h){var o="[a-zA-Z\\$][a-zA-Z0-9\\$]*",l="(?:\\d+)",u="(?:\\.\\d+|\\d+\\.\\d*|\\d+)",z="(?:\\.\\w+|\\w+\\.\\w*|\\w+)",c="(?:`(?:`?"+u+")?)",m=new RegExp("(?:"+l+"(?:\\^\\^"+z+c+"?(?:\\*\\^[+-]?\\d+)?))"),A=new RegExp("(?:"+u+c+"?(?:\\*\\^[+-]?\\d+)?)"),Z=new RegExp("(?:`?)(?:"+o+")(?:`(?:"+o+"))*(?:`?)");function f(e,n){var r;return r=e.next(),r==='"'?(n.tokenize=$,n.tokenize(e,n)):r==="("&&e.eat("*")?(n.commentLevel++,n.tokenize=v,n.tokenize(e,n)):(e.backUp(1),e.match(m,!0,!1)||e.match(A,!0,!1)?"number":e.match(/(?:In|Out)\[[0-9]*\]/,!0,!1)?"atom":e.match(/([a-zA-Z\$][a-zA-Z0-9\$]*(?:`[a-zA-Z0-9\$]+)*::usage)/,!0,!1)?"meta":e.match(/([a-zA-Z\$][a-zA-Z0-9\$]*(?:`[a-zA-Z0-9\$]+)*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/,!0,!1)?"string-2":e.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/,!0,!1)||e.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)||e.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/,!0,!1)||e.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)?"variable-2":e.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/,!0,!1)?"variable-3":e.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)?"bracket":e.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/,!0,!1)?"variable-2":e.match(Z,!0,!1)?"keyword":e.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/,!0,!1)?"operator":(e.next(),"error"))}function $(e,n){for(var r,t=!1,i=!1;(r=e.next())!=null;){if(r==='"'&&!i){t=!0;break}i=!i&&r==="\\"}return t&&!i&&(n.tokenize=f),"string"}function v(e,n){for(var r,t;n.commentLevel>0&&(t=e.next())!=null;)r==="("&&t==="*"&&n.commentLevel++,r==="*"&&t===")"&&n.commentLevel--,r=t;return n.commentLevel<=0&&(n.tokenize=f),"comment"}return{startState:function(){return{tokenize:f,commentLevel:0}},token:function(e,n){return e.eatSpace()?null:n.tokenize(e,n)},blockCommentStart:"(*",blockCommentEnd:"*)"}}),a.defineMIME("text/x-mathematica",{name:"mathematica"})});