cleanup vbscrip mode
This commit is contained in:
parent
8b4c88d636
commit
0e9d413102
1 changed files with 29 additions and 59 deletions
|
|
@ -71,6 +71,7 @@ var VBScriptHighlightRules = function() {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: [
|
||||||
|
"text",
|
||||||
"storage.type.function.asp",
|
"storage.type.function.asp",
|
||||||
"text",
|
"text",
|
||||||
"entity.name.function.asp",
|
"entity.name.function.asp",
|
||||||
|
|
@ -79,7 +80,7 @@ var VBScriptHighlightRules = function() {
|
||||||
"variable.parameter.function.asp",
|
"variable.parameter.function.asp",
|
||||||
"punctuation.definition.parameters.asp"
|
"punctuation.definition.parameters.asp"
|
||||||
],
|
],
|
||||||
regex: "^\\s*((?:Function|Sub))(\\s*)([a-zA-Z_]\\w*)(\\s*)(\\()([^)]*)(\\)).*\\n?"
|
regex: "^(\\s*)(Function|Sub)(\\s*)([a-zA-Z_]\\w*)(\\s*)(\\()([^)]*)(\\))"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: "punctuation.definition.comment.asp",
|
token: "punctuation.definition.comment.asp",
|
||||||
|
|
@ -90,36 +91,26 @@ var VBScriptHighlightRules = function() {
|
||||||
token: [
|
token: [
|
||||||
"keyword.control.asp"
|
"keyword.control.asp"
|
||||||
],
|
],
|
||||||
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)"
|
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"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: "keyword.operator.asp",
|
||||||
"keyword.operator.asp"
|
regex: "\\b(?:Mod|And|Not|Or|Xor|as)\\b"
|
||||||
],
|
|
||||||
regex: "(?:\\b(Mod|And|Not|Or|Xor|as)\\b)"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: "storage.type.asp",
|
||||||
"storage.type.asp"
|
|
||||||
],
|
|
||||||
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"
|
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"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: "storage.modifier.asp",
|
||||||
"storage.modifier.asp"
|
regex: "\\b(?:Private|Public|Default)\\b"
|
||||||
],
|
|
||||||
regex: "(?:\\b(Private|Public|Default)\\b)"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: "constant.language.asp",
|
||||||
"constant.language.asp"
|
regex: "\\b(?:Empty|False|Nothing|Null|True)\\b"
|
||||||
],
|
|
||||||
regex: "(?:\\s*\\b(Empty|False|Nothing|Null|True)\\b)"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: "punctuation.definition.string.begin.asp",
|
||||||
"punctuation.definition.string.begin.asp"
|
|
||||||
],
|
|
||||||
regex: '"',
|
regex: '"',
|
||||||
next: "string"
|
next: "string"
|
||||||
},
|
},
|
||||||
|
|
@ -130,34 +121,24 @@ var VBScriptHighlightRules = function() {
|
||||||
regex: "(\\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b\\s*"
|
regex: "(\\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b\\s*"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: "support.class.asp",
|
||||||
"support.class.asp"
|
regex: "\\b(?:Application|ObjectContext|Request|Response|Server|Session)\\b"
|
||||||
],
|
|
||||||
regex: "(?:\\b(Application|ObjectContext|Request|Response|Server|Session)\\b)"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: "support.class.collection.asp",
|
||||||
"support.class.collection.asp"
|
regex: "\\b(?:Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\\b"
|
||||||
],
|
|
||||||
regex: "(?:\\b(Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\\b)"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: "support.constant.asp",
|
||||||
"support.constant.asp"
|
regex: "\\b(?:TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\\b"
|
||||||
],
|
|
||||||
regex: "(?:\\b(TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\\b)"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: "support.function.asp",
|
||||||
"support.function.asp"
|
regex: "\\b(?:Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\\b"
|
||||||
],
|
|
||||||
regex: "(?:\\b(Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\\b)"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: "support.function.event.asp",
|
||||||
"support.function.event.asp"
|
regex: "\\b(?:Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\\b"
|
||||||
],
|
|
||||||
regex: "(?:\\b(Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\\b)"
|
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// token: [
|
// token: [
|
||||||
|
|
@ -166,10 +147,8 @@ var VBScriptHighlightRules = function() {
|
||||||
// regex: "(?:(?<=as )(\\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b))", // ERROR: This contains a lookbehind, which JS does not support :("
|
// regex: "(?:(?<=as )(\\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b))", // ERROR: This contains a lookbehind, which JS does not support :("
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
token: [
|
token: "support.function.vb.asp",
|
||||||
"support.function.vb.asp"
|
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"
|
||||||
],
|
|
||||||
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)"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: [
|
||||||
|
|
@ -178,10 +157,8 @@ var VBScriptHighlightRules = function() {
|
||||||
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"
|
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: [
|
token: "support.type.vb.asp",
|
||||||
"support.type.vb.asp"
|
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"
|
||||||
],
|
|
||||||
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)"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: [
|
token: [
|
||||||
|
|
@ -223,10 +200,7 @@ var VBScriptHighlightRules = function() {
|
||||||
],
|
],
|
||||||
"state_4": [
|
"state_4": [
|
||||||
{
|
{
|
||||||
token: [
|
token: ["meta.odd-tab.spaces", "meta.even-tab.spaces"],
|
||||||
"meta.odd-tab.spaces",
|
|
||||||
"meta.even-tab.spaces"
|
|
||||||
],
|
|
||||||
regex: "( )( )?"
|
regex: "( )( )?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -235,9 +209,7 @@ var VBScriptHighlightRules = function() {
|
||||||
next: "start"
|
next: "start"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: "meta.leading-space",
|
defaultToken: "meta.leading-space"
|
||||||
regex: ".",
|
|
||||||
next: "state_4"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"comment": [
|
"comment": [
|
||||||
|
|
@ -247,8 +219,7 @@ var VBScriptHighlightRules = function() {
|
||||||
next: "start"
|
next: "start"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: "comment.line.apostrophe.asp",
|
defaultToken: "comment.line.apostrophe.asp"
|
||||||
regex: "."
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"string": [
|
"string": [
|
||||||
|
|
@ -262,8 +233,7 @@ var VBScriptHighlightRules = function() {
|
||||||
next: "start"
|
next: "start"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
token: "string.quoted.double.asp",
|
defaultToken: "string.quoted.double.asp"
|
||||||
regex: "."
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue