@aiao/code-editor 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apl-B2DGVGxc.js +76 -0
- package/dist/asciiarmor-2LVJmxlE.js +34 -0
- package/dist/asn1-jKiBa2Ya.js +95 -0
- package/dist/asterisk-DS281yxp.js +271 -0
- package/dist/brainfuck-C_p9pTT8.js +34 -0
- package/dist/clike-BMALKCNj.js +620 -0
- package/dist/clojure-CCKyeQKf.js +800 -0
- package/dist/cmake-CuaCgAKt.js +28 -0
- package/dist/cobol-BlTKFDRj.js +72 -0
- package/dist/coffeescript-BVCvwO8I.js +179 -0
- package/dist/commonlisp-D_kxz07b.js +75 -0
- package/dist/crystal-D309uH6_.js +217 -0
- package/dist/css-BkF-NPzE.js +1553 -0
- package/dist/cypher-BMq4Fwjl.js +68 -0
- package/dist/d-BZcgY6La.js +127 -0
- package/dist/diff-Cg9d_RX2.js +18 -0
- package/dist/dockerfile-DFX8bq9N.js +194 -0
- package/dist/dtd-CtLokQ-U.js +84 -0
- package/dist/dylan-QYeExnWK.js +234 -0
- package/dist/ebnf-DUPDuY4r.js +78 -0
- package/dist/ecl-CiXN-g_D.js +121 -0
- package/dist/eiffel-yQhjl4T1.js +110 -0
- package/dist/elm-CNT9vbN0.js +108 -0
- package/dist/erlang-CFOYdy9e.js +487 -0
- package/dist/factor-Clf6BoVk.js +65 -0
- package/dist/fcl-CPC2WYrI.js +103 -0
- package/dist/forth-BmxRyE9S.js +60 -0
- package/dist/fortran-9bvPyrOW.js +442 -0
- package/dist/gas-cpmYfFX2.js +183 -0
- package/dist/gherkin-CJuwpceU.js +34 -0
- package/dist/groovy-DZeT_VM-.js +146 -0
- package/dist/haskell-CxiO_7JL.js +375 -0
- package/dist/haxe-70NVW1pR.js +359 -0
- package/dist/http-D9LttvKF.js +44 -0
- package/dist/idl-B6TRFYjl.js +947 -0
- package/dist/index-4oLq9F9B.js +945 -0
- package/dist/index-9NH8hlZ-.js +342 -0
- package/dist/index-BFXNCCbG.js +253 -0
- package/dist/index-BLHYcXXK.js +101 -0
- package/dist/index-BQU3Rb2C.js +290 -0
- package/dist/index-Bg18ePld.js +157 -0
- package/dist/index-Bp5lqnbN.js +555 -0
- package/dist/index-Bqzq8A1N.js +59 -0
- package/dist/index-Bx-s4g99.js +76 -0
- package/dist/index-BxX25QmV.js +248 -0
- package/dist/index-CFCzgc33.js +1918 -0
- package/dist/index-CL7JTU9M.js +136 -0
- package/dist/index-CZGsg2Zk.js +12945 -0
- package/dist/index-CipmEceX.js +74 -0
- package/dist/index-Cv4vvpa2.js +1305 -0
- package/dist/index-D4hhdPbZ.js +6153 -0
- package/dist/index-DhNQ8g9I.js +270 -0
- package/dist/index-Djp53tAP.js +94 -0
- package/dist/index-KlsAFhIj.js +566 -0
- package/dist/index-OntZqtu6.js +309 -0
- package/dist/index-PGnZjMCR.js +302 -0
- package/dist/index-TyYoYgss.js +613 -0
- package/dist/index-oMSPmlXA.js +960 -0
- package/dist/index-rQC6Gbk0.js +138 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/javascript-DOuB9oqA.js +691 -0
- package/dist/julia-DpvXAuO6.js +241 -0
- package/dist/languages.d.ts +18 -0
- package/dist/languages.d.ts.map +1 -0
- package/dist/livescript-CanGTf8u.js +272 -0
- package/dist/lua-XplVlWi_.js +217 -0
- package/dist/mathematica-jaRHnSxC.js +35 -0
- package/dist/mbox-BctzC1hL.js +76 -0
- package/dist/mirc-CFBPAOaF.js +72 -0
- package/dist/mllike-BSnXJBGA.js +272 -0
- package/dist/modelica-vUgVs--1.js +93 -0
- package/dist/mscgen-Cpl0NYLN.js +104 -0
- package/dist/mumps-CQoS1kWX.js +25 -0
- package/dist/nginx-zDPm3Z74.js +89 -0
- package/dist/nsis-BCLyjY7m.js +62 -0
- package/dist/ntriples-CsNjv2QF.js +79 -0
- package/dist/octave-C8PmmSRH.js +143 -0
- package/dist/oz-Ce8aN8oE.js +151 -0
- package/dist/pascal-De0D6mP7.js +77 -0
- package/dist/perl-B4bSCe1C.js +915 -0
- package/dist/pig-D24Z8EXi.js +54 -0
- package/dist/powershell-DkYVfTzP.js +249 -0
- package/dist/properties-Dn9wna3M.js +26 -0
- package/dist/protobuf-BPIjwpzm.js +49 -0
- package/dist/pug-TGXr6c5j.js +248 -0
- package/dist/puppet-nyd4dhjf.js +45 -0
- package/dist/python-BkR3uSy8.js +313 -0
- package/dist/q-DyHZGnqm.js +86 -0
- package/dist/r-LKEuhEGI.js +104 -0
- package/dist/rpm-IznJm2Xc.js +57 -0
- package/dist/ruby-CcYfvIk6.js +228 -0
- package/dist/sas-7E8yHoCW.js +105 -0
- package/dist/scheme-DjibxsNh.js +124 -0
- package/dist/shell-C0C2sNA_.js +182 -0
- package/dist/sieve-Bwz7vjP5.js +72 -0
- package/dist/simple-mode-mNVtnu0l.js +89 -0
- package/dist/smalltalk-Bhddl2pB.js +48 -0
- package/dist/solr-BNlsLglM.js +41 -0
- package/dist/sparql-FarWu_Gb.js +197 -0
- package/dist/spreadsheet-C-cy4P5N.js +49 -0
- package/dist/sql-CfG5lQ3l.js +282 -0
- package/dist/stex-Du4h4KAU.js +129 -0
- package/dist/stylus-CAdqWld3.js +250 -0
- package/dist/swift-DSxqR9R6.js +230 -0
- package/dist/tcl-xfoLljhY.js +81 -0
- package/dist/textile-D1AWE-pc.js +295 -0
- package/dist/tiddlywiki-5wqsXtSk.js +155 -0
- package/dist/tiki-__Kn3CeS.js +181 -0
- package/dist/toml-DWAmxCjl.js +58 -0
- package/dist/troff-D2UO-fKf.js +35 -0
- package/dist/ttcn-Bsa4sfRm.js +123 -0
- package/dist/ttcn-cfg-Bac_acMi.js +88 -0
- package/dist/turtle-xwJUxoPV.js +80 -0
- package/dist/vb-c2kQGd6-.js +74 -0
- package/dist/vbscript-1f_Dhg5H.js +324 -0
- package/dist/velocity-DJd0pTTC.js +96 -0
- package/dist/verilog-CiS1jyi5.js +262 -0
- package/dist/vhdl-T9HkrbI2.js +106 -0
- package/dist/webidl-CjfDENEo.js +155 -0
- package/dist/xquery-Ct6lEb4B.js +422 -0
- package/dist/yacas-C0absKBh.js +73 -0
- package/dist/z80-Pki2zAjW.js +61 -0
- package/package.json +16 -7
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
function p(h) {
|
|
2
|
+
var v = "error";
|
|
3
|
+
function i(e) {
|
|
4
|
+
return new RegExp("^((" + e.join(")|(") + "))\\b", "i");
|
|
5
|
+
}
|
|
6
|
+
var y = new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"), g = new RegExp("^((<>)|(<=)|(>=))"), m = new RegExp("^[\\.,]"), w = new RegExp("^[\\(\\)]"), k = new RegExp("^[A-Za-z][_A-Za-z0-9]*"), x = ["class", "sub", "select", "while", "if", "function", "property", "with", "for"], C = ["else", "elseif", "case"], I = ["next", "loop", "wend"], O = i(["and", "or", "not", "xor", "is", "mod", "eqv", "imp"]), S = [
|
|
7
|
+
"dim",
|
|
8
|
+
"redim",
|
|
9
|
+
"then",
|
|
10
|
+
"until",
|
|
11
|
+
"randomize",
|
|
12
|
+
"byval",
|
|
13
|
+
"byref",
|
|
14
|
+
"new",
|
|
15
|
+
"property",
|
|
16
|
+
"exit",
|
|
17
|
+
"in",
|
|
18
|
+
"const",
|
|
19
|
+
"private",
|
|
20
|
+
"public",
|
|
21
|
+
"get",
|
|
22
|
+
"set",
|
|
23
|
+
"let",
|
|
24
|
+
"stop",
|
|
25
|
+
"on error resume next",
|
|
26
|
+
"on error goto 0",
|
|
27
|
+
"option explicit",
|
|
28
|
+
"call",
|
|
29
|
+
"me"
|
|
30
|
+
], D = ["true", "false", "nothing", "empty", "null"], R = [
|
|
31
|
+
"abs",
|
|
32
|
+
"array",
|
|
33
|
+
"asc",
|
|
34
|
+
"atn",
|
|
35
|
+
"cbool",
|
|
36
|
+
"cbyte",
|
|
37
|
+
"ccur",
|
|
38
|
+
"cdate",
|
|
39
|
+
"cdbl",
|
|
40
|
+
"chr",
|
|
41
|
+
"cint",
|
|
42
|
+
"clng",
|
|
43
|
+
"cos",
|
|
44
|
+
"csng",
|
|
45
|
+
"cstr",
|
|
46
|
+
"date",
|
|
47
|
+
"dateadd",
|
|
48
|
+
"datediff",
|
|
49
|
+
"datepart",
|
|
50
|
+
"dateserial",
|
|
51
|
+
"datevalue",
|
|
52
|
+
"day",
|
|
53
|
+
"escape",
|
|
54
|
+
"eval",
|
|
55
|
+
"execute",
|
|
56
|
+
"exp",
|
|
57
|
+
"filter",
|
|
58
|
+
"formatcurrency",
|
|
59
|
+
"formatdatetime",
|
|
60
|
+
"formatnumber",
|
|
61
|
+
"formatpercent",
|
|
62
|
+
"getlocale",
|
|
63
|
+
"getobject",
|
|
64
|
+
"getref",
|
|
65
|
+
"hex",
|
|
66
|
+
"hour",
|
|
67
|
+
"inputbox",
|
|
68
|
+
"instr",
|
|
69
|
+
"instrrev",
|
|
70
|
+
"int",
|
|
71
|
+
"fix",
|
|
72
|
+
"isarray",
|
|
73
|
+
"isdate",
|
|
74
|
+
"isempty",
|
|
75
|
+
"isnull",
|
|
76
|
+
"isnumeric",
|
|
77
|
+
"isobject",
|
|
78
|
+
"join",
|
|
79
|
+
"lbound",
|
|
80
|
+
"lcase",
|
|
81
|
+
"left",
|
|
82
|
+
"len",
|
|
83
|
+
"loadpicture",
|
|
84
|
+
"log",
|
|
85
|
+
"ltrim",
|
|
86
|
+
"rtrim",
|
|
87
|
+
"trim",
|
|
88
|
+
"maths",
|
|
89
|
+
"mid",
|
|
90
|
+
"minute",
|
|
91
|
+
"month",
|
|
92
|
+
"monthname",
|
|
93
|
+
"msgbox",
|
|
94
|
+
"now",
|
|
95
|
+
"oct",
|
|
96
|
+
"replace",
|
|
97
|
+
"rgb",
|
|
98
|
+
"right",
|
|
99
|
+
"rnd",
|
|
100
|
+
"round",
|
|
101
|
+
"scriptengine",
|
|
102
|
+
"scriptenginebuildversion",
|
|
103
|
+
"scriptenginemajorversion",
|
|
104
|
+
"scriptengineminorversion",
|
|
105
|
+
"second",
|
|
106
|
+
"setlocale",
|
|
107
|
+
"sgn",
|
|
108
|
+
"sin",
|
|
109
|
+
"space",
|
|
110
|
+
"split",
|
|
111
|
+
"sqr",
|
|
112
|
+
"strcomp",
|
|
113
|
+
"string",
|
|
114
|
+
"strreverse",
|
|
115
|
+
"tan",
|
|
116
|
+
"time",
|
|
117
|
+
"timer",
|
|
118
|
+
"timeserial",
|
|
119
|
+
"timevalue",
|
|
120
|
+
"typename",
|
|
121
|
+
"ubound",
|
|
122
|
+
"ucase",
|
|
123
|
+
"unescape",
|
|
124
|
+
"vartype",
|
|
125
|
+
"weekday",
|
|
126
|
+
"weekdayname",
|
|
127
|
+
"year"
|
|
128
|
+
], E = [
|
|
129
|
+
"vbBlack",
|
|
130
|
+
"vbRed",
|
|
131
|
+
"vbGreen",
|
|
132
|
+
"vbYellow",
|
|
133
|
+
"vbBlue",
|
|
134
|
+
"vbMagenta",
|
|
135
|
+
"vbCyan",
|
|
136
|
+
"vbWhite",
|
|
137
|
+
"vbBinaryCompare",
|
|
138
|
+
"vbTextCompare",
|
|
139
|
+
"vbSunday",
|
|
140
|
+
"vbMonday",
|
|
141
|
+
"vbTuesday",
|
|
142
|
+
"vbWednesday",
|
|
143
|
+
"vbThursday",
|
|
144
|
+
"vbFriday",
|
|
145
|
+
"vbSaturday",
|
|
146
|
+
"vbUseSystemDayOfWeek",
|
|
147
|
+
"vbFirstJan1",
|
|
148
|
+
"vbFirstFourDays",
|
|
149
|
+
"vbFirstFullWeek",
|
|
150
|
+
"vbGeneralDate",
|
|
151
|
+
"vbLongDate",
|
|
152
|
+
"vbShortDate",
|
|
153
|
+
"vbLongTime",
|
|
154
|
+
"vbShortTime",
|
|
155
|
+
"vbObjectError",
|
|
156
|
+
"vbOKOnly",
|
|
157
|
+
"vbOKCancel",
|
|
158
|
+
"vbAbortRetryIgnore",
|
|
159
|
+
"vbYesNoCancel",
|
|
160
|
+
"vbYesNo",
|
|
161
|
+
"vbRetryCancel",
|
|
162
|
+
"vbCritical",
|
|
163
|
+
"vbQuestion",
|
|
164
|
+
"vbExclamation",
|
|
165
|
+
"vbInformation",
|
|
166
|
+
"vbDefaultButton1",
|
|
167
|
+
"vbDefaultButton2",
|
|
168
|
+
"vbDefaultButton3",
|
|
169
|
+
"vbDefaultButton4",
|
|
170
|
+
"vbApplicationModal",
|
|
171
|
+
"vbSystemModal",
|
|
172
|
+
"vbOK",
|
|
173
|
+
"vbCancel",
|
|
174
|
+
"vbAbort",
|
|
175
|
+
"vbRetry",
|
|
176
|
+
"vbIgnore",
|
|
177
|
+
"vbYes",
|
|
178
|
+
"vbNo",
|
|
179
|
+
"vbCr",
|
|
180
|
+
"VbCrLf",
|
|
181
|
+
"vbFormFeed",
|
|
182
|
+
"vbLf",
|
|
183
|
+
"vbNewLine",
|
|
184
|
+
"vbNullChar",
|
|
185
|
+
"vbNullString",
|
|
186
|
+
"vbTab",
|
|
187
|
+
"vbVerticalTab",
|
|
188
|
+
"vbUseDefault",
|
|
189
|
+
"vbTrue",
|
|
190
|
+
"vbFalse",
|
|
191
|
+
"vbEmpty",
|
|
192
|
+
"vbNull",
|
|
193
|
+
"vbInteger",
|
|
194
|
+
"vbLong",
|
|
195
|
+
"vbSingle",
|
|
196
|
+
"vbDouble",
|
|
197
|
+
"vbCurrency",
|
|
198
|
+
"vbDate",
|
|
199
|
+
"vbString",
|
|
200
|
+
"vbObject",
|
|
201
|
+
"vbError",
|
|
202
|
+
"vbBoolean",
|
|
203
|
+
"vbVariant",
|
|
204
|
+
"vbDataObject",
|
|
205
|
+
"vbDecimal",
|
|
206
|
+
"vbByte",
|
|
207
|
+
"vbArray"
|
|
208
|
+
], a = ["WScript", "err", "debug", "RegExp"], L = ["description", "firstindex", "global", "helpcontext", "helpfile", "ignorecase", "length", "number", "pattern", "source", "value", "count"], T = ["clear", "execute", "raise", "replace", "test", "write", "writeline", "close", "open", "state", "eof", "update", "addnew", "end", "createobject", "quit"], j = ["server", "response", "request", "session", "application"], F = [
|
|
209
|
+
"buffer",
|
|
210
|
+
"cachecontrol",
|
|
211
|
+
"charset",
|
|
212
|
+
"contenttype",
|
|
213
|
+
"expires",
|
|
214
|
+
"expiresabsolute",
|
|
215
|
+
"isclientconnected",
|
|
216
|
+
"pics",
|
|
217
|
+
"status",
|
|
218
|
+
//response
|
|
219
|
+
"clientcertificate",
|
|
220
|
+
"cookies",
|
|
221
|
+
"form",
|
|
222
|
+
"querystring",
|
|
223
|
+
"servervariables",
|
|
224
|
+
"totalbytes",
|
|
225
|
+
//request
|
|
226
|
+
"contents",
|
|
227
|
+
"staticobjects",
|
|
228
|
+
//application
|
|
229
|
+
"codepage",
|
|
230
|
+
"lcid",
|
|
231
|
+
"sessionid",
|
|
232
|
+
"timeout",
|
|
233
|
+
//session
|
|
234
|
+
"scripttimeout"
|
|
235
|
+
], B = [
|
|
236
|
+
"addheader",
|
|
237
|
+
"appendtolog",
|
|
238
|
+
"binarywrite",
|
|
239
|
+
"end",
|
|
240
|
+
"flush",
|
|
241
|
+
"redirect",
|
|
242
|
+
//response
|
|
243
|
+
"binaryread",
|
|
244
|
+
//request
|
|
245
|
+
"remove",
|
|
246
|
+
"removeall",
|
|
247
|
+
"lock",
|
|
248
|
+
"unlock",
|
|
249
|
+
//application
|
|
250
|
+
"abandon",
|
|
251
|
+
//session
|
|
252
|
+
"getlasterror",
|
|
253
|
+
"htmlencode",
|
|
254
|
+
"mappath",
|
|
255
|
+
"transfer",
|
|
256
|
+
"urlencode"
|
|
257
|
+
], c = T.concat(L);
|
|
258
|
+
a = a.concat(E), h.isASP && (a = a.concat(j), c = c.concat(B, F));
|
|
259
|
+
var W = i(S), z = i(D), A = i(R), K = i(a), N = i(c), M = '"', q = i(x), b = i(C), d = i(I), s = i(["end"]), P = i(["do"]), V = i(["on error resume next", "exit"]), Y = i(["rem"]);
|
|
260
|
+
function f(e, n) {
|
|
261
|
+
n.currentIndent++;
|
|
262
|
+
}
|
|
263
|
+
function u(e, n) {
|
|
264
|
+
n.currentIndent--;
|
|
265
|
+
}
|
|
266
|
+
function l(e, n) {
|
|
267
|
+
if (e.eatSpace())
|
|
268
|
+
return null;
|
|
269
|
+
var r = e.peek();
|
|
270
|
+
if (r === "'" || e.match(Y))
|
|
271
|
+
return e.skipToEnd(), "comment";
|
|
272
|
+
if (e.match(/^((&H)|(&O))?[0-9\.]/i, !1) && !e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i, !1)) {
|
|
273
|
+
var t = !1;
|
|
274
|
+
if ((e.match(/^\d*\.\d+/i) || e.match(/^\d+\.\d*/) || e.match(/^\.\d+/)) && (t = !0), t)
|
|
275
|
+
return e.eat(/J/i), "number";
|
|
276
|
+
var o = !1;
|
|
277
|
+
if (e.match(/^&H[0-9a-f]+/i) || e.match(/^&O[0-7]+/i) ? o = !0 : e.match(/^[1-9]\d*F?/) ? (e.eat(/J/i), o = !0) : e.match(/^0(?![\dx])/i) && (o = !0), o)
|
|
278
|
+
return e.eat(/L/i), "number";
|
|
279
|
+
}
|
|
280
|
+
return e.match(M) ? (n.tokenize = _(e.current()), n.tokenize(e, n)) : e.match(g) || e.match(y) || e.match(O) ? "operator" : e.match(m) ? null : e.match(w) ? "bracket" : e.match(V) ? (n.doInCurrentLine = !0, "keyword") : e.match(P) ? (f(e, n), n.doInCurrentLine = !0, "keyword") : e.match(q) ? (n.doInCurrentLine ? n.doInCurrentLine = !1 : f(e, n), "keyword") : e.match(b) ? "keyword" : e.match(s) ? (u(e, n), u(e, n), "keyword") : e.match(d) ? (n.doInCurrentLine ? n.doInCurrentLine = !1 : u(e, n), "keyword") : e.match(W) ? "keyword" : e.match(z) ? "atom" : e.match(N) ? "variableName.special" : e.match(A) || e.match(K) ? "builtin" : e.match(k) ? "variable" : (e.next(), v);
|
|
281
|
+
}
|
|
282
|
+
function _(e) {
|
|
283
|
+
var n = e.length == 1, r = "string";
|
|
284
|
+
return function(t, o) {
|
|
285
|
+
for (; !t.eol(); ) {
|
|
286
|
+
if (t.eatWhile(/[^'"]/), t.match(e))
|
|
287
|
+
return o.tokenize = l, r;
|
|
288
|
+
t.eat(/['"]/);
|
|
289
|
+
}
|
|
290
|
+
return n && (o.tokenize = l), r;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function H(e, n) {
|
|
294
|
+
var r = n.tokenize(e, n), t = e.current();
|
|
295
|
+
return t === "." ? (r = n.tokenize(e, n), t = e.current(), r && (r.substr(0, 8) === "variable" || r === "builtin" || r === "keyword") ? ((r === "builtin" || r === "keyword") && (r = "variable"), c.indexOf(t.substr(1)) > -1 && (r = "keyword"), r) : v) : r;
|
|
296
|
+
}
|
|
297
|
+
return {
|
|
298
|
+
name: "vbscript",
|
|
299
|
+
startState: function() {
|
|
300
|
+
return {
|
|
301
|
+
tokenize: l,
|
|
302
|
+
lastToken: null,
|
|
303
|
+
currentIndent: 0,
|
|
304
|
+
nextLineIndent: 0,
|
|
305
|
+
doInCurrentLine: !1,
|
|
306
|
+
ignoreKeyword: !1
|
|
307
|
+
};
|
|
308
|
+
},
|
|
309
|
+
token: function(e, n) {
|
|
310
|
+
e.sol() && (n.currentIndent += n.nextLineIndent, n.nextLineIndent = 0, n.doInCurrentLine = 0);
|
|
311
|
+
var r = H(e, n);
|
|
312
|
+
return n.lastToken = { style: r, content: e.current() }, r === null && (r = null), r;
|
|
313
|
+
},
|
|
314
|
+
indent: function(e, n, r) {
|
|
315
|
+
var t = n.replace(/^\s+|\s+$/g, "");
|
|
316
|
+
return t.match(d) || t.match(s) || t.match(b) ? r.unit * (e.currentIndent - 1) : e.currentIndent < 0 ? 0 : e.currentIndent * r.unit;
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
const J = p({});
|
|
321
|
+
p({ isASP: !0 });
|
|
322
|
+
export {
|
|
323
|
+
J as vbScript
|
|
324
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
function u(n) {
|
|
2
|
+
for (var e = {}, i = n.split(" "), r = 0; r < i.length; ++r) e[i[r]] = !0;
|
|
3
|
+
return e;
|
|
4
|
+
}
|
|
5
|
+
var s = u("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"), a = u("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"), c = u("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"), k = /[+\-*&%=<>!?:\/|]/;
|
|
6
|
+
function o(n, e, i) {
|
|
7
|
+
return e.tokenize = i, i(n, e);
|
|
8
|
+
}
|
|
9
|
+
function t(n, e) {
|
|
10
|
+
var i = e.beforeParams;
|
|
11
|
+
e.beforeParams = !1;
|
|
12
|
+
var r = n.next();
|
|
13
|
+
if (r == "'" && !e.inString && e.inParams)
|
|
14
|
+
return e.lastTokenWasBuiltin = !1, o(n, e, p(r));
|
|
15
|
+
if (r == '"') {
|
|
16
|
+
if (e.lastTokenWasBuiltin = !1, e.inString)
|
|
17
|
+
return e.inString = !1, "string";
|
|
18
|
+
if (e.inParams)
|
|
19
|
+
return o(n, e, p(r));
|
|
20
|
+
} else {
|
|
21
|
+
if (/[\[\]{}\(\),;\.]/.test(r))
|
|
22
|
+
return r == "(" && i ? e.inParams = !0 : r == ")" && (e.inParams = !1, e.lastTokenWasBuiltin = !0), null;
|
|
23
|
+
if (/\d/.test(r))
|
|
24
|
+
return e.lastTokenWasBuiltin = !1, n.eatWhile(/[\w\.]/), "number";
|
|
25
|
+
if (r == "#" && n.eat("*"))
|
|
26
|
+
return e.lastTokenWasBuiltin = !1, o(n, e, h);
|
|
27
|
+
if (r == "#" && n.match(/ *\[ *\[/))
|
|
28
|
+
return e.lastTokenWasBuiltin = !1, o(n, e, b);
|
|
29
|
+
if (r == "#" && n.eat("#"))
|
|
30
|
+
return e.lastTokenWasBuiltin = !1, n.skipToEnd(), "comment";
|
|
31
|
+
if (r == "$")
|
|
32
|
+
return n.eat("!"), n.eatWhile(/[\w\d\$_\.{}-]/), c && c.propertyIsEnumerable(n.current()) ? "keyword" : (e.lastTokenWasBuiltin = !0, e.beforeParams = !0, "builtin");
|
|
33
|
+
if (k.test(r))
|
|
34
|
+
return e.lastTokenWasBuiltin = !1, n.eatWhile(k), "operator";
|
|
35
|
+
n.eatWhile(/[\w\$_{}@]/);
|
|
36
|
+
var l = n.current();
|
|
37
|
+
return s && s.propertyIsEnumerable(l) ? "keyword" : a && a.propertyIsEnumerable(l) || n.current().match(/^#@?[a-z0-9_]+ *$/i) && n.peek() == "(" && !(a && a.propertyIsEnumerable(l.toLowerCase())) ? (e.beforeParams = !0, e.lastTokenWasBuiltin = !1, "keyword") : e.inString ? (e.lastTokenWasBuiltin = !1, "string") : n.pos > l.length && n.string.charAt(n.pos - l.length - 1) == "." && e.lastTokenWasBuiltin ? "builtin" : (e.lastTokenWasBuiltin = !1, null);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function p(n) {
|
|
41
|
+
return function(e, i) {
|
|
42
|
+
for (var r = !1, l, f = !1; (l = e.next()) != null; ) {
|
|
43
|
+
if (l == n && !r) {
|
|
44
|
+
f = !0;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
if (n == '"' && e.peek() == "$" && !r) {
|
|
48
|
+
i.inString = !0, f = !0;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
r = !r && l == "\\";
|
|
52
|
+
}
|
|
53
|
+
return f && (i.tokenize = t), "string";
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function h(n, e) {
|
|
57
|
+
for (var i = !1, r; r = n.next(); ) {
|
|
58
|
+
if (r == "#" && i) {
|
|
59
|
+
e.tokenize = t;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
i = r == "*";
|
|
63
|
+
}
|
|
64
|
+
return "comment";
|
|
65
|
+
}
|
|
66
|
+
function b(n, e) {
|
|
67
|
+
for (var i = 0, r; r = n.next(); ) {
|
|
68
|
+
if (r == "#" && i == 2) {
|
|
69
|
+
e.tokenize = t;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
r == "]" ? i++ : r != " " && (i = 0);
|
|
73
|
+
}
|
|
74
|
+
return "meta";
|
|
75
|
+
}
|
|
76
|
+
const W = {
|
|
77
|
+
name: "velocity",
|
|
78
|
+
startState: function() {
|
|
79
|
+
return {
|
|
80
|
+
tokenize: t,
|
|
81
|
+
beforeParams: !1,
|
|
82
|
+
inParams: !1,
|
|
83
|
+
inString: !1,
|
|
84
|
+
lastTokenWasBuiltin: !1
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
token: function(n, e) {
|
|
88
|
+
return n.eatSpace() ? null : e.tokenize(n, e);
|
|
89
|
+
},
|
|
90
|
+
languageData: {
|
|
91
|
+
commentTokens: { line: "##", block: { open: "#*", close: "*#" } }
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
W as velocity
|
|
96
|
+
};
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
function A(i) {
|
|
2
|
+
var o = i.statementIndentUnit, u = i.dontAlignCalls, c = i.noIndentKeywords || [], s = i.multiLineStrings, a = i.hooks || {};
|
|
3
|
+
function g(e) {
|
|
4
|
+
for (var n = {}, t = e.split(" "), r = 0; r < t.length; ++r) n[t[r]] = !0;
|
|
5
|
+
return n;
|
|
6
|
+
}
|
|
7
|
+
var h = g(
|
|
8
|
+
"accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind bins binsof bit break buf bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin function generate genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import incdir include initial inout input inside instance int integer interconnect interface intersect join join_any join_none large let liblist library local localparam logic longint macromodule matches medium modport module nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 null or output package packed parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor"
|
|
9
|
+
), w = /[\+\-\*\/!~&|^%=?:]/, k = /[\[\]{}()]/, b = /\d[0-9_]*/, I = /\d*\s*'s?d\s*\d[0-9_]*/i, O = /\d*\s*'s?b\s*[xz01][xz01_]*/i, T = /\d*\s*'s?o\s*[xz0-7][xz0-7_]*/i, W = /\d*\s*'s?h\s*[0-9a-fxz?][0-9a-fxz?_]*/i, B = /(\d[\d_]*(\.\d[\d_]*)?E-?[\d_]+)|(\d[\d_]*\.\d[\d_]*)/i, M = /^((\w+)|[)}\]])/, U = /[)}\]]/, d, v, K = g(
|
|
10
|
+
"case checker class clocking config function generate interface module package primitive program property specify sequence table task"
|
|
11
|
+
), f = {};
|
|
12
|
+
for (var m in K)
|
|
13
|
+
f[m] = "end" + m;
|
|
14
|
+
f.begin = "end", f.casex = "endcase", f.casez = "endcase", f.do = "while", f.fork = "join;join_any;join_none", f.covergroup = "endgroup";
|
|
15
|
+
for (var V in c) {
|
|
16
|
+
var m = c[V];
|
|
17
|
+
f[m] && (f[m] = void 0);
|
|
18
|
+
}
|
|
19
|
+
var R = g("always always_comb always_ff always_latch assert assign assume else export for foreach forever if import initial repeat while");
|
|
20
|
+
function _(e, n) {
|
|
21
|
+
var t = e.peek(), r;
|
|
22
|
+
if (a[t] && (r = a[t](e, n)) != !1 || a.tokenBase && (r = a.tokenBase(e, n)) != !1)
|
|
23
|
+
return r;
|
|
24
|
+
if (/[,;:\.]/.test(t))
|
|
25
|
+
return d = e.next(), null;
|
|
26
|
+
if (k.test(t))
|
|
27
|
+
return d = e.next(), "bracket";
|
|
28
|
+
if (t == "`")
|
|
29
|
+
return e.next(), e.eatWhile(/[\w\$_]/) ? "def" : null;
|
|
30
|
+
if (t == "$")
|
|
31
|
+
return e.next(), e.eatWhile(/[\w\$_]/) ? "meta" : null;
|
|
32
|
+
if (t == "#")
|
|
33
|
+
return e.next(), e.eatWhile(/[\d_.]/), "def";
|
|
34
|
+
if (t == '"')
|
|
35
|
+
return e.next(), n.tokenize = D(t), n.tokenize(e, n);
|
|
36
|
+
if (t == "/") {
|
|
37
|
+
if (e.next(), e.eat("*"))
|
|
38
|
+
return n.tokenize = L, L(e, n);
|
|
39
|
+
if (e.eat("/"))
|
|
40
|
+
return e.skipToEnd(), "comment";
|
|
41
|
+
e.backUp(1);
|
|
42
|
+
}
|
|
43
|
+
if (e.match(B) || e.match(I) || e.match(O) || e.match(T) || e.match(W) || e.match(b) || e.match(B))
|
|
44
|
+
return "number";
|
|
45
|
+
if (e.eatWhile(w))
|
|
46
|
+
return "meta";
|
|
47
|
+
if (e.eatWhile(/[\w\$_]/)) {
|
|
48
|
+
var l = e.current();
|
|
49
|
+
return h[l] ? (f[l] && (d = "newblock"), R[l] && (d = "newstatement"), v = l, "keyword") : "variable";
|
|
50
|
+
}
|
|
51
|
+
return e.next(), null;
|
|
52
|
+
}
|
|
53
|
+
function D(e) {
|
|
54
|
+
return function(n, t) {
|
|
55
|
+
for (var r = !1, l, y = !1; (l = n.next()) != null; ) {
|
|
56
|
+
if (l == e && !r) {
|
|
57
|
+
y = !0;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
r = !r && l == "\\";
|
|
61
|
+
}
|
|
62
|
+
return (y || !(r || s)) && (t.tokenize = _), "string";
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function L(e, n) {
|
|
66
|
+
for (var t = !1, r; r = e.next(); ) {
|
|
67
|
+
if (r == "/" && t) {
|
|
68
|
+
n.tokenize = _;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
t = r == "*";
|
|
72
|
+
}
|
|
73
|
+
return "comment";
|
|
74
|
+
}
|
|
75
|
+
function j(e, n, t, r, l) {
|
|
76
|
+
this.indented = e, this.column = n, this.type = t, this.align = r, this.prev = l;
|
|
77
|
+
}
|
|
78
|
+
function p(e, n, t) {
|
|
79
|
+
var r = e.indented, l = new j(r, n, t, null, e.context);
|
|
80
|
+
return e.context = l;
|
|
81
|
+
}
|
|
82
|
+
function C(e) {
|
|
83
|
+
var n = e.context.type;
|
|
84
|
+
return (n == ")" || n == "]" || n == "}") && (e.indented = e.context.indented), e.context = e.context.prev;
|
|
85
|
+
}
|
|
86
|
+
function N(e, n) {
|
|
87
|
+
if (e == n)
|
|
88
|
+
return !0;
|
|
89
|
+
var t = n.split(";");
|
|
90
|
+
for (var r in t)
|
|
91
|
+
if (e == t[r])
|
|
92
|
+
return !0;
|
|
93
|
+
return !1;
|
|
94
|
+
}
|
|
95
|
+
function P() {
|
|
96
|
+
var e = [];
|
|
97
|
+
for (var n in f)
|
|
98
|
+
if (f[n]) {
|
|
99
|
+
var t = f[n].split(";");
|
|
100
|
+
for (var r in t)
|
|
101
|
+
e.push(t[r]);
|
|
102
|
+
}
|
|
103
|
+
var l = new RegExp("[{}()\\[\\]]|(" + e.join("|") + ")$");
|
|
104
|
+
return l;
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
name: "verilog",
|
|
108
|
+
startState: function(e) {
|
|
109
|
+
var n = {
|
|
110
|
+
tokenize: null,
|
|
111
|
+
context: new j(-e, 0, "top", !1),
|
|
112
|
+
indented: 0,
|
|
113
|
+
startOfLine: !0
|
|
114
|
+
};
|
|
115
|
+
return a.startState && a.startState(n), n;
|
|
116
|
+
},
|
|
117
|
+
token: function(e, n) {
|
|
118
|
+
var t = n.context;
|
|
119
|
+
if (e.sol() && (t.align == null && (t.align = !1), n.indented = e.indentation(), n.startOfLine = !0), a.token) {
|
|
120
|
+
var r = a.token(e, n);
|
|
121
|
+
if (r !== void 0)
|
|
122
|
+
return r;
|
|
123
|
+
}
|
|
124
|
+
if (e.eatSpace()) return null;
|
|
125
|
+
d = null, v = null;
|
|
126
|
+
var r = (n.tokenize || _)(e, n);
|
|
127
|
+
if (r == "comment" || r == "meta" || r == "variable") return r;
|
|
128
|
+
if (t.align == null && (t.align = !0), d == t.type)
|
|
129
|
+
C(n);
|
|
130
|
+
else if (d == ";" && t.type == "statement" || t.type && N(v, t.type))
|
|
131
|
+
for (t = C(n); t && t.type == "statement"; ) t = C(n);
|
|
132
|
+
else if (d == "{")
|
|
133
|
+
p(n, e.column(), "}");
|
|
134
|
+
else if (d == "[")
|
|
135
|
+
p(n, e.column(), "]");
|
|
136
|
+
else if (d == "(")
|
|
137
|
+
p(n, e.column(), ")");
|
|
138
|
+
else if (t && t.type == "endcase" && d == ":")
|
|
139
|
+
p(n, e.column(), "statement");
|
|
140
|
+
else if (d == "newstatement")
|
|
141
|
+
p(n, e.column(), "statement");
|
|
142
|
+
else if (d == "newblock" && !(v == "function" && t && (t.type == "statement" || t.type == "endgroup"))) {
|
|
143
|
+
if (!(v == "task" && t && t.type == "statement")) {
|
|
144
|
+
var l = f[v];
|
|
145
|
+
p(n, e.column(), l);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return n.startOfLine = !1, r;
|
|
149
|
+
},
|
|
150
|
+
indent: function(e, n, t) {
|
|
151
|
+
if (e.tokenize != _ && e.tokenize != null) return null;
|
|
152
|
+
if (a.indent) {
|
|
153
|
+
var r = a.indent(e);
|
|
154
|
+
if (r >= 0) return r;
|
|
155
|
+
}
|
|
156
|
+
var l = e.context, y = n && n.charAt(0);
|
|
157
|
+
l.type == "statement" && y == "}" && (l = l.prev);
|
|
158
|
+
var x = !1, $ = n.match(M);
|
|
159
|
+
return $ && (x = N($[0], l.type)), l.type == "statement" ? l.indented + (y == "{" ? 0 : o || t.unit) : U.test(l.type) && l.align && !u ? l.column + (x ? 0 : 1) : l.type == ")" && !x ? l.indented + (o || t.unit) : l.indented + (x ? 0 : t.unit);
|
|
160
|
+
},
|
|
161
|
+
languageData: {
|
|
162
|
+
indentOnInput: P(),
|
|
163
|
+
commentTokens: { line: "//", block: { open: "/*", close: "*/" } }
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
const J = A({});
|
|
168
|
+
var z = {
|
|
169
|
+
"|": "link",
|
|
170
|
+
">": "property",
|
|
171
|
+
// Should condition this off for > TLV 1c.
|
|
172
|
+
$: "variable",
|
|
173
|
+
$$: "variable",
|
|
174
|
+
"?$": "qualifier",
|
|
175
|
+
"?*": "qualifier",
|
|
176
|
+
"-": "contentSeparator",
|
|
177
|
+
"/": "property",
|
|
178
|
+
"/-": "property",
|
|
179
|
+
"@": "variableName.special",
|
|
180
|
+
"@-": "variableName.special",
|
|
181
|
+
"@++": "variableName.special",
|
|
182
|
+
"@+=": "variableName.special",
|
|
183
|
+
"@+=-": "variableName.special",
|
|
184
|
+
"@--": "variableName.special",
|
|
185
|
+
"@-=": "variableName.special",
|
|
186
|
+
"%+": "tag",
|
|
187
|
+
"%-": "tag",
|
|
188
|
+
"%": "tag",
|
|
189
|
+
">>": "tag",
|
|
190
|
+
"<<": "tag",
|
|
191
|
+
"<>": "tag",
|
|
192
|
+
"#": "tag",
|
|
193
|
+
// Need to choose a style for this.
|
|
194
|
+
"^": "attribute",
|
|
195
|
+
"^^": "attribute",
|
|
196
|
+
"^!": "attribute",
|
|
197
|
+
"*": "variable",
|
|
198
|
+
"**": "variable",
|
|
199
|
+
"\\": "keyword",
|
|
200
|
+
'"': "comment"
|
|
201
|
+
}, E = {
|
|
202
|
+
"/": "beh-hier",
|
|
203
|
+
">": "beh-hier",
|
|
204
|
+
"-": "phys-hier",
|
|
205
|
+
"|": "pipe",
|
|
206
|
+
"?": "when",
|
|
207
|
+
"@": "stage",
|
|
208
|
+
"\\": "keyword"
|
|
209
|
+
}, S = 3, q = /^([~!@#\$%\^&\*-\+=\?\/\\\|'"<>]+)([\d\w_]*)/, F = /^[! ] */, G = /^\/[\/\*]/;
|
|
210
|
+
A({
|
|
211
|
+
hooks: {
|
|
212
|
+
electricInput: !1,
|
|
213
|
+
// Return undefined for verilog tokenizing, or style for TLV token (null not used).
|
|
214
|
+
// Standard CM styles are used for most formatting, but some TL-Verilog-specific highlighting
|
|
215
|
+
// can be enabled with the definition of cm-tlv-* styles, including highlighting for:
|
|
216
|
+
// - M4 tokens
|
|
217
|
+
// - TLV scope indentation
|
|
218
|
+
// - Statement delimitation (enabled by tlvTrackStatements)
|
|
219
|
+
token: function(i, o) {
|
|
220
|
+
var u = void 0, c;
|
|
221
|
+
if (i.sol() && !o.tlvInBlockComment) {
|
|
222
|
+
i.peek() == "\\" && (u = "def", i.skipToEnd(), i.string.match(/\\SV/) ? o.tlvCodeActive = !1 : i.string.match(/\\TLV/) && (o.tlvCodeActive = !0)), o.tlvCodeActive && i.pos == 0 && o.indented == 0 && (c = i.match(F, !1)) && (o.indented = c[0].length);
|
|
223
|
+
var s = o.indented, a = s / S;
|
|
224
|
+
if (a <= o.tlvIndentationStyle.length) {
|
|
225
|
+
var g = i.string.length == s, h = a * S;
|
|
226
|
+
if (h < i.string.length) {
|
|
227
|
+
var w = i.string.slice(h), k = w[0];
|
|
228
|
+
E[k] && (c = w.match(q)) && z[c[1]] && (s += S, k == "\\" && h > 0 || (o.tlvIndentationStyle[a] = E[k], a++));
|
|
229
|
+
}
|
|
230
|
+
if (!g)
|
|
231
|
+
for (; o.tlvIndentationStyle.length > a; )
|
|
232
|
+
o.tlvIndentationStyle.pop();
|
|
233
|
+
}
|
|
234
|
+
o.tlvNextIndent = s;
|
|
235
|
+
}
|
|
236
|
+
if (o.tlvCodeActive) {
|
|
237
|
+
var c;
|
|
238
|
+
if (u === void 0) if (o.tlvInBlockComment)
|
|
239
|
+
i.match(/^.*?\*\//) ? o.tlvInBlockComment = !1 : i.skipToEnd(), u = "comment";
|
|
240
|
+
else if ((c = i.match(G)) && !o.tlvInBlockComment)
|
|
241
|
+
c[0] == "//" ? i.skipToEnd() : o.tlvInBlockComment = !0, u = "comment";
|
|
242
|
+
else if (c = i.match(q)) {
|
|
243
|
+
var b = c[1], I = c[2];
|
|
244
|
+
// is identifier prefix
|
|
245
|
+
z.hasOwnProperty(b) && // has mnemonic or we're at the end of the line (maybe it hasn't been typed yet)
|
|
246
|
+
(I.length > 0 || i.eol()) ? u = z[b] : i.backUp(i.current().length - 1);
|
|
247
|
+
} else i.match(/^\t+/) ? u = "invalid" : i.match(/^[\[\]{}\(\);\:]+/) ? u = "meta" : (c = i.match(/^[mM]4([\+_])?[\w\d_]*/)) ? u = c[1] == "+" ? "keyword.special" : "keyword" : i.match(/^ +/) ? i.eol() && (u = "error") : i.match(/^[\w\d_]+/) ? u = "number" : i.next();
|
|
248
|
+
} else
|
|
249
|
+
i.match(/^[mM]4([\w\d_]*)/) && (u = "keyword");
|
|
250
|
+
return u;
|
|
251
|
+
},
|
|
252
|
+
indent: function(i) {
|
|
253
|
+
return i.tlvCodeActive == !0 ? i.tlvNextIndent : -1;
|
|
254
|
+
},
|
|
255
|
+
startState: function(i) {
|
|
256
|
+
i.tlvIndentationStyle = [], i.tlvCodeActive = !0, i.tlvNextIndent = -1, i.tlvInBlockComment = !1;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
export {
|
|
261
|
+
J as verilog
|
|
262
|
+
};
|