%PDF- %PDF-
| Direktori : /data/old/home/stash/stash/atlassian-stash/static/bower/CodeMirror/mode/smalltalk/ |
| Current File : //data/old/home/stash/stash/atlassian-stash/static/bower/CodeMirror/mode/smalltalk/smalltalk-min.js |
CodeMirror.defineMode("smalltalk",function(C){var D=/[+\-\/\\*~<>=@%|&?!.,:;^]/;var G=/true|false|nil|self|super|thisContext/;var I=function(M,L){this.next=M;this.parent=L};var B=function(L,M,N){this.name=L;this.context=M;this.eos=N};var J=function(){this.context=new I(F,null);this.expectVariable=true;this.indentation=0;this.userIndentationDelta=0};J.prototype.userIndent=function(L){this.userIndentationDelta=L>0?(L/C.indentUnit-this.indentation):0};var F=function(P,N,O){var M=new B(null,N,false);var L=P.next();if(L==='"'){M=A(P,new I(A,N))}else{if(L==="'"){M=K(P,new I(K,N))}else{if(L==="#"){if(P.peek()==="'"){P.next();M=H(P,new I(H,N))}else{if(P.eatWhile(/[^ .{}\[\]()]/)){M.name="string-2"}else{M.name="meta"}}}else{if(L==="$"){if(P.next()==="<"){P.eatWhile(/[^ >]/);P.next()}M.name="string-2"}else{if(L==="|"&&O.expectVariable){M.context=new I(E,N)}else{if(/[\[\]{}()]/.test(L)){M.name="bracket";M.eos=/[\[{(]/.test(L);if(L==="["){O.indentation++}else{if(L==="]"){O.indentation=Math.max(0,O.indentation-1)}}}else{if(D.test(L)){P.eatWhile(D);M.name="operator";M.eos=L!==";"}else{if(/\d/.test(L)){P.eatWhile(/[\w\d]/);M.name="number"}else{if(/[\w_]/.test(L)){P.eatWhile(/[\w\d_]/);M.name=O.expectVariable?(G.test(P.current())?"keyword":"variable"):null}else{M.eos=O.expectVariable}}}}}}}}}return M};var A=function(M,L){M.eatWhile(/[^"]/);return new B("comment",M.eat('"')?L.parent:L,true)};var K=function(M,L){M.eatWhile(/[^']/);return new B("string",M.eat("'")?L.parent:L,false)};var H=function(M,L){M.eatWhile(/[^']/);return new B("string-2",M.eat("'")?L.parent:L,false)};var E=function(O,N){var M=new B(null,N,false);var L=O.next();if(L==="|"){M.context=N.parent;M.eos=true}else{O.eatWhile(/[^|]/);M.name="variable"}return M};return{startState:function(){return new J},token:function(N,M){M.userIndent(N.indentation());if(N.eatSpace()){return null}var L=M.context.next(N,M.context,M);M.context=L.context;M.expectVariable=L.eos;return L.name},blankLine:function(L){L.userIndent(0)},indent:function(N,L){var M=N.context.next===F&&L&&L.charAt(0)==="]"?-1:N.userIndentationDelta;return(N.indentation+M)*C.indentUnit},electricChars:"]"}});CodeMirror.defineMIME("text/x-stsrc",{name:"smalltalk"});