物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
5.7 KiB

function p(h){var s="error";function a(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}var f=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),y=new RegExp("^((<>)|(<=)|(>=))"),g=new RegExp("^[\\.,]"),x=new RegExp("^[\\(\\)]"),k=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),w=["class","sub","select","while","if","function","property","with","for"],I=["else","elseif","case"],C=["next","loop","wend"],L=a(["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"],D=["true","false","nothing","empty","null"],E=["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"],O=["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"],o=["WScript","err","debug","RegExp"],z=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],R=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],T=["server","response","request","session","application"],j=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],F=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],c=R.concat(z);o=o.concat(O),h.isASP&&(o=o.concat(T),c=c.concat(F,j));var A=a(S),B=a(D),N=a(E),W=a(o),q=a(c),K='"',M=a(w),u=a(I),v=a(C),d=a(["end"]),Y=a(["do"]),H=a(["on error resume next","exit"]),J=a(["rem"]);function m(e,t){t.currentIndent++}function b(e,t){t.currentIndent--}function l(e,t){if(e.eatSpace())return null;var r=e.peek();if(r==="'"||e.match(J))return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var n=!1;if((e.match(/^\d*\.\d+/i)||e.match(/^\d+\.\d*/)||e.match(/^\.\d+/))&&(n=!0),n)return e.eat(/J/i),"number";var i=!1;if(e.match(/^&H[0-9a-f]+/i)||e.match(/^&O[0-7]+/i)?i=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),i=!0):e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}return e.match(K)?(t.tokenize=P(e.current()),t.tokenize(e,t)):e.match(y)||e.match(f)||e.match(L)?"operator":e.match(g)?null:e.match(x)?"bracket":e.match(H)?(t.doInCurrentLine=!0,"keyword"):e.match(Y)?(m(e,t),t.doInCurrentLine=!0,"keyword"):e.match(M)?(t.doInCurrentLine?t.doInCurrentLine=!1:m(e,t),"keyword"):e.match(u)?"keyword":e.match(d)?(b(e,t),b(e,t),"keyword"):e.match(v)?(t.doInCurrentLine?t.doInCurrentLine=!1:b(e,t),"keyword"):e.match(A)?"keyword":e.match(B)?"atom":e.match(q)?"variableName.special":e.match(N)||e.match(W)?"builtin":e.match(k)?"variable":(e.next(),s)}function P(e){var t=e.length==1,r="string";return function(n,i){for(;!n.eol();){if(n.eatWhile(/[^'"]/),n.match(e))return i.tokenize=l,r;n.eat(/['"]/)}return t&&(i.tokenize=l),r}}function V(e,t){var r=t.tokenize(e,t),n=e.current();return n==="."?(r=t.tokenize(e,t),n=e.current(),r&&(r.substr(0,8)==="variable"||r==="builtin"||r==="keyword")?((r==="builtin"||r==="keyword")&&(r="variable"),c.indexOf(n.substr(1))>-1&&(r="keyword"),r):s):r}return{name:"vbscript",startState:function(){return{tokenize:l,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var r=V(e,t);return t.lastToken={style:r,content:e.current()},r===null&&(r=null),r},indent:function(e,t,r){var n=t.replace(/^\s+|\s+$/g,"");return n.match(v)||n.match(d)||n.match(u)?r.unit*(e.currentIndent-1):e.currentIndent<0?0:e.currentIndent*r.unit}}}const U=p({}),_=p({isASP:!0});export{U as vbScript,_ as vbScriptASP};