?
Path : /home/admin/public_html/old/media/editors/codemirror/mode/vbscript/ |
Current File : /home/admin/public_html/old/media/editors/codemirror/mode/vbscript/vbscript.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("vbscript",function(a,b){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function d(a,b){b.currentIndent++}function e(a,b){b.currentIndent--}function f(a,b){if(a.eatSpace())return"space";var c=a.peek();if("'"===c)return a.skipToEnd(),"comment";if(a.match(P))return a.skipToEnd(),"comment";if(a.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!a.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var f=!1;if(a.match(/^\d*\.\d+/i)?f=!0:a.match(/^\d+\.\d*/)?f=!0:a.match(/^\.\d+/)&&(f=!0),f)return a.eat(/J/i),"number";var h=!1;if(a.match(/^&H[0-9a-f]+/i)?h=!0:a.match(/^&O[0-7]+/i)?h=!0:a.match(/^[1-9]\d*F?/)?(a.eat(/J/i),h=!0):a.match(/^0(?![\dx])/i)&&(h=!0),h)return a.eat(/L/i),"number"}return a.match(I)?(b.tokenize=g(a.current()),b.tokenize(a,b)):a.match(k)||a.match(j)||a.match(r)?"operator":a.match(l)?null:a.match(m)?"bracket":a.match(O)?(b.doInCurrentLine=!0,"keyword"):a.match(N)?(d(a,b),b.doInCurrentLine=!0,"keyword"):a.match(J)?(b.doInCurrentLine?b.doInCurrentLine=!1:d(a,b),"keyword"):a.match(K)?"keyword":a.match(M)?(e(a,b),e(a,b),"keyword"):a.match(L)?(b.doInCurrentLine?b.doInCurrentLine=!1:e(a,b),"keyword"):a.match(D)?"keyword":a.match(E)?"atom":a.match(H)?"variable-2":a.match(F)?"builtin":a.match(G)?"variable-2":a.match(n)?"variable":(a.next(),i)}function g(a){var c=1==a.length,d="string";return function(e,g){for(;!e.eol();){if(e.eatWhile(/[^'"]/),e.match(a))return g.tokenize=f,d;e.eat(/['"]/)}if(c){if(b.singleLineStringErrors)return i;g.tokenize=f}return d}}function h(a,b){var c=b.tokenize(a,b),d=a.current();return"."===d?(c=b.tokenize(a,b),d=a.current(),!c||"variable"!==c.substr(0,8)&&"builtin"!==c&&"keyword"!==c?i:(("builtin"===c||"keyword"===c)&&(c="variable"),C.indexOf(d.substr(1))>-1&&(c="variable-2"),c)):c}var i="error",j=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),k=new RegExp("^((<>)|(<=)|(>=))"),l=new RegExp("^[\\.,]"),m=new RegExp("^[\\(\\)]"),n=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),o=["class","sub","select","while","if","function","property","with","for"],p=["else","elseif","case"],q=["next","loop","wend"],r=c(["and","or","not","xor","is","mod","eqv","imp"]),s=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],t=["true","false","nothing","empty","null"],u=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],v=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],w=["WScript","err","debug","RegExp"],x=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],y=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],z=["server","response","request","session","application"],A=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],B=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],C=y.concat(x);w=w.concat(v),a.isASP&&(w=w.concat(z),C=C.concat(B,A));var D=c(s),E=c(t),F=c(u),G=c(w),H=c(C),I='"',J=c(o),K=c(p),L=c(q),M=c(["end"]),N=c(["do"]),O=c(["on error resume next","exit"]),P=c(["rem"]),Q={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:f,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(a,b){a.sol()&&(b.currentIndent+=b.nextLineIndent,b.nextLineIndent=0,b.doInCurrentLine=0);var c=h(a,b);return b.lastToken={style:c,content:a.current()},"space"===c&&(c=null),c},indent:function(b,c){var d=c.replace(/^\s+|\s+$/g,"");return d.match(L)||d.match(M)||d.match(K)?a.indentUnit*(b.currentIndent-1):b.currentIndent<0?0:b.currentIndent*a.indentUnit}};return Q}),a.defineMIME("text/vbscript","vbscript")});