]> luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/vbscript.js
Initial commit.
[flow-web.git] / static / highlight / es / languages / vbscript.js
1 /*! `vbscript` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar = (function () {
3 'use strict';
4
5 /*
6 Language: VBScript
7 Description: VBScript ("Microsoft Visual Basic Scripting Edition") is an Active Scripting language developed by Microsoft that is modeled on Visual Basic.
8 Author: Nikita Ledyaev <lenikita@yandex.ru>
9 Contributors: Michal Gabrukiewicz <mgabru@gmail.com>
10 Website: https://en.wikipedia.org/wiki/VBScript
11 Category: scripting
12 */
13
14 /** @type LanguageFn */
15 function vbscript(hljs) {
16 const regex = hljs.regex;
17 const BUILT_IN_FUNCTIONS = [
18 "lcase",
19 "month",
20 "vartype",
21 "instrrev",
22 "ubound",
23 "setlocale",
24 "getobject",
25 "rgb",
26 "getref",
27 "string",
28 "weekdayname",
29 "rnd",
30 "dateadd",
31 "monthname",
32 "now",
33 "day",
34 "minute",
35 "isarray",
36 "cbool",
37 "round",
38 "formatcurrency",
39 "conversions",
40 "csng",
41 "timevalue",
42 "second",
43 "year",
44 "space",
45 "abs",
46 "clng",
47 "timeserial",
48 "fixs",
49 "len",
50 "asc",
51 "isempty",
52 "maths",
53 "dateserial",
54 "atn",
55 "timer",
56 "isobject",
57 "filter",
58 "weekday",
59 "datevalue",
60 "ccur",
61 "isdate",
62 "instr",
63 "datediff",
64 "formatdatetime",
65 "replace",
66 "isnull",
67 "right",
68 "sgn",
69 "array",
70 "snumeric",
71 "log",
72 "cdbl",
73 "hex",
74 "chr",
75 "lbound",
76 "msgbox",
77 "ucase",
78 "getlocale",
79 "cos",
80 "cdate",
81 "cbyte",
82 "rtrim",
83 "join",
84 "hour",
85 "oct",
86 "typename",
87 "trim",
88 "strcomp",
89 "int",
90 "createobject",
91 "loadpicture",
92 "tan",
93 "formatnumber",
94 "mid",
95 "split",
96 "cint",
97 "sin",
98 "datepart",
99 "ltrim",
100 "sqr",
101 "time",
102 "derived",
103 "eval",
104 "date",
105 "formatpercent",
106 "exp",
107 "inputbox",
108 "left",
109 "ascw",
110 "chrw",
111 "regexp",
112 "cstr",
113 "err"
114 ];
115 const BUILT_IN_OBJECTS = [
116 "server",
117 "response",
118 "request",
119 // take no arguments so can be called without ()
120 "scriptengine",
121 "scriptenginebuildversion",
122 "scriptengineminorversion",
123 "scriptenginemajorversion"
124 ];
125
126 const BUILT_IN_CALL = {
127 begin: regex.concat(regex.either(...BUILT_IN_FUNCTIONS), "\\s*\\("),
128 // relevance 0 because this is acting as a beginKeywords really
129 relevance: 0,
130 keywords: { built_in: BUILT_IN_FUNCTIONS }
131 };
132
133 const LITERALS = [
134 "true",
135 "false",
136 "null",
137 "nothing",
138 "empty"
139 ];
140
141 const KEYWORDS = [
142 "call",
143 "class",
144 "const",
145 "dim",
146 "do",
147 "loop",
148 "erase",
149 "execute",
150 "executeglobal",
151 "exit",
152 "for",
153 "each",
154 "next",
155 "function",
156 "if",
157 "then",
158 "else",
159 "on",
160 "error",
161 "option",
162 "explicit",
163 "new",
164 "private",
165 "property",
166 "let",
167 "get",
168 "public",
169 "randomize",
170 "redim",
171 "rem",
172 "select",
173 "case",
174 "set",
175 "stop",
176 "sub",
177 "while",
178 "wend",
179 "with",
180 "end",
181 "to",
182 "elseif",
183 "is",
184 "or",
185 "xor",
186 "and",
187 "not",
188 "class_initialize",
189 "class_terminate",
190 "default",
191 "preserve",
192 "in",
193 "me",
194 "byval",
195 "byref",
196 "step",
197 "resume",
198 "goto"
199 ];
200
201 return {
202 name: 'VBScript',
203 aliases: [ 'vbs' ],
204 case_insensitive: true,
205 keywords: {
206 keyword: KEYWORDS,
207 built_in: BUILT_IN_OBJECTS,
208 literal: LITERALS
209 },
210 illegal: '//',
211 contains: [
212 BUILT_IN_CALL,
213 hljs.inherit(hljs.QUOTE_STRING_MODE, { contains: [ { begin: '""' } ] }),
214 hljs.COMMENT(
215 /'/,
216 /$/,
217 { relevance: 0 }
218 ),
219 hljs.C_NUMBER_MODE
220 ]
221 };
222 }
223
224 return vbscript;
225
226 })();
227 ;
228 export default hljsGrammar;