%PDF- %PDF-
Direktori : /home1/lightco1/www/aldobernardi.com.au/media/editors/codemirror/mode/vb/ |
Current File : //home1/lightco1/www/aldobernardi.com.au/media/editors/codemirror/mode/vb/vb.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("vb",function(b,c){function d(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function e(a,b){b.currentIndent++}function f(a,b){b.currentIndent--}function g(a,b){if(a.eatSpace())return null;var c=a.peek();if("'"===c)return a.skipToEnd(),"comment";if(a.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var d=!1;if(a.match(/^\d*\.\d+F?/i)?d=!0:a.match(/^\d+\.\d*F?/)?d=!0:a.match(/^\.\d+F?/)&&(d=!0),d)return a.eat(/J/i),"number";var g=!1;if(a.match(/^&H[0-9a-f]+/i)?g=!0:a.match(/^&O[0-7]+/i)?g=!0:a.match(/^[1-9]\d*F?/)?(a.eat(/J/i),g=!0):a.match(/^0(?![\dx])/i)&&(g=!0),g)return a.eat(/L/i),"number"}return a.match(z)?(b.tokenize=h(a.current()),b.tokenize(a,b)):a.match(o)||a.match(n)?null:a.match(m)||a.match(k)||a.match(u)?"operator":a.match(l)?null:a.match(E)?(e(a,b),b.doInCurrentLine=!0,"keyword"):a.match(A)?(b.doInCurrentLine?b.doInCurrentLine=!1:e(a,b),"keyword"):a.match(B)?"keyword":a.match(D)?(f(a,b),f(a,b),"keyword"):a.match(C)?(f(a,b),"keyword"):a.match(y)?"keyword":a.match(x)?"keyword":a.match(p)?"variable":(a.next(),j)}function h(a){var b=1==a.length,d="string";return function(e,f){for(;!e.eol();){if(e.eatWhile(/[^'"]/),e.match(a))return f.tokenize=g,d;e.eat(/['"]/)}if(b){if(c.singleLineStringErrors)return j;f.tokenize=g}return d}}function i(a,b){var c=b.tokenize(a,b),d=a.current();if("."===d)return c=b.tokenize(a,b),d=a.current(),"variable"===c?"variable":j;var g="[({".indexOf(d);return-1!==g&&e(a,b),"dedent"===F&&f(a,b)?j:(g="])}".indexOf(d),-1!==g&&f(a,b)?j:c)}var j="error",k=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),l=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),m=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),n=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),o=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),p=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),q=["class","module","sub","enum","select","while","if","function","get","set","property","try"],r=["else","elseif","case","catch"],s=["next","loop"],t=["and","or","not","xor","in"],u=d(t),v=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],w=["integer","string","double","decimal","boolean","short","char","float","single"],x=d(v),y=d(w),z='"',A=d(q),B=d(r),C=d(s),D=d(["end"]),E=d(["do"]),F=null;a.registerHelper("hintWords","vb",q.concat(r).concat(s).concat(t).concat(v).concat(w));var G={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:g,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(a,b){a.sol()&&(b.currentIndent+=b.nextLineIndent,b.nextLineIndent=0,b.doInCurrentLine=0);var c=i(a,b);return b.lastToken={style:c,content:a.current()},c},indent:function(a,c){var d=c.replace(/^\s+|\s+$/g,"");return d.match(C)||d.match(D)||d.match(B)?b.indentUnit*(a.currentIndent-1):a.currentIndent<0?0:a.currentIndent*b.indentUnit},lineComment:"'"};return G}),a.defineMIME("text/x-vb","vb")});