%PDF- %PDF-
| Direktori : /data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/stex/ |
| Current File : //data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/stex/stex-min.js |
CodeMirror.defineMode("stex",function(){function I(L,M){L.cmdState.push(M)}function G(L){if(L.cmdState.length>0){return L.cmdState[L.cmdState.length-1]}else{return null}}function K(M){var L=M.cmdState.pop();if(L){L.closeBracket()}}function A(O){var N=O.cmdState;for(var M=N.length-1;M>=0;M--){var L=N[M];if(L.name=="DEFAULT"){continue}return L}return{styleIdentifier:function(){return null}}}function B(N,M,L){return function(){this.name=N;this.bracketNo=0;this.style=M;this.styles=L;this.argument=null;this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null};this.openBracket=function(){this.bracketNo++;return"bracket"};this.closeBracket=function(){}}}var C={};C.importmodule=B("importmodule","tag",["string","builtin"]);C.documentclass=B("documentclass","tag",["","atom"]);C.usepackage=B("usepackage","tag",["atom"]);C.begin=B("begin","tag",["atom"]);C.end=B("end","tag",["atom"]);C.DEFAULT=function(){this.name="DEFAULT";this.style="tag";this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(M,L){M.f=L}function E(P,O){var L;if(P.match(/^\\[a-zA-Z@]+/)){var M=P.current().slice(1);L=C[M]||C.DEFAULT;L=new L();I(O,L);D(O,F);return L.style}if(P.match(/^\\[$&%#{}_]/)){return"tag"}if(P.match(/^\\[,;!\/\\]/)){return"tag"}if(P.match("\\[")){D(O,function(R,Q){return H(R,Q,"\\]")});return"keyword"}if(P.match("$$")){D(O,function(R,Q){return H(R,Q,"$$")});return"keyword"}if(P.match("$")){D(O,function(R,Q){return H(R,Q,"$")});return"keyword"}var N=P.next();if(N=="%"){if(!P.eol()){D(O,J)}return"comment"}else{if(N=="}"||N=="]"){L=G(O);if(L){L.closeBracket(N);D(O,F)}else{return"error"}return"bracket"}else{if(N=="{"||N=="["){L=C.DEFAULT;L=new L();I(O,L);return"bracket"}else{if(/\d/.test(N)){P.eatWhile(/[\w.%]/);return"atom"}else{P.eatWhile(/[\w\-_]/);L=A(O);if(L.name=="begin"){L.argument=P.current()}return L.styleIdentifier()}}}}}function J(M,L){M.skipToEnd();D(L,E);return"comment"}function H(N,M,O){if(N.eatSpace()){return null}if(N.match(O)){D(M,E);return"keyword"}if(N.match(/^\\[a-zA-Z@]+/)){return"tag"}if(N.match(/^[a-zA-Z]+/)){return"variable-2"}if(N.match(/^\\[$&%#{}_]/)){return"tag"}if(N.match(/^\\[,;!\/]/)){return"tag"}if(N.match(/^[\^_&]/)){return"tag"}if(N.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)){return null}if(N.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)){return"number"}var L=N.next();if(L=="{"||L=="}"||L=="["||L=="]"||L=="("||L==")"){return"bracket"}if(L=="%"){if(!N.eol()){N.skipToEnd()}return"comment"}return"error"}function F(O,N){var M=O.peek(),L;if(M=="{"||M=="["){L=G(N);L.openBracket(M);O.eat(M);D(N,E);return"bracket"}if(/[ \t\r]/.test(M)){O.eat(M);return null}D(N,E);K(N);return E(O,N)}return{startState:function(){return{cmdState:[],f:E}},copyState:function(L){return{cmdState:L.cmdState.slice(),f:L.f}},token:function(M,L){return L.f(M,L)}}});CodeMirror.defineMIME("text/x-stex","stex");CodeMirror.defineMIME("text/x-latex","stex");