diff options
author | Valerio Virgillito | 2012-05-03 16:08:49 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-03 16:08:49 -0700 |
commit | 0e1c87871489c1d5d8deb609174d8876eb579169 (patch) | |
tree | f37c26fbab9151e6c4f50e3e786bdc96b9960014 /imports/codemirror/mode/vbscript/vbscript.js | |
parent | eb17fe1bbd05ad260e8a56918a3b396a03767e04 (diff) | |
parent | 01ecdc4bda1aff7d39f429c76e57b10af6079c53 (diff) | |
download | ninja-0e1c87871489c1d5d8deb609174d8876eb579169.tar.gz |
Merge pull request #192 from ananyasen/Codeview-improvements
submitting project : Code Editor Improvements [Phase 1]
Diffstat (limited to 'imports/codemirror/mode/vbscript/vbscript.js')
-rw-r--r-- | imports/codemirror/mode/vbscript/vbscript.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/imports/codemirror/mode/vbscript/vbscript.js b/imports/codemirror/mode/vbscript/vbscript.js new file mode 100644 index 00000000..65d6c212 --- /dev/null +++ b/imports/codemirror/mode/vbscript/vbscript.js | |||
@@ -0,0 +1,26 @@ | |||
1 | CodeMirror.defineMode("vbscript", function() { | ||
2 | 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; | ||
3 | |||
4 | return { | ||
5 | token: function(stream) { | ||
6 | if (stream.eatSpace()) return null; | ||
7 | var ch = stream.next(); | ||
8 | if (ch == "'") { | ||
9 | stream.skipToEnd(); | ||
10 | return "comment"; | ||
11 | } | ||
12 | if (ch == '"') { | ||
13 | stream.skipTo('"'); | ||
14 | return "string"; | ||
15 | } | ||
16 | |||
17 | if (/\w/.test(ch)) { | ||
18 | stream.eatWhile(/\w/); | ||
19 | if (regexVBScriptKeyword.test(stream.current())) return "keyword"; | ||
20 | } | ||
21 | return null; | ||
22 | } | ||
23 | }; | ||
24 | }); | ||
25 | |||
26 | CodeMirror.defineMIME("text/vbscript", "vbscript"); | ||