cleanup and fix comments

This commit is contained in:
nightwing 2012-12-28 02:06:53 +04:00
commit b4243b9f07

View file

@ -26,35 +26,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*
* Contributor(s):
*
*
*
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
/* /*
THIS FILE WAS AUTOGENERATED BY mode_highlight_rules.tmpl.js (UUID: 7F9C9343-D48E-4E7D-BFE8-F680714DCD3E) */ THIS FILE WAS AUTOGENERATED BY mode_highlight_rules.tmpl.js (UUID: 7F9C9343-D48E-4E7D-BFE8-F680714DCD3E) */
/*******
THIS FILE MIGHT NOT BE PERFECT, PARTICULARLY:
IN DECIDING STATES TO TRANSITION TO,
IGNORING WHITESPACE,
IGNORING GROUPS WITH ?:,
EXTENDING EXISTING MODES,
GATHERING KEYWORDS, OR
RULE PREFERENCE ORDER.
...But it's a good start from an existing *.tmlanguage file.
*******/
define(function(require, exports, module) { define(function(require, exports, module) {
"use strict"; "use strict";
@ -67,37 +43,34 @@ var VBScriptHighlightRules = function() {
// regexp must not have capturing parentheses. Use (?:) instead. // regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
this.$rules = this.$rules = {
{
"start": [ "start": [
{ {
"token": [ token: [
"meta.ending-space" "meta.ending-space"
], ],
"regex": "$" regex: "$"
}, },
// { // {
// "token": [ // token: [
// "#round-brackets" // "#round-brackets"
// ], // ],
// "regex": "" // regex: ""
// }, // },
{ {
"token": [ token: [
null null
], ],
"regex": "^(?=\\t)", regex: "^(?=\\t)",
"next": "state_3" next: "state_3"
}, },
{ {
"token": [ token: [null],
null regex: "^(?= )",
], next: "state_4"
"regex": "^(?= )",
"next": "state_4"
}, },
{ {
"token": [ token: [
"storage.type.function.asp", "storage.type.function.asp",
"text", "text",
"entity.name.function.asp", "entity.name.function.asp",
@ -106,210 +79,195 @@ 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*)(\\()([^)]*)(\\)).*\\n?"
}, },
{ {
"token": [ token: "punctuation.definition.comment.asp",
"punctuation.definition.comment.asp" regex: "'|REM",
], next: "comment"
"regex": "('|REM)",
"next": "state_6"
}, },
{ {
"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": "(?:\\s*\\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": "state_13" next: "string"
}, },
{ {
"token": [ token: [
"punctuation.definition.variable.asp" "punctuation.definition.variable.asp"
], ],
"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|BianryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\\b)" regex: "(?:\\b(Lock|Unlock|SetAbort|SetComplete|BianryRead|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: [
// "support.type.vb.asp" // "support.type.vb.asp"
// ], // ],
// "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: [
"constant.numeric.asp" "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" 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|fvbalse|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|fvbalse|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: [
"entity.name.function.asp" "entity.name.function.asp"
], ],
"regex": "(?:(\\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b)(?=\\(\\)?))" regex: "(?:(\\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b)(?=\\(\\)?))"
}, },
// { // {
// "token": [ // token: [
// "variable.other.asp" // "variable.other.asp"
// ], // ],
// "regex": "(?:((?<=(\\+|=|-|\\&|\\\\|/|<|>|\\(|,))\\s*\\b([a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?)\\b(?!(\\(|\\.))|\\b([a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?)\\b(?=\\s*(\\+|=|-|\\&|\\\\|/|<|>|\\(|\\)))))", // ERROR: This contains a lookbehind, which JS does not support :(" // regex: "(?:((?<=(\\+|=|-|\\&|\\\\|/|<|>|\\(|,))\\s*\\b([a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?)\\b(?!(\\(|\\.))|\\b([a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?)\\b(?=\\s*(\\+|=|-|\\&|\\\\|/|<|>|\\(|\\)))))", // ERROR: This contains a lookbehind, which JS does not support :("
// }, // },
{ {
"token": [ token: [
"keyword.operator.asp" "keyword.operator.asp"
], ],
"regex": "\\-|\\+|\\*\\\/|\\>|\\<|\\=|\\&" regex: "\\-|\\+|\\*\\\/|\\>|\\<|\\=|\\&"
} }
], ],
"state_3": [ "state_3": [
{ {
"token": [ token: [
"meta.odd-tab.tabs", "meta.odd-tab.tabs",
"meta.even-tab.tabs" "meta.even-tab.tabs"
], ],
"regex": "(\\t)(\\t)?" regex: "(\\t)(\\t)?"
}, },
{ {
"token": "meta.leading-space", token: "meta.leading-space",
"regex": "(?=[^\\t])", regex: "(?=[^\\t])",
"merge": true, next: "start"
"next": "start"
}, },
{ {
"token": "meta.leading-space", token: "meta.leading-space",
"regex": ".", regex: ".",
"merge": true, next: "state_3"
"next": "state_3"
} }
], ],
"state_4": [ "state_4": [
{ {
"token": [ token: [
"meta.odd-tab.spaces", "meta.odd-tab.spaces",
"meta.even-tab.spaces" "meta.even-tab.spaces"
], ],
"regex": "( )( )?" regex: "( )( )?"
}, },
{ {
"token": "meta.leading-space", token: "meta.leading-space",
"regex": "(?=[^ ])", regex: "(?=[^ ])",
"merge": true, next: "start"
"next": "start"
}, },
{ {
"token": "meta.leading-space", token: "meta.leading-space",
"regex": ".", regex: ".",
"merge": true, next: "state_4"
"next": "state_4"
} }
], ],
"state_6": [ "comment": [
{ {
"token": "comment.line.apostrophe.asp", token: "comment.line.apostrophe.asp",
"regex": "(?=(?:$|%>))", regex: "$|(?=(?:%>))",
"merge": true, next: "start"
"next": "start"
}, },
{ {
"token": "comment.line.apostrophe.asp", token: "comment.line.apostrophe.asp",
"regex": ".", regex: ".",
"merge": true,
"next": "state_6"
} }
], ],
"state_13": [ "string": [
{ {
"token": "constant.character.escape.apostrophe.asp", token: "constant.character.escape.apostrophe.asp",
"regex": "\"\"" regex: '""'
}, },
{ {
"token": "string.quoted.double.asp", token: "string.quoted.double.asp",
"regex": "\"", regex: '"',
"merge": true, next: "start"
"next": "start"
}, },
{ {
"token": "string.quoted.double.asp", token: "string.quoted.double.asp",
"regex": ".", regex: "."
"merge": true,
"next": "state_13"
} }
] ]
} }
/*** START REPOSITORY RULES
[object Object]
END REPOSITORY RULES ***/
}; };
oop.inherits(VBScriptHighlightRules, TextHighlightRules); oop.inherits(VBScriptHighlightRules, TextHighlightRules);