var c="error";function a(e){return RegExp("^(("+e.join(")|(")+"))\\b","i")}var v=RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),k=RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),x=RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),w=RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),I=RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),z=RegExp("^[_A-Za-z][_A-Za-z0-9]*"),u=["class","module","sub","enum","select","while","if","function","get","set","property","try","structure","synclock","using","with"],d=["else","elseif","case","catch","finally"],m=["next","loop"],h=["and","andalso","or","orelse","xor","in","not","is","isnot","like"],E=a(h),f="#const.#else.#elseif.#end.#if.#region.addhandler.addressof.alias.as.byref.byval.cbool.cbyte.cchar.cdate.cdbl.cdec.cint.clng.cobj.compare.const.continue.csbyte.cshort.csng.cstr.cuint.culng.cushort.declare.default.delegate.dim.directcast.each.erase.error.event.exit.explicit.false.for.friend.gettype.goto.handles.implements.imports.infer.inherits.interface.isfalse.istrue.lib.me.mod.mustinherit.mustoverride.my.mybase.myclass.namespace.narrowing.new.nothing.notinheritable.notoverridable.of.off.on.operator.option.optional.out.overloads.overridable.overrides.paramarray.partial.private.protected.public.raiseevent.readonly.redim.removehandler.resume.return.shadows.shared.static.step.stop.strict.then.throw.to.true.trycast.typeof.until.until.when.widening.withevents.writeonly".split("."),p="object.boolean.char.string.byte.sbyte.short.ushort.int16.uint16.integer.uinteger.int32.uint32.long.ulong.int64.uint64.decimal.single.double.float.date.datetime.intptr.uintptr".split("."),L=a(f),R=a(p),C='"',O=a(u),g=a(d),b=a(m),y=a(["end"]),T=a(["do"]),F=null;function s(e,n){n.currentIndent++}function o(e,n){n.currentIndent--}function l(e,n){if(e.eatSpace())return null;if(e.peek()==="'")return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var r=!1;if((e.match(/^\d*\.\d+F?/i)||e.match(/^\d+\.\d*F?/)||e.match(/^\.\d+F?/))&&(r=!0),r)return e.eat(/J/i),"number";var t=!1;if(e.match(/^&H[0-9a-f]+/i)||e.match(/^&O[0-7]+/i)?t=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),t=!0):e.match(/^0(?![\dx])/i)&&(t=!0),t)return e.eat(/L/i),"number"}return e.match(C)?(n.tokenize=j(e.current()),n.tokenize(e,n)):e.match(I)||e.match(w)?null:e.match(x)||e.match(v)||e.match(E)?"operator":e.match(k)?null:e.match(T)?(s(e,n),n.doInCurrentLine=!0,"keyword"):e.match(O)?(n.doInCurrentLine?n.doInCurrentLine=!1:s(e,n),"keyword"):e.match(g)?"keyword":e.match(y)?(o(e,n),o(e,n),"keyword"):e.match(b)?(o(e,n),"keyword"):e.match(R)||e.match(L)?"keyword":e.match(z)?"variable":(e.next(),c)}function j(e){var n=e.length==1,r="string";return function(t,i){for(;!t.eol();){if(t.eatWhile(/[^'"]/),t.match(e))return i.tokenize=l,r;t.eat(/['"]/)}return n&&(i.tokenize=l),r}}function S(e,n){var r=n.tokenize(e,n),t=e.current();if(t===".")return r=n.tokenize(e,n),r==="variable"?"variable":c;var i="[({".indexOf(t);return i!==-1&&s(e,n),F==="dedent"&&o(e,n)||(i="])}".indexOf(t),i!==-1&&o(e,n))?c:r}const _={name:"vb",startState:function(){return{tokenize:l,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,n){e.sol()&&(n.currentIndent+=n.nextLineIndent,n.nextLineIndent=0,n.doInCurrentLine=0);var r=S(e,n);return n.lastToken={style:r,content:e.current()},r},indent:function(e,n,r){var t=n.replace(/^\s+|\s+$/g,"");return t.match(b)||t.match(y)||t.match(g)?r.unit*(e.currentIndent-1):e.currentIndent<0?0:e.currentIndent*r.unit},languageData:{closeBrackets:{brackets:["(","[","{",'"']},commentTokens:{line:"'"},autocomplete:u.concat(d).concat(m).concat(h).concat(f).concat(p)}};export{_ as t};
