forked from SublimeText/VBScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVBScript.sublime-syntax
More file actions
125 lines (125 loc) · 6.46 KB
/
Copy pathVBScript.sublime-syntax
File metadata and controls
125 lines (125 loc) · 6.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: VBScript
comment: Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com
file_extensions:
- vbs
- vba
- bas
- vbe
- wsf
- wsc
- acm
- acr
- acf
scope: source.vbs
contexts:
main:
- match: \n
scope: meta.ending-space
- include: round-brackets
- match: ^(?=\t)
push:
- meta_scope: meta.leading-space
- match: '(?=[^\t])'
pop: true
- match: (\t)(\t)?
captures:
1: meta.odd-tab.tabs
2: meta.even-tab.tabs
- match: ^(?= )
push:
- meta_scope: meta.leading-space
- match: "(?=[^ ])"
pop: true
- match: ( )( )?
captures:
1: meta.odd-tab.spaces
2: meta.even-tab.spaces
- match: '^\s*((?i:function|sub|public sub|private sub|public function|private function))\s*([a-zA-Z_]\w*)\s*(\()([^)]*)(\)).*\n?'
scope: meta.function.asp
captures:
1: storage.type.function.asp
2: entity.name.function.asp
3: punctuation.definition.parameters.asp
4: variable.parameter.function.asp
5: punctuation.definition.parameters.asp
- match: '(''|(?i:Rem)\s{1,})'
captures:
0: punctuation.definition.comment.asp
push:
- meta_scope: comment.line.apostrophe.asp
- match: \n
scope: comment.line.apostrophe.asp
pop: true
- match: (?=%>)
pop: true
- match: (?i:\b(If|Then|Else|ElseIf|Else If|End If|While|Wend|For|To|Each|In|Step|Case|Select|End Select|Return|Continue|Do|Until|Loop|Next|With|End With|Exit Do|Exit For|Exit Function|Exit Property|Exit Sub|IIf)\b)
scope: keyword.control.asp
- match: (?i:\b(Mod|And|Not|Is|Or|Xor|as)\b)
scope: keyword.operator.asp
- match: '(?i:(dim)\s*(?:(\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b)\s*(,?)))'
scope: variable.other.dim.asp
captures:
1: storage.type.asp
2: variable.other.bfeac.asp
3: meta.separator.comma.asp
- match: (?i:\s*\b(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|ByRef|ByVal|Public Function|Private Function|Preserve)\b\s*)
scope: storage.type.asp
- match: (?i:\b(Private|Public|Default)\b)
scope: storage.modifier.asp
- match: (?i:\s*\b(Empty|False|Nothing|Null|True)\b)
scope: constant.language.asp
- match: '"'
captures:
0: punctuation.definition.string.begin.asp
push:
- meta_scope: string.quoted.double.asp
- match: '"'
captures:
0: punctuation.definition.string.end.asp
pop: true
- match: '""'
scope: constant.character.escape.apostrophe.asp
- match: '(\$)[a-zA-Z_xf-xff][a-zA-Z0-9_xf-xff]*?\b\s*'
scope: variable.other.asp
captures:
1: punctuation.definition.variable.asp
- match: (?i:\b(Application|ObjectContext|Request|Response|Server|Session)\b)
scope: support.class.asp
- match: (?i:\b(Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\b)
scope: support.class.collection.asp
- match: (?i:\b(TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\b)
scope: support.constant.asp
- match: (?i:\b(Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\b)
scope: support.function.asp
- match: (?i:\b(Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\b)
scope: support.function.event.asp
- match: '(?i:(?<=as )(\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b))'
scope: support.type.vb.asp
- match: (?i:\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)
scope: support.function.vb.asp
- match: '-?\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'
scope: constant.numeric.asp
- match: (?i:\s*\b(vbtrue|vbfalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|int32|vbtab|vbverticaltab|vbbinarycompare|vbtextcompare|vbsunday|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\s*)
scope: support.type.vb.asp
- match: '(?i:(\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b)(?=\(\)?))'
scope: support.function.asp
captures:
1: entity.name.function.asp
- match: '(?i:((?<=(\+|=|-|\&|\\|/|<|>|\(|,))\s*\b([a-zA-Z_xf-xff][a-zA-Z0-9_xf-xff]*?)\b(?!(\(|\.))|\b([a-zA-Z_xf-xff][a-zA-Z0-9_xf-xff]*?)\b(?=\s*(\+|=|-|\&|\\|/|<|>|\(|\)))))'
scope: variable.other.asp
- match: '!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|/=|%=|\+=|\-=|&=|\^=|\b(in|instanceof|new|delete|typeof|void)\b'
scope: keyword.operator.js
round-brackets:
- match: \(
captures:
0: punctuation.section.round-brackets.begin.asp
push:
- meta_scope: meta.round-brackets
- match: \)
captures:
0: punctuation.section.round-brackets.end.asp
pop: true
- include: scope:source.vbs