local-operator-ui 0.4.7 → 0.5.1
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/README.md +16 -0
- package/out/main/index.jsc +0 -0
- package/out/preload/index.jsc +0 -0
- package/out/renderer/assets/asn1-BnOEsgAm.js +144 -0
- package/out/renderer/assets/clojure-BhXMqnxz.js +849 -0
- package/out/renderer/assets/css-c-jst79C.js +1783 -0
- package/out/renderer/assets/{error-boundary-BLf1xS7L.js → fonts-ChEL5asK.js} +5848 -5578
- package/out/renderer/assets/{index-94BTFuhu.css → index-0vP6mKPB.css} +1 -1
- package/out/renderer/assets/index-B87fKloA.js +312 -0
- package/out/renderer/assets/index-CfuGYyUa.js +406 -0
- package/out/renderer/assets/{index-D-dF3v8p.js → index-CzJMsYKD.js} +173590 -87777
- package/out/renderer/assets/{installer-CvOG9O_k.js → installer-DV5yVW7q.js} +7 -3
- package/out/renderer/assets/javascript-C3MnDRiU.js +994 -0
- package/out/renderer/assets/mllike-DHn7xckP.js +334 -0
- package/out/renderer/assets/pug-By0kVCfm.js +405 -0
- package/out/renderer/assets/python-CvWbmiX4.js +427 -0
- package/out/renderer/assets/radient-icon-1024x1024-D_JJedvo.png +0 -0
- package/out/renderer/assets/rpm-C-DLY-If.js +109 -0
- package/out/renderer/assets/sql-BSrOzCRI.js +354 -0
- package/out/renderer/assets/ttcn-cfg-Dc39-fIP.js +133 -0
- package/out/renderer/index.html +6 -5
- package/out/renderer/installer.html +3 -3
- package/package.json +60 -24
- /package/out/renderer/assets/{error-boundary-B9KBGB-g.css → fonts-B9KBGB-g.css} +0 -0
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
function wordRegexp(words2) {
|
|
2
|
+
return new RegExp("^((" + words2.join(")|(") + "))\\b");
|
|
3
|
+
}
|
|
4
|
+
var wordOperators = wordRegexp(["and", "or", "not", "is"]);
|
|
5
|
+
var commonKeywords = [
|
|
6
|
+
"as",
|
|
7
|
+
"assert",
|
|
8
|
+
"break",
|
|
9
|
+
"class",
|
|
10
|
+
"continue",
|
|
11
|
+
"def",
|
|
12
|
+
"del",
|
|
13
|
+
"elif",
|
|
14
|
+
"else",
|
|
15
|
+
"except",
|
|
16
|
+
"finally",
|
|
17
|
+
"for",
|
|
18
|
+
"from",
|
|
19
|
+
"global",
|
|
20
|
+
"if",
|
|
21
|
+
"import",
|
|
22
|
+
"lambda",
|
|
23
|
+
"pass",
|
|
24
|
+
"raise",
|
|
25
|
+
"return",
|
|
26
|
+
"try",
|
|
27
|
+
"while",
|
|
28
|
+
"with",
|
|
29
|
+
"yield",
|
|
30
|
+
"in",
|
|
31
|
+
"False",
|
|
32
|
+
"True"
|
|
33
|
+
];
|
|
34
|
+
var commonBuiltins = [
|
|
35
|
+
"abs",
|
|
36
|
+
"all",
|
|
37
|
+
"any",
|
|
38
|
+
"bin",
|
|
39
|
+
"bool",
|
|
40
|
+
"bytearray",
|
|
41
|
+
"callable",
|
|
42
|
+
"chr",
|
|
43
|
+
"classmethod",
|
|
44
|
+
"compile",
|
|
45
|
+
"complex",
|
|
46
|
+
"delattr",
|
|
47
|
+
"dict",
|
|
48
|
+
"dir",
|
|
49
|
+
"divmod",
|
|
50
|
+
"enumerate",
|
|
51
|
+
"eval",
|
|
52
|
+
"filter",
|
|
53
|
+
"float",
|
|
54
|
+
"format",
|
|
55
|
+
"frozenset",
|
|
56
|
+
"getattr",
|
|
57
|
+
"globals",
|
|
58
|
+
"hasattr",
|
|
59
|
+
"hash",
|
|
60
|
+
"help",
|
|
61
|
+
"hex",
|
|
62
|
+
"id",
|
|
63
|
+
"input",
|
|
64
|
+
"int",
|
|
65
|
+
"isinstance",
|
|
66
|
+
"issubclass",
|
|
67
|
+
"iter",
|
|
68
|
+
"len",
|
|
69
|
+
"list",
|
|
70
|
+
"locals",
|
|
71
|
+
"map",
|
|
72
|
+
"max",
|
|
73
|
+
"memoryview",
|
|
74
|
+
"min",
|
|
75
|
+
"next",
|
|
76
|
+
"object",
|
|
77
|
+
"oct",
|
|
78
|
+
"open",
|
|
79
|
+
"ord",
|
|
80
|
+
"pow",
|
|
81
|
+
"property",
|
|
82
|
+
"range",
|
|
83
|
+
"repr",
|
|
84
|
+
"reversed",
|
|
85
|
+
"round",
|
|
86
|
+
"set",
|
|
87
|
+
"setattr",
|
|
88
|
+
"slice",
|
|
89
|
+
"sorted",
|
|
90
|
+
"staticmethod",
|
|
91
|
+
"str",
|
|
92
|
+
"sum",
|
|
93
|
+
"super",
|
|
94
|
+
"tuple",
|
|
95
|
+
"type",
|
|
96
|
+
"vars",
|
|
97
|
+
"zip",
|
|
98
|
+
"__import__",
|
|
99
|
+
"NotImplemented",
|
|
100
|
+
"Ellipsis",
|
|
101
|
+
"__debug__"
|
|
102
|
+
];
|
|
103
|
+
function top(state) {
|
|
104
|
+
return state.scopes[state.scopes.length - 1];
|
|
105
|
+
}
|
|
106
|
+
function mkPython(parserConf) {
|
|
107
|
+
var ERRORCLASS = "error";
|
|
108
|
+
var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.\\]/;
|
|
109
|
+
var operators = [
|
|
110
|
+
parserConf.singleOperators,
|
|
111
|
+
parserConf.doubleOperators,
|
|
112
|
+
parserConf.doubleDelimiters,
|
|
113
|
+
parserConf.tripleDelimiters,
|
|
114
|
+
parserConf.operators || /^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/
|
|
115
|
+
];
|
|
116
|
+
for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1);
|
|
117
|
+
var hangingIndent = parserConf.hangingIndent;
|
|
118
|
+
var myKeywords = commonKeywords, myBuiltins = commonBuiltins;
|
|
119
|
+
if (parserConf.extra_keywords != void 0)
|
|
120
|
+
myKeywords = myKeywords.concat(parserConf.extra_keywords);
|
|
121
|
+
if (parserConf.extra_builtins != void 0)
|
|
122
|
+
myBuiltins = myBuiltins.concat(parserConf.extra_builtins);
|
|
123
|
+
var py3 = !(parserConf.version && Number(parserConf.version) < 3);
|
|
124
|
+
if (py3) {
|
|
125
|
+
var identifiers = parserConf.identifiers || /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
|
|
126
|
+
myKeywords = myKeywords.concat(["nonlocal", "None", "aiter", "anext", "async", "await", "breakpoint", "match", "case"]);
|
|
127
|
+
myBuiltins = myBuiltins.concat(["ascii", "bytes", "exec", "print"]);
|
|
128
|
+
var stringPrefixes = new RegExp(`^(([rbuf]|(br)|(rb)|(fr)|(rf))?('{3}|"{3}|['"]))`, "i");
|
|
129
|
+
} else {
|
|
130
|
+
var identifiers = parserConf.identifiers || /^[_A-Za-z][_A-Za-z0-9]*/;
|
|
131
|
+
myKeywords = myKeywords.concat(["exec", "print"]);
|
|
132
|
+
myBuiltins = myBuiltins.concat([
|
|
133
|
+
"apply",
|
|
134
|
+
"basestring",
|
|
135
|
+
"buffer",
|
|
136
|
+
"cmp",
|
|
137
|
+
"coerce",
|
|
138
|
+
"execfile",
|
|
139
|
+
"file",
|
|
140
|
+
"intern",
|
|
141
|
+
"long",
|
|
142
|
+
"raw_input",
|
|
143
|
+
"reduce",
|
|
144
|
+
"reload",
|
|
145
|
+
"unichr",
|
|
146
|
+
"unicode",
|
|
147
|
+
"xrange",
|
|
148
|
+
"None"
|
|
149
|
+
]);
|
|
150
|
+
var stringPrefixes = new RegExp(`^(([rubf]|(ur)|(br))?('{3}|"{3}|['"]))`, "i");
|
|
151
|
+
}
|
|
152
|
+
var keywords = wordRegexp(myKeywords);
|
|
153
|
+
var builtins = wordRegexp(myBuiltins);
|
|
154
|
+
function tokenBase(stream, state) {
|
|
155
|
+
var sol = stream.sol() && state.lastToken != "\\";
|
|
156
|
+
if (sol) state.indent = stream.indentation();
|
|
157
|
+
if (sol && top(state).type == "py") {
|
|
158
|
+
var scopeOffset = top(state).offset;
|
|
159
|
+
if (stream.eatSpace()) {
|
|
160
|
+
var lineOffset = stream.indentation();
|
|
161
|
+
if (lineOffset > scopeOffset)
|
|
162
|
+
pushPyScope(stream, state);
|
|
163
|
+
else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != "#")
|
|
164
|
+
state.errorToken = true;
|
|
165
|
+
return null;
|
|
166
|
+
} else {
|
|
167
|
+
var style = tokenBaseInner(stream, state);
|
|
168
|
+
if (scopeOffset > 0 && dedent(stream, state))
|
|
169
|
+
style += " " + ERRORCLASS;
|
|
170
|
+
return style;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return tokenBaseInner(stream, state);
|
|
174
|
+
}
|
|
175
|
+
function tokenBaseInner(stream, state, inFormat) {
|
|
176
|
+
if (stream.eatSpace()) return null;
|
|
177
|
+
if (!inFormat && stream.match(/^#.*/)) return "comment";
|
|
178
|
+
if (stream.match(/^[0-9\.]/, false)) {
|
|
179
|
+
var floatLiteral = false;
|
|
180
|
+
if (stream.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)) {
|
|
181
|
+
floatLiteral = true;
|
|
182
|
+
}
|
|
183
|
+
if (stream.match(/^[\d_]+\.\d*/)) {
|
|
184
|
+
floatLiteral = true;
|
|
185
|
+
}
|
|
186
|
+
if (stream.match(/^\.\d+/)) {
|
|
187
|
+
floatLiteral = true;
|
|
188
|
+
}
|
|
189
|
+
if (floatLiteral) {
|
|
190
|
+
stream.eat(/J/i);
|
|
191
|
+
return "number";
|
|
192
|
+
}
|
|
193
|
+
var intLiteral = false;
|
|
194
|
+
if (stream.match(/^0x[0-9a-f_]+/i)) intLiteral = true;
|
|
195
|
+
if (stream.match(/^0b[01_]+/i)) intLiteral = true;
|
|
196
|
+
if (stream.match(/^0o[0-7_]+/i)) intLiteral = true;
|
|
197
|
+
if (stream.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)) {
|
|
198
|
+
stream.eat(/J/i);
|
|
199
|
+
intLiteral = true;
|
|
200
|
+
}
|
|
201
|
+
if (stream.match(/^0(?![\dx])/i)) intLiteral = true;
|
|
202
|
+
if (intLiteral) {
|
|
203
|
+
stream.eat(/L/i);
|
|
204
|
+
return "number";
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (stream.match(stringPrefixes)) {
|
|
208
|
+
var isFmtString = stream.current().toLowerCase().indexOf("f") !== -1;
|
|
209
|
+
if (!isFmtString) {
|
|
210
|
+
state.tokenize = tokenStringFactory(stream.current(), state.tokenize);
|
|
211
|
+
return state.tokenize(stream, state);
|
|
212
|
+
} else {
|
|
213
|
+
state.tokenize = formatStringFactory(stream.current(), state.tokenize);
|
|
214
|
+
return state.tokenize(stream, state);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
for (var i2 = 0; i2 < operators.length; i2++)
|
|
218
|
+
if (stream.match(operators[i2])) return "operator";
|
|
219
|
+
if (stream.match(delimiters)) return "punctuation";
|
|
220
|
+
if (state.lastToken == "." && stream.match(identifiers))
|
|
221
|
+
return "property";
|
|
222
|
+
if (stream.match(keywords) || stream.match(wordOperators))
|
|
223
|
+
return "keyword";
|
|
224
|
+
if (stream.match(builtins))
|
|
225
|
+
return "builtin";
|
|
226
|
+
if (stream.match(/^(self|cls)\b/))
|
|
227
|
+
return "self";
|
|
228
|
+
if (stream.match(identifiers)) {
|
|
229
|
+
if (state.lastToken == "def" || state.lastToken == "class")
|
|
230
|
+
return "def";
|
|
231
|
+
return "variable";
|
|
232
|
+
}
|
|
233
|
+
stream.next();
|
|
234
|
+
return inFormat ? null : ERRORCLASS;
|
|
235
|
+
}
|
|
236
|
+
function formatStringFactory(delimiter, tokenOuter) {
|
|
237
|
+
while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
|
|
238
|
+
delimiter = delimiter.substr(1);
|
|
239
|
+
var singleline = delimiter.length == 1;
|
|
240
|
+
var OUTCLASS = "string";
|
|
241
|
+
function tokenNestedExpr(depth) {
|
|
242
|
+
return function(stream, state) {
|
|
243
|
+
var inner = tokenBaseInner(stream, state, true);
|
|
244
|
+
if (inner == "punctuation") {
|
|
245
|
+
if (stream.current() == "{") {
|
|
246
|
+
state.tokenize = tokenNestedExpr(depth + 1);
|
|
247
|
+
} else if (stream.current() == "}") {
|
|
248
|
+
if (depth > 1) state.tokenize = tokenNestedExpr(depth - 1);
|
|
249
|
+
else state.tokenize = tokenString;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return inner;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function tokenString(stream, state) {
|
|
256
|
+
while (!stream.eol()) {
|
|
257
|
+
stream.eatWhile(/[^'"\{\}\\]/);
|
|
258
|
+
if (stream.eat("\\")) {
|
|
259
|
+
stream.next();
|
|
260
|
+
if (singleline && stream.eol())
|
|
261
|
+
return OUTCLASS;
|
|
262
|
+
} else if (stream.match(delimiter)) {
|
|
263
|
+
state.tokenize = tokenOuter;
|
|
264
|
+
return OUTCLASS;
|
|
265
|
+
} else if (stream.match("{{")) {
|
|
266
|
+
return OUTCLASS;
|
|
267
|
+
} else if (stream.match("{", false)) {
|
|
268
|
+
state.tokenize = tokenNestedExpr(0);
|
|
269
|
+
if (stream.current()) return OUTCLASS;
|
|
270
|
+
else return state.tokenize(stream, state);
|
|
271
|
+
} else if (stream.match("}}")) {
|
|
272
|
+
return OUTCLASS;
|
|
273
|
+
} else if (stream.match("}")) {
|
|
274
|
+
return ERRORCLASS;
|
|
275
|
+
} else {
|
|
276
|
+
stream.eat(/['"]/);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (singleline) {
|
|
280
|
+
if (parserConf.singleLineStringErrors)
|
|
281
|
+
return ERRORCLASS;
|
|
282
|
+
else
|
|
283
|
+
state.tokenize = tokenOuter;
|
|
284
|
+
}
|
|
285
|
+
return OUTCLASS;
|
|
286
|
+
}
|
|
287
|
+
tokenString.isString = true;
|
|
288
|
+
return tokenString;
|
|
289
|
+
}
|
|
290
|
+
function tokenStringFactory(delimiter, tokenOuter) {
|
|
291
|
+
while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
|
|
292
|
+
delimiter = delimiter.substr(1);
|
|
293
|
+
var singleline = delimiter.length == 1;
|
|
294
|
+
var OUTCLASS = "string";
|
|
295
|
+
function tokenString(stream, state) {
|
|
296
|
+
while (!stream.eol()) {
|
|
297
|
+
stream.eatWhile(/[^'"\\]/);
|
|
298
|
+
if (stream.eat("\\")) {
|
|
299
|
+
stream.next();
|
|
300
|
+
if (singleline && stream.eol())
|
|
301
|
+
return OUTCLASS;
|
|
302
|
+
} else if (stream.match(delimiter)) {
|
|
303
|
+
state.tokenize = tokenOuter;
|
|
304
|
+
return OUTCLASS;
|
|
305
|
+
} else {
|
|
306
|
+
stream.eat(/['"]/);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (singleline) {
|
|
310
|
+
if (parserConf.singleLineStringErrors)
|
|
311
|
+
return ERRORCLASS;
|
|
312
|
+
else
|
|
313
|
+
state.tokenize = tokenOuter;
|
|
314
|
+
}
|
|
315
|
+
return OUTCLASS;
|
|
316
|
+
}
|
|
317
|
+
tokenString.isString = true;
|
|
318
|
+
return tokenString;
|
|
319
|
+
}
|
|
320
|
+
function pushPyScope(stream, state) {
|
|
321
|
+
while (top(state).type != "py") state.scopes.pop();
|
|
322
|
+
state.scopes.push({
|
|
323
|
+
offset: top(state).offset + stream.indentUnit,
|
|
324
|
+
type: "py",
|
|
325
|
+
align: null
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function pushBracketScope(stream, state, type) {
|
|
329
|
+
var align = stream.match(/^[\s\[\{\(]*(?:#|$)/, false) ? null : stream.column() + 1;
|
|
330
|
+
state.scopes.push({
|
|
331
|
+
offset: state.indent + (hangingIndent || stream.indentUnit),
|
|
332
|
+
type,
|
|
333
|
+
align
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
function dedent(stream, state) {
|
|
337
|
+
var indented = stream.indentation();
|
|
338
|
+
while (state.scopes.length > 1 && top(state).offset > indented) {
|
|
339
|
+
if (top(state).type != "py") return true;
|
|
340
|
+
state.scopes.pop();
|
|
341
|
+
}
|
|
342
|
+
return top(state).offset != indented;
|
|
343
|
+
}
|
|
344
|
+
function tokenLexer(stream, state) {
|
|
345
|
+
if (stream.sol()) {
|
|
346
|
+
state.beginningOfLine = true;
|
|
347
|
+
state.dedent = false;
|
|
348
|
+
}
|
|
349
|
+
var style = state.tokenize(stream, state);
|
|
350
|
+
var current = stream.current();
|
|
351
|
+
if (state.beginningOfLine && current == "@")
|
|
352
|
+
return stream.match(identifiers, false) ? "meta" : py3 ? "operator" : ERRORCLASS;
|
|
353
|
+
if (/\S/.test(current)) state.beginningOfLine = false;
|
|
354
|
+
if ((style == "variable" || style == "builtin") && state.lastToken == "meta")
|
|
355
|
+
style = "meta";
|
|
356
|
+
if (current == "pass" || current == "return")
|
|
357
|
+
state.dedent = true;
|
|
358
|
+
if (current == "lambda") state.lambda = true;
|
|
359
|
+
if (current == ":" && !state.lambda && top(state).type == "py" && stream.match(/^\s*(?:#|$)/, false))
|
|
360
|
+
pushPyScope(stream, state);
|
|
361
|
+
if (current.length == 1 && !/string|comment/.test(style)) {
|
|
362
|
+
var delimiter_index = "[({".indexOf(current);
|
|
363
|
+
if (delimiter_index != -1)
|
|
364
|
+
pushBracketScope(stream, state, "])}".slice(delimiter_index, delimiter_index + 1));
|
|
365
|
+
delimiter_index = "])}".indexOf(current);
|
|
366
|
+
if (delimiter_index != -1) {
|
|
367
|
+
if (top(state).type == current) state.indent = state.scopes.pop().offset - (hangingIndent || stream.indentUnit);
|
|
368
|
+
else return ERRORCLASS;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (state.dedent && stream.eol() && top(state).type == "py" && state.scopes.length > 1)
|
|
372
|
+
state.scopes.pop();
|
|
373
|
+
return style;
|
|
374
|
+
}
|
|
375
|
+
return {
|
|
376
|
+
name: "python",
|
|
377
|
+
startState: function() {
|
|
378
|
+
return {
|
|
379
|
+
tokenize: tokenBase,
|
|
380
|
+
scopes: [{ offset: 0, type: "py", align: null }],
|
|
381
|
+
indent: 0,
|
|
382
|
+
lastToken: null,
|
|
383
|
+
lambda: false,
|
|
384
|
+
dedent: 0
|
|
385
|
+
};
|
|
386
|
+
},
|
|
387
|
+
token: function(stream, state) {
|
|
388
|
+
var addErr = state.errorToken;
|
|
389
|
+
if (addErr) state.errorToken = false;
|
|
390
|
+
var style = tokenLexer(stream, state);
|
|
391
|
+
if (style && style != "comment")
|
|
392
|
+
state.lastToken = style == "keyword" || style == "punctuation" ? stream.current() : style;
|
|
393
|
+
if (style == "punctuation") style = null;
|
|
394
|
+
if (stream.eol() && state.lambda)
|
|
395
|
+
state.lambda = false;
|
|
396
|
+
return addErr ? ERRORCLASS : style;
|
|
397
|
+
},
|
|
398
|
+
indent: function(state, textAfter, cx) {
|
|
399
|
+
if (state.tokenize != tokenBase)
|
|
400
|
+
return state.tokenize.isString ? null : 0;
|
|
401
|
+
var scope = top(state);
|
|
402
|
+
var closing = scope.type == textAfter.charAt(0) || scope.type == "py" && !state.dedent && /^(else:|elif |except |finally:)/.test(textAfter);
|
|
403
|
+
if (scope.align != null)
|
|
404
|
+
return scope.align - (closing ? 1 : 0);
|
|
405
|
+
else
|
|
406
|
+
return scope.offset - (closing ? hangingIndent || cx.unit : 0);
|
|
407
|
+
},
|
|
408
|
+
languageData: {
|
|
409
|
+
autocomplete: commonKeywords.concat(commonBuiltins).concat(["exec", "print"]),
|
|
410
|
+
indentOnInput: /^\s*([\}\]\)]|else:|elif |except |finally:)$/,
|
|
411
|
+
commentTokens: { line: "#" },
|
|
412
|
+
closeBrackets: { brackets: ["(", "[", "{", "'", '"', "'''", '"""'] }
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
var words = function(str) {
|
|
417
|
+
return str.split(" ");
|
|
418
|
+
};
|
|
419
|
+
const python = mkPython({});
|
|
420
|
+
const cython = mkPython({
|
|
421
|
+
extra_keywords: words("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")
|
|
422
|
+
});
|
|
423
|
+
export {
|
|
424
|
+
cython,
|
|
425
|
+
mkPython,
|
|
426
|
+
python
|
|
427
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
var headerSeparator = /^-+$/;
|
|
2
|
+
var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /;
|
|
3
|
+
var simpleEmail = /^[\w+.-]+@[\w.-]+/;
|
|
4
|
+
const rpmChanges = {
|
|
5
|
+
name: "rpmchanges",
|
|
6
|
+
token: function(stream) {
|
|
7
|
+
if (stream.sol()) {
|
|
8
|
+
if (stream.match(headerSeparator)) {
|
|
9
|
+
return "tag";
|
|
10
|
+
}
|
|
11
|
+
if (stream.match(headerLine)) {
|
|
12
|
+
return "tag";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (stream.match(simpleEmail)) {
|
|
16
|
+
return "string";
|
|
17
|
+
}
|
|
18
|
+
stream.next();
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var arch = /^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;
|
|
23
|
+
var preamble = /^[a-zA-Z0-9()]+:/;
|
|
24
|
+
var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/;
|
|
25
|
+
var control_flow_complex = /^%(ifnarch|ifarch|if)/;
|
|
26
|
+
var control_flow_simple = /^%(else|endif)/;
|
|
27
|
+
var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;
|
|
28
|
+
const rpmSpec = {
|
|
29
|
+
name: "rpmspec",
|
|
30
|
+
startState: function() {
|
|
31
|
+
return {
|
|
32
|
+
controlFlow: false,
|
|
33
|
+
macroParameters: false,
|
|
34
|
+
section: false
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
token: function(stream, state) {
|
|
38
|
+
var ch = stream.peek();
|
|
39
|
+
if (ch == "#") {
|
|
40
|
+
stream.skipToEnd();
|
|
41
|
+
return "comment";
|
|
42
|
+
}
|
|
43
|
+
if (stream.sol()) {
|
|
44
|
+
if (stream.match(preamble)) {
|
|
45
|
+
return "header";
|
|
46
|
+
}
|
|
47
|
+
if (stream.match(section)) {
|
|
48
|
+
return "atom";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (stream.match(/^\$\w+/)) {
|
|
52
|
+
return "def";
|
|
53
|
+
}
|
|
54
|
+
if (stream.match(/^\$\{\w+\}/)) {
|
|
55
|
+
return "def";
|
|
56
|
+
}
|
|
57
|
+
if (stream.match(control_flow_simple)) {
|
|
58
|
+
return "keyword";
|
|
59
|
+
}
|
|
60
|
+
if (stream.match(control_flow_complex)) {
|
|
61
|
+
state.controlFlow = true;
|
|
62
|
+
return "keyword";
|
|
63
|
+
}
|
|
64
|
+
if (state.controlFlow) {
|
|
65
|
+
if (stream.match(operators)) {
|
|
66
|
+
return "operator";
|
|
67
|
+
}
|
|
68
|
+
if (stream.match(/^(\d+)/)) {
|
|
69
|
+
return "number";
|
|
70
|
+
}
|
|
71
|
+
if (stream.eol()) {
|
|
72
|
+
state.controlFlow = false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (stream.match(arch)) {
|
|
76
|
+
if (stream.eol()) {
|
|
77
|
+
state.controlFlow = false;
|
|
78
|
+
}
|
|
79
|
+
return "number";
|
|
80
|
+
}
|
|
81
|
+
if (stream.match(/^%[\w]+/)) {
|
|
82
|
+
if (stream.match("(")) {
|
|
83
|
+
state.macroParameters = true;
|
|
84
|
+
}
|
|
85
|
+
return "keyword";
|
|
86
|
+
}
|
|
87
|
+
if (state.macroParameters) {
|
|
88
|
+
if (stream.match(/^\d+/)) {
|
|
89
|
+
return "number";
|
|
90
|
+
}
|
|
91
|
+
if (stream.match(")")) {
|
|
92
|
+
state.macroParameters = false;
|
|
93
|
+
return "keyword";
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (stream.match(/^%\{\??[\w \-\:\!]+\}/)) {
|
|
97
|
+
if (stream.eol()) {
|
|
98
|
+
state.controlFlow = false;
|
|
99
|
+
}
|
|
100
|
+
return "def";
|
|
101
|
+
}
|
|
102
|
+
stream.next();
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
export {
|
|
107
|
+
rpmChanges,
|
|
108
|
+
rpmSpec
|
|
109
|
+
};
|