?
Path : /home/admin/public_html/old/media/editors/codemirror/mode/sieve/ |
Current File : /home/admin/public_html/old/media/editors/codemirror/mode/sieve/sieve.min.js |
!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("sieve",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b){var c=a.next();if("/"==c&&a.eat("*"))return b.tokenize=e,e(a,b);if("#"===c)return a.skipToEnd(),"comment";if('"'==c)return b.tokenize=f(c),b.tokenize(a,b);if("("==c)return b._indent.push("("),b._indent.push("{"),null;if("{"===c)return b._indent.push("{"),null;if(")"==c&&(b._indent.pop(),b._indent.pop()),"}"===c)return b._indent.pop(),null;if(","==c)return null;if(";"==c)return null;if(/[{}\(\),;]/.test(c))return null;if(/\d/.test(c))return a.eatWhile(/[\d]/),a.eat(/[KkMmGg]/),"number";if(":"==c)return a.eatWhile(/[a-zA-Z_]/),a.eatWhile(/[a-zA-Z0-9_]/),"operator";a.eatWhile(/\w/);var i=a.current();return"text"==i&&a.eat(":")?(b.tokenize=d,"string"):g.propertyIsEnumerable(i)?"keyword":h.propertyIsEnumerable(i)?"atom":null}function d(a,b){return b._multiLineString=!0,a.sol()?("."==a.next()&&a.eol()&&(b._multiLineString=!1,b.tokenize=c),"string"):(a.eatSpace(),"#"==a.peek()?(a.skipToEnd(),"comment"):(a.skipToEnd(),"string"))}function e(a,b){for(var d,e=!1;null!=(d=a.next());){if(e&&"/"==d){b.tokenize=c;break}e="*"==d}return"comment"}function f(a){return function(b,d){for(var e,f=!1;null!=(e=b.next())&&(e!=a||f);)f=!f&&"\\"==e;return f||(d.tokenize=c),"string"}}var g=b("if elsif else stop require"),h=b("true false not"),i=a.indentUnit;return{startState:function(a){return{tokenize:c,baseIndent:a||0,_indent:[]}},token:function(a,b){return a.eatSpace()?null:(b.tokenize||c)(a,b)},indent:function(a,b){var c=a._indent.length;return b&&"}"==b[0]&&c--,0>c&&(c=0),c*i},electricChars:"}"}}),a.defineMIME("application/sieve","sieve")});