Sha256: 7c2f9dff457740aec4179176fd6455d4a4ec2108ee1105c0d8c40170914a2296

Contents?: true

Size: 871 Bytes

Versions: 9

Compression:

Stored size: 871 Bytes

Contents

CodeMirror.defineMode("vbscript", function() {
  var regexVBScriptKeyword = /^(?:Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|UCase|Until|VbCr|VbCrLf|VbLf|VbTab)$/im;

  return {
    token: function(stream) {
      if (stream.eatSpace()) return null;
      var ch = stream.next();
      if (ch == "'") {
        stream.skipToEnd();
        return "comment";
      }
      if (ch == '"') {
        stream.skipTo('"');
        return "string";
      }

      if (/\w/.test(ch)) {
        stream.eatWhile(/\w/);
        if (regexVBScriptKeyword.test(stream.current())) return "keyword";
      }
      return null;
    }
  };
});

CodeMirror.defineMIME("text/vbscript", "vbscript");

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
mdbe-0.1.0 public/libs/codemirror/mode/vbscript/vbscript.js
codemirror-rails-3.14 vendor/assets/javascripts/codemirror/modes/vbscript.js
maglev-database-explorer-0.0.5 public/libs/codemirror/mode/vbscript/vbscript.js
maglev-database-explorer-0.0.4 public/libs/codemirror/mode/vbscript/vbscript.js
maglev-database-explorer-0.0.3 public/libs/codemirror/mode/vbscript/vbscript.js
maglev-database-explorer-0.0.2 public/libs/codemirror/mode/vbscript/vbscript.js
maglev-database-explorer-0.0.1 public/libs/codemirror/mode/vbscript/vbscript.js
codemirror-rails-3.13 vendor/assets/javascripts/codemirror/modes/vbscript.js
codemirror-rails-3.12 vendor/assets/javascripts/codemirror/modes/vbscript.js