openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

vb.min.js (3522B)


      1 (function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("vb",function(n,t){var i="error";function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")};var v=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),x=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),g=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),w=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),I=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),y=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),u=["class","module","sub","enum","select","while","if","function","get","set","property","try"],f=["else","elseif","case","catch"],d=["next","loop"],l=["and","or","not","xor","in"],E=r(l),s=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],m=["integer","string","double","decimal","boolean","short","char","float","single"],L=r(s),z=r(m),C="\"",R=r(u),h=r(f),p=r(d),b=r(["end"]),F=r(["do"]),M=null;e.registerHelper("hintWords","vb",u.concat(f).concat(d).concat(l).concat(s).concat(m));function a(e,n){n.currentIndent++};function o(e,n){n.currentIndent--};function c(e,n){if(e.eatSpace()){return null};var c=e.peek();if(c==="'"){e.skipToEnd();return"comment"};if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var r=!1;if(e.match(/^\d*\.\d+F?/i)){r=!0}
      2 else if(e.match(/^\d+\.\d*F?/)){r=!0}
      3 else if(e.match(/^\.\d+F?/)){r=!0};if(r){e.eat(/J/i);return"number"};var t=!1;if(e.match(/^&H[0-9a-f]+/i)){t=!0}
      4 else if(e.match(/^&O[0-7]+/i)){t=!0}
      5 else if(e.match(/^[1-9]\d*F?/)){e.eat(/J/i);t=!0}
      6 else if(e.match(/^0(?![\dx])/i)){t=!0};if(t){e.eat(/L/i);return"number"}};if(e.match(C)){n.tokenize=O(e.current());return n.tokenize(e,n)};if(e.match(I)||e.match(w)){return null};if(e.match(g)||e.match(v)||e.match(E)){return"operator"};if(e.match(x)){return null};if(e.match(F)){a(e,n);n.doInCurrentLine=!0;return"keyword"};if(e.match(R)){if(!n.doInCurrentLine)a(e,n);else n.doInCurrentLine=!1;return"keyword"};if(e.match(h)){return"keyword"};if(e.match(b)){o(e,n);o(e,n);return"keyword"};if(e.match(p)){o(e,n);return"keyword"};if(e.match(z)){return"keyword"};if(e.match(L)){return"keyword"};if(e.match(y)){return"variable"};e.next();return i};function O(e){var r=e.length==1,n="string";return function(o,a){while(!o.eol()){o.eatWhile(/[^'"]/);if(o.match(e)){a.tokenize=c;return n}
      7 else{o.eat(/['"]/)}};if(r){if(t.singleLineStringErrors){return i}
      8 else{a.tokenize=c}};return n}};function T(e,n){var r=n.tokenize(e,n),c=e.current();if(c==="."){r=n.tokenize(e,n);if(r==="variable"){return"variable"}
      9 else{return i}};var t="[({".indexOf(c);if(t!==-1){a(e,n)};if(M==="dedent"){if(o(e,n)){return i}};t="])}".indexOf(c);if(t!==-1){if(o(e,n)){return i}};return r};var k={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:c,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,n){if(e.sol()){n.currentIndent+=n.nextLineIndent;n.nextLineIndent=0;n.doInCurrentLine=0};var t=T(e,n);n.lastToken={style:t,content:e.current()};return t},indent:function(e,t){var r=t.replace(/^\s+|\s+$/g,"");if(r.match(p)||r.match(b)||r.match(h))return n.indentUnit*(e.currentIndent-1);if(e.currentIndent<0)return 0;return e.currentIndent*n.indentUnit},lineComment:"'"};return k});e.defineMIME("text/x-vb","vb")});