2014-07-16 06:07:18 -04:00
|
|
|
ace.define("ace/mode/vbscript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
2014-02-12 05:23:40 -05:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var oop = require("../lib/oop");
|
|
|
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
|
|
|
|
|
|
|
var VBScriptHighlightRules = function() {
|
|
|
|
|
|
|
|
this.$rules = {
|
|
|
|
"start": [
|
|
|
|
{
|
|
|
|
token: [
|
|
|
|
"meta.ending-space"
|
|
|
|
],
|
|
|
|
regex: "$"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: [
|
|
|
|
null
|
|
|
|
],
|
|
|
|
regex: "^(?=\\t)",
|
|
|
|
next: "state_3"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: [null],
|
|
|
|
regex: "^(?= )",
|
|
|
|
next: "state_4"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: [
|
|
|
|
"text",
|
|
|
|
"storage.type.function.asp",
|
|
|
|
"text",
|
|
|
|
"entity.name.function.asp",
|
|
|
|
"text",
|
|
|
|
"punctuation.definition.parameters.asp",
|
|
|
|
"variable.parameter.function.asp",
|
|
|
|
"punctuation.definition.parameters.asp"
|
|
|
|
],
|
|
|
|
regex: "^(\\s*)(Function|Sub)(\\s*)([a-zA-Z_]\\w*)(\\s*)(\\()([^)]*)(\\))"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "punctuation.definition.comment.asp",
|
|
|
|
regex: "'|REM",
|
2015-09-07 12:04:05 -04:00
|
|
|
next: "comment",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: [
|
|
|
|
"keyword.control.asp"
|
|
|
|
],
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:If|Then|Else|ElseIf|Else If|End If|While|Wend|For|To|Each|Case|Select|End Select|Return|Continue|Do|Until|Loop|Next|With|Exit Do|Exit For|Exit Function|Exit Property|Exit Sub|IIf)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "keyword.operator.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:Mod|And|Not|Or|Xor|as)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "storage.type.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "Dim|Call|Class|Const|Dim|Redim|Function|Sub|Private Sub|Public Sub|End sub|End Function|Set|Let|Get|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "storage.modifier.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:Private|Public|Default)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "constant.language.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:Empty|False|Nothing|Null|True)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "punctuation.definition.string.begin.asp",
|
|
|
|
regex: '"',
|
|
|
|
next: "string"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: [
|
|
|
|
"punctuation.definition.variable.asp"
|
|
|
|
],
|
|
|
|
regex: "(\\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b\\s*"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "support.class.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:Application|ObjectContext|Request|Response|Server|Session)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "support.class.collection.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "support.constant.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "support.function.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "support.function.event.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "support.function.vb.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: [
|
|
|
|
"constant.numeric.asp"
|
|
|
|
],
|
|
|
|
regex: "-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "support.type.vb.asp",
|
2015-09-07 12:04:05 -04:00
|
|
|
regex: "\\b(?:vbtrue|vbfalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|int32|vbtab|vbverticaltab|vbbinarycompare|vbtextcomparevbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant|vbDataObject|vbDecimal|vbByte|vbArray)\\b",
|
|
|
|
caseInsensitive: true
|
2014-02-12 05:23:40 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
token: [
|
|
|
|
"entity.name.function.asp"
|
|
|
|
],
|
|
|
|
regex: "(?:(\\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b)(?=\\(\\)?))"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: [
|
|
|
|
"keyword.operator.asp"
|
|
|
|
],
|
|
|
|
regex: "\\-|\\+|\\*\\\/|\\>|\\<|\\=|\\&"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"state_3": [
|
|
|
|
{
|
|
|
|
token: [
|
|
|
|
"meta.odd-tab.tabs",
|
|
|
|
"meta.even-tab.tabs"
|
|
|
|
],
|
|
|
|
regex: "(\\t)(\\t)?"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "meta.leading-space",
|
|
|
|
regex: "(?=[^\\t])",
|
|
|
|
next: "start"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "meta.leading-space",
|
|
|
|
regex: ".",
|
|
|
|
next: "state_3"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"state_4": [
|
|
|
|
{
|
|
|
|
token: ["meta.odd-tab.spaces", "meta.even-tab.spaces"],
|
|
|
|
regex: "( )( )?"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "meta.leading-space",
|
|
|
|
regex: "(?=[^ ])",
|
|
|
|
next: "start"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
defaultToken: "meta.leading-space"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"comment": [
|
|
|
|
{
|
|
|
|
token: "comment.line.apostrophe.asp",
|
|
|
|
regex: "$|(?=(?:%>))",
|
|
|
|
next: "start"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
defaultToken: "comment.line.apostrophe.asp"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"string": [
|
|
|
|
{
|
|
|
|
token: "constant.character.escape.apostrophe.asp",
|
|
|
|
regex: '""'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
token: "string.quoted.double.asp",
|
|
|
|
regex: '"',
|
|
|
|
next: "start"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
defaultToken: "string.quoted.double.asp"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
oop.inherits(VBScriptHighlightRules, TextHighlightRules);
|
|
|
|
|
|
|
|
exports.VBScriptHighlightRules = VBScriptHighlightRules;
|
2014-07-09 12:59:04 -04:00
|
|
|
});
|
|
|
|
|
2014-07-16 06:07:18 -04:00
|
|
|
ace.define("ace/mode/vbscript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vbscript_highlight_rules"], function(require, exports, module) {
|
2014-07-09 12:59:04 -04:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var oop = require("../lib/oop");
|
|
|
|
var TextMode = require("./text").Mode;
|
|
|
|
var VBScriptHighlightRules = require("./vbscript_highlight_rules").VBScriptHighlightRules;
|
|
|
|
|
|
|
|
var Mode = function() {
|
|
|
|
this.HighlightRules = VBScriptHighlightRules;
|
|
|
|
};
|
|
|
|
oop.inherits(Mode, TextMode);
|
|
|
|
|
|
|
|
(function() {
|
|
|
|
|
|
|
|
this.lineCommentStart = ["'", "REM"];
|
|
|
|
|
|
|
|
this.$id = "ace/mode/vbscript";
|
|
|
|
}).call(Mode.prototype);
|
|
|
|
|
|
|
|
exports.Mode = Mode;
|
|
|
|
});
|