%PDF- %PDF-
| Direktori : /data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/rust/ |
| Current File : //data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/rust/rust-min.js |
CodeMirror.defineMode("rust",function(){var Y=4,i=2;var J={"if":"if-style","while":"if-style","else":"else-style","do":"else-style",ret:"else-style",fail:"else-style","break":"atom",cont:"atom","const":"let",resource:"fn",let:"let",fn:"fn","for":"for",alt:"alt",iface:"iface",impl:"impl",type:"type","enum":"enum",mod:"mod",as:"op","true":"atom","false":"atom",assert:"op",check:"op",claim:"op","native":"ignore",unsafe:"ignore","import":"else-style","export":"else-style",copy:"op",log:"op",log_err:"op",use:"op",bind:"op",self:"atom"};var E=function(){var AC={fn:"fn",block:"fn",obj:"obj"};var r="bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" ");for(var AB=0,AD=r.length;AB<AD;++AB){AC[r[AB]]="atom"}return AC}();var x=/[+\-*&%=<>!?|\.@]/;var P,N;function v(r,AB){P=r;return AB}function m(AD,AC){var AB=AD.next();if(AB=='"'){AC.tokenize=M;return AC.tokenize(AD,AC)}if(AB=="'"){P="atom";if(AD.eat("\\")){if(AD.skipTo("'")){AD.next();return"string"}else{return"error"}}else{AD.next();return AD.eat("'")?"string":"error"}}if(AB=="/"){if(AD.eat("/")){AD.skipToEnd();return"comment"}if(AD.eat("*")){AC.tokenize=U(1);return AC.tokenize(AD,AC)}}if(AB=="#"){if(AD.eat("[")){P="open-attr";return null}AD.eatWhile(/\w/);return v("macro","meta")}if(AB==":"&&AD.match(":<")){return v("op",null)}if(AB.match(/\d/)||(AB=="."&&AD.eat(/\d/))){var r=false;if(!AD.match(/^x[\da-f]+/i)&&!AD.match(/^b[01]+/)){AD.eatWhile(/\d/);if(AD.eat(".")){r=true;AD.eatWhile(/\d/)}if(AD.match(/^e[+\-]?\d+/i)){r=true}}if(r){AD.match(/^f(?:32|64)/)}else{AD.match(/^[ui](?:8|16|32|64)/)}return v("atom","number")}if(AB.match(/[()\[\]{}:;,]/)){return v(AB,null)}if(AB=="-"&&AD.eat(">")){return v("->",null)}if(AB.match(x)){AD.eatWhile(x);return v("op",null)}AD.eatWhile(/\w/);N=AD.current();if(AD.match(/^::\w/)){AD.backUp(1);return v("prefix","variable-2")}if(AC.keywords.propertyIsEnumerable(N)){return v(AC.keywords[N],N.match(/true|false/)?"atom":"keyword")}return v("name","variable")}function M(AD,AB){var r,AC=false;while(r=AD.next()){if(r=='"'&&!AC){AB.tokenize=m;return v("atom","string")}AC=!AC&&r=="\\"}return v("op","string")}function U(r){return function(AE,AD){var AB=null,AC;while(AC=AE.next()){if(AC=="/"&&AB=="*"){if(r==1){AD.tokenize=m;break}else{AD.tokenize=U(r-1);return AD.tokenize(AE,AD)}}if(AC=="*"&&AB=="/"){AD.tokenize=U(r+1);return AD.tokenize(AE,AD)}AB=AC}return"comment"}}var X={state:null,stream:null,marked:null,cc:null};function A(){for(var r=arguments.length-1;r>=0;r--){X.cc.push(arguments[r])}}function l(){A.apply(null,arguments);return true}function F(AB,AC){var r=function(){var AD=X.state;AD.lexical={indented:AD.indented,column:X.stream.column(),type:AB,prev:AD.lexical,info:AC}};r.lex=true;return r}function k(){var r=X.state;if(r.lexical.prev){if(r.lexical.type==")"){r.indented=r.lexical.indented}r.lexical=r.lexical.prev}}function a(){X.state.keywords=E}function Z(){X.state.keywords=J}k.lex=a.lex=Z.lex=true;function w(AC,r){function AB(AD){if(AD==","){return l(AC,AB)}if(AD==r){return l()}return l(AB)}return function(AD){if(AD==r){return l()}return A(AC,AB)}}function z(AB,r){return l(F("stat",r),AB,k,L)}function L(r){if(r=="}"){return l()}if(r=="let"){return z(K,"let")}if(r=="fn"){return z(h)}if(r=="type"){return l(F("stat"),Q,n,k,L)}if(r=="enum"){return z(D)}if(r=="mod"){return z(C)}if(r=="iface"){return z(e)}if(r=="impl"){return z(u)}if(r=="open-attr"){return l(F("]"),w(b,"]"),k)}if(r=="ignore"||r.match(/[\]\);,]/)){return l(L)}return A(F("stat"),b,k,n,L)}function n(r){if(r==";"){return l()}return A()}function b(r){if(r=="atom"||r=="name"){return l(S)}if(r=="{"){return l(F("}"),y,k)}if(r.match(/[\[\(]/)){return s(r,b)}if(r.match(/[\]\)\};,]/)){return A()}if(r=="if-style"){return l(b,b)}if(r=="else-style"||r=="op"){return l(b)}if(r=="for"){return l(H,O,AA,b,b)}if(r=="alt"){return l(b,o)}if(r=="fn"){return l(h)}if(r=="macro"){return l(G)}return l()}function S(r){if(N=="."){return l(j)}if(N=="::<"){return l(V,S)}if(r=="op"||N==":"){return l(b)}if(r=="("||r=="["){return s(r,b)}return A()}function j(){if(N.match(/^\w+$/)){X.marked="variable";return l(S)}return A(b)}function y(r){if(r=="op"){if(N=="|"){return l(B,k,F("}","block"),L)}if(N=="||"){return l(k,F("}","block"),L)}}if(N=="mutable"||(N.match(/^\w+$/)&&X.stream.peek()==":"&&!X.stream.match("::",false))){return A(g(b))}return A(L)}function g(r){function AB(AC){if(N=="mutable"||N=="with"){X.marked="keyword";return l(AB)}if(N.match(/^\w*$/)){X.marked="variable";return l(AB)}if(AC==":"){return l(r,AB)}if(AC=="}"){return l()}return l(AB)}return AB}function B(r){if(r=="name"){X.marked="def";return l(B)}if(r=="op"&&N=="|"){return l()}return l(B)}function K(r){if(r.match(/[\]\)\};]/)){return l()}if(N=="="){return l(b,I)}if(r==","){return l(K)}return A(H,O,K)}function I(r){if(r.match(/[\]\)\};,]/)){return A(K)}else{return A(b,I)}}function O(r){if(r==":"){return l(a,t,Z)}return A()}function AA(r){if(r=="name"&&N=="in"){X.marked="keyword";return l()}return A()}function h(r){if(N=="@"||N=="~"){X.marked="keyword";return l(h)}if(r=="name"){X.marked="def";return l(h)}if(N=="<"){return l(V,h)}if(r=="{"){return A(b)}if(r=="("){return l(F(")"),w(d,")"),k,h)}if(r=="->"){return l(a,t,Z,h)}if(r==";"){return l()}return l(h)}function Q(r){if(r=="name"){X.marked="def";return l(Q)}if(N=="<"){return l(V,Q)}if(N=="="){return l(a,t,Z)}return l(Q)}function D(r){if(r=="name"){X.marked="def";return l(D)}if(N=="<"){return l(V,D)}if(N=="="){return l(a,t,Z,n)}if(r=="{"){return l(F("}"),a,W,Z,k)}return l(D)}function W(r){if(r=="}"){return l()}if(r=="("){return l(F(")"),w(t,")"),k,W)}if(N.match(/^\w+$/)){X.marked="def"}return l(W)}function C(r){if(r=="name"){X.marked="def";return l(C)}if(r=="{"){return l(F("}"),L,k)}return A()}function e(r){if(r=="name"){X.marked="def";return l(e)}if(N=="<"){return l(V,e)}if(r=="{"){return l(F("}"),L,k)}return A()}function u(r){if(N=="<"){return l(V,u)}if(N=="of"||N=="for"){X.marked="keyword";return l(t,u)}if(r=="name"){X.marked="def";return l(u)}if(r=="{"){return l(F("}"),L,k)}return A()}function V(){if(N==">"){return l()}if(N==","){return l(V)}if(N==":"){return l(t,V)}return A(t,V)}function d(r){if(r=="name"){X.marked="def";return l(d)}if(r==":"){return l(a,t,Z)}return A()}function t(r){if(r=="name"){X.marked="variable-3";return l(f)}if(N=="mutable"){X.marked="keyword";return l(t)}if(r=="atom"){return l(f)}if(r=="op"||r=="obj"){return l(t)}if(r=="fn"){return l(c)}if(r=="{"){return l(F("{"),g(t),k)}return s(r,t)}function f(){if(N=="<"){return l(V)}return A()}function c(r){if(r=="("){return l(F("("),w(t,")"),k,c)}if(r=="->"){return l(t)}return A()}function H(r){if(r=="name"){X.marked="def";return l(R)}if(r=="atom"){return l(R)}if(r=="op"){return l(H)}if(r.match(/[\]\)\};,]/)){return A()}return s(r,H)}function R(r){if(r=="op"&&N=="."){return l()}if(N=="to"){X.marked="keyword";return l(H)}else{return A()}}function o(r){if(r=="{"){return l(F("}","alt"),q,k)}return A()}function q(r){if(r=="}"){return l()}if(r=="|"){return l(q)}if(N=="when"){X.marked="keyword";return l(b,p)}if(r.match(/[\]\);,]/)){return l(q)}return A(H,p)}function p(r){if(r=="{"){return l(F("}","alt"),L,k,q)}else{return A(q)}}function G(r){if(r.match(/[\[\(\{]/)){return s(r,b)}return A()}function s(AB,r){if(AB=="["){return l(F("]"),w(r,"]"),k)}if(AB=="("){return l(F(")"),w(r,")"),k)}if(AB=="{"){return l(F("}"),w(r,"}"),k)}return l()}function T(AC,AD,r){var AE=AC.cc;X.state=AC;X.stream=AD;X.marked=null,X.cc=AE;while(true){var AB=AE.length?AE.pop():L;if(AB(P)){while(AE.length&&AE[AE.length-1].lex){AE.pop()()}return X.marked||r}}}return{startState:function(){return{tokenize:m,cc:[],lexical:{indented:-Y,column:0,type:"top",align:false},keywords:J,indented:0}},token:function(AC,AB){if(AC.sol()){if(!AB.lexical.hasOwnProperty("align")){AB.lexical.align=false}AB.indented=AC.indentation()}if(AC.eatSpace()){return null}P=N=null;var r=AB.tokenize(AC,AB);if(r=="comment"){return r}if(!AB.lexical.hasOwnProperty("align")){AB.lexical.align=true}if(P=="prefix"){return r}if(!N){N=AC.current()}return T(AB,AC,r)},indent:function(AF,r){if(AF.tokenize!=m){return 0}var AE=r&&r.charAt(0),AC=AF.lexical,AD=AC.type,AB=AE==AD;if(AD=="stat"){return AC.indented+Y}if(AC.align){return AC.column+(AB?0:1)}return AC.indented+(AB?0:(AC.info=="alt"?i:Y))},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});CodeMirror.defineMIME("text/x-rustsrc","rust");