efront 3.34.12 → 3.35.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.
Files changed (81) hide show
  1. package/apps/moue/content//344/275/240/345/245/275/344/270/226/347/225/214.vue +21 -0
  2. package/apps/moue/content//344/275/240/345/245/275/345/274/200/345/217/221/350/200/205.html +1 -0
  3. package/apps/moue/{home/index.js → content//344/275/240/345/245/275/345/274/200/345/217/221/350/200/205.js} +4 -2
  4. package/apps/moue/content//344/275/240/345/245/275/345/274/200/345/217/221/350/200/205.less +4 -0
  5. package/apps/moue/home/index2.vue +97 -18
  6. package/apps/moue/index.html +1 -1
  7. package/coms/basic/ArrayFill.md +9 -0
  8. package/coms/basic/awaitable.md +10 -0
  9. package/coms/basic/backEach.md +7 -0
  10. package/coms/basic/combine.md +23 -0
  11. package/coms/basic/renderExpress.js +3 -2
  12. package/coms/basic/wait.js +5 -0
  13. package/coms/basic_/readme.md +5 -4
  14. package/coms/compile/#/350/257/264/346/230/216.md +1 -0
  15. package/coms/compile/Html.js +263 -0
  16. package/coms/compile/Html_test.js +5 -0
  17. package/coms/compile/Javascript.js +627 -0
  18. package/coms/compile/Program.js +666 -0
  19. package/coms/compile/autoenum.js +179 -0
  20. package/coms/compile/autoenum_test.js +17 -0
  21. package/coms/compile/autoeval.js +50 -0
  22. package/coms/compile/autoeval_test.js +28 -0
  23. package/coms/compile/autoiota.js +121 -0
  24. package/coms/compile/breakcode.js +83 -0
  25. package/coms/compile/common.js +1063 -0
  26. package/coms/compile/downLevel.js +901 -0
  27. package/coms/compile/downLevel_test.js +111 -0
  28. package/coms/compile/formatcode.js +57 -0
  29. package/coms/compile/iso8859.js +9 -0
  30. package/coms/compile/iso8859_test.js +2 -0
  31. package/coms/compile/keywords.js +6 -0
  32. package/coms/compile/namelist.js +154 -0
  33. package/coms/compile/namelist_test.js +7 -0
  34. package/coms/compile/polyfill.js +31 -0
  35. package/coms/compile/required.js +20 -0
  36. package/coms/compile/richcss.js +237 -0
  37. package/coms/compile/richcss_test.js +7 -0
  38. package/coms/compile/scanner.js +653 -0
  39. package/coms/compile/scanner2.js +202 -0
  40. package/coms/compile/scanner2_test.js +110 -0
  41. package/coms/compile/scanner_test.js +10 -0
  42. package/coms/compile/unstruct.js +712 -0
  43. package/coms/compile/unstruct_test.js +54 -0
  44. package/coms/compile/washcode.js +237 -0
  45. package/coms/compile/washcode_test.js +17 -0
  46. package/coms/docs/helps.js +71 -0
  47. package/coms/docs/markdown.js +248 -0
  48. package/coms/frame/route.js +1 -1
  49. package/coms/reptile/colored_console.js +2 -1
  50. package/coms/zimoli/cless.js +1 -0
  51. package/coms/zimoli/css.js +1 -9
  52. package/coms/zimoli/html.js +1 -1
  53. package/coms/zimoli/menu.js +1 -1
  54. package/coms/zimoli/menuItem.html +1 -1
  55. package/coms/zimoli/menuItem.js +1 -1
  56. package/coms/zimoli/render.js +14 -3
  57. package/coms/zimoli/text.js +1 -1
  58. package/coms/zimoli/tree.js +2 -4
  59. package/coms/zimoli/zimoli.js +39 -12
  60. package/docs/compare.md +5 -5
  61. package/docs/components.jsp +24 -0
  62. package/docs/index.html +18 -26
  63. package/docs/main.xht +207 -0
  64. package/docs/mark.xht +171 -0
  65. package/docs/version.jsp +3 -0
  66. package/docs/welcome.jsp +8 -0
  67. package/docs//345/221/275/344/273/244.xht +100 -0
  68. package/docs//347/211/210/346/234/254/350/257/264/346/230/216.md +9 -0
  69. package/docs//347/273/204/344/273/266.xht +111 -0
  70. package/package.json +1 -1
  71. package/public/efront.js +1 -1
  72. package/readme.md +8 -11
  73. package/apis/docs/getAllComponents.js +0 -69
  74. package/apps/moue/home/index.html +0 -1
  75. package/apps/moue/home/index.less +0 -0
  76. package/docs/data/iconfont-kugou.eot +0 -0
  77. package/docs/data/iconfont-kugou.otf +0 -0
  78. package/docs/data/iconfont-kugou.ttf +0 -0
  79. package/docs/data/iconfont-kugou.woff +0 -0
  80. package/docs/data/web.xml +0 -4742
  81. package/docs/main.js +0 -17
@@ -0,0 +1,666 @@
1
+ const {
2
+ /* 1 */COMMENT,
3
+ /* 2 */SPACE,
4
+ /* 4 */STRAP,
5
+ /* 8 */STAMP,
6
+ /* 16 */VALUE,
7
+ /* 32 */QUOTED,
8
+ /* 64 */PIECE,
9
+ /* 128 */EXPRESS,
10
+ /* 256 */SCOPED,
11
+ /* 512 */LABEL,
12
+ /*1024 */PROPERTY,
13
+ createString,
14
+ number_reg,
15
+ } = require("./common");
16
+ var combine = require("../basic/combine");
17
+ var setObject = function (o) {
18
+ o.isObject = true;
19
+ var needproperty = true;
20
+ for (var cx = 0; cx < o.length; cx++) {
21
+ var m = o[cx];
22
+ if (!needproperty) {
23
+ if (m.type === SCOPED && m.entry === '{') {
24
+ if (!m.isObject) setObject(m);
25
+ continue;
26
+ }
27
+ if (m.type !== STAMP || m.text !== ',') continue;
28
+ }
29
+ if (m.type === STAMP && m.text === ':') {
30
+ needproperty = false;
31
+ continue;
32
+ }
33
+ if (m.type === LABEL) {
34
+ o.splice(cx, 0, o[++cx].prev = m.next = m.next.prev = {
35
+ prev: m,
36
+ text: ':',
37
+ type: STAMP,
38
+ next: m.next,
39
+ });
40
+ m.type = PROPERTY;
41
+ m.text = m.text.replace(/\:$/, '');
42
+ m.isprop = true;
43
+ m.end--;
44
+ needproperty = false;
45
+ continue;
46
+ }
47
+ m.isprop = true;
48
+ if (m.type === EXPRESS || m.type === QUOTED) {
49
+ if (!/\./.test(m.text)) m.type = PROPERTY;
50
+ }
51
+ if (m.prev && m.prev.type === PROPERTY) {
52
+
53
+ m.prev.type = STRAP;
54
+ }
55
+ }
56
+ };
57
+ var sortRegExpSource = function (a, b) {
58
+ if (a.indexOf(b) >= 0) return -1;
59
+ if (b.indexOf(a) >= 0) return 1;
60
+ return 0;
61
+ };
62
+ var createQuotedMap = function (entry) {
63
+ var map = {};
64
+ var end = {};
65
+ entry.forEach(k => {
66
+ var [a, b] = k.slice(-2);
67
+ if (a instanceof RegExp) a = stringsFromRegExp(a);
68
+ if (b instanceof RegExp) b = stringsFromRegExp(b);
69
+ combine([].concat(a), [].concat(b)).forEach(([a, b]) => {
70
+ map[a] = b;
71
+ end[b] = a;
72
+ });
73
+ });
74
+ return [map, end];
75
+
76
+ }
77
+ var stringsFromRegExp = function (reg) {
78
+ // 只处理有限长度无嵌套无分支的表达式
79
+ var source = reg.source;
80
+ var queue = [];
81
+ for (var cx = 0, dx = source.length; cx < dx; cx++) {
82
+ var s = source[cx];
83
+ if (source[cx] === "\\") {
84
+ var s = source[++cx];
85
+ queue.push(s);
86
+ }
87
+ else if (s === "?") {
88
+ queue[queue.length - 1] = [queue[queue.length - 1][0], ""];
89
+ }
90
+ else {
91
+ queue.push(s);
92
+ }
93
+ }
94
+ var res = combine(...queue).map(a => a.join(""));
95
+ return res;
96
+ }
97
+
98
+ class Program {
99
+ quotes = [
100
+ [/'/, /'/, /\\[\s\S]/],
101
+ [/"/, /"/, /\\[\s\S]/],
102
+ ["/", /\/[a-z]*/, /\\[\s\S]|\[(\\[\s\S]|[^\]])+\]/],
103
+ ["`", "`", /\\[\s\S]/, ["${", "}"]],
104
+ ]
105
+ tags = [
106
+ [["<", "</"], /\/?>/, null, ["=", "'", '"', "{", "}"], [/<!--/, /--!?>/]]
107
+ ];
108
+ comments = [
109
+ ["//", /(?=[\r\n\u2028\u2029])/],
110
+ ["/*", "*/"],
111
+ [/<!--/, /--!?>/],
112
+ ]
113
+ scopes = [
114
+ ["(", ")"],
115
+ ["[", "]"],
116
+ ["{", "}"],
117
+ ]
118
+ stamps = "/=+;|:?<>-!~%^&*,".split("")
119
+ value_reg = /^(false|true|null)$/
120
+ number_reg = number_reg;
121
+ Code = Array;
122
+ transive_reg = /^(new|void|switch|case|break|continue|return|throw|extends|import)$/
123
+ straps = "if,for".split(',');
124
+ colonstrap_reg = /^(case|default)$/;
125
+ forceend_reg = /^(return|break|continue)$/;
126
+ classstrap_reg = /^(class)$/;
127
+ extends_reg = /^(extends)$/;
128
+ export_reg = /^(export)$/;
129
+ spaces = [
130
+ "\\u0002",
131
+ "\\b-\\r",// "\\b"/*8*/, "\\t"/*9*/, "\\n"/*10*/, "\\v"/*11*/, "\\f"/*12*/, "\\r"/*13*/,
132
+ " "/*32*/,
133
+ "\\u007f", "\\u00a0", "\\u00ad", "\\u034f", "\\u061c",
134
+ "\\u115f", "\\u1160",
135
+ "\\u17b4", "\\u17b5",
136
+ "\\u180b-\\u180e",
137
+ "\\u1cbb", "\\u1cbc",
138
+ "\\u2000-\\u200f",
139
+ "\\u2028-\\u202f",
140
+ "\\u205f-\\u206f",
141
+ "\\u2800", "\\u3000", "\\u3164",
142
+ "\\ufe00-\\ufe0f",
143
+ "\\ufeff", "\\uffa0",
144
+ "\\ufff0-\\ufff8",
145
+ "\\u{133fc}",
146
+ "\\u{1d173}-\\u{1d17a}"
147
+ ]
148
+ nocase = false
149
+ lastIndex = 0
150
+ compile(s) {
151
+ return s.replace(/\\[\s\S]|[\[\]\(\)\{\}\+\.\-\*\?\$\^\|\\\/]/g, function (m) {
152
+ if (m.length > 1) {
153
+ return m;
154
+ }
155
+ return "\\" + m;
156
+ });
157
+ }
158
+ createRegExp(source, g) {
159
+ source = source.map(s => {
160
+ if (s instanceof RegExp) return s.source;
161
+ if (s instanceof Array) return s.slice().sort(sortRegExpSource).map(s => this.compile(s)).join("|");
162
+ return this.compile(s);
163
+ });
164
+ var flag = this.nocase ? "i" : "";
165
+ var s = source.join("|");
166
+ if (g) return new RegExp(`${s}`, "g" + flag);
167
+ if (source.length > 1) return new RegExp(`^(${s})$`, flag);
168
+ return new RegExp(`^${s}$`, flag);
169
+ }
170
+ setType() {
171
+ }
172
+
173
+ exec(text) {
174
+ if (!this.entry_reg) this.commit();
175
+ var index = this.lastIndex;
176
+ var parents = [];
177
+ var lasttype;
178
+ var Code = this.Code;
179
+ var queue = new Code();
180
+ queue.__proto__ = Code.prototype;
181
+ var origin = queue;
182
+ var colonstrap_reg = this.colonstrap_reg;
183
+ var forceend_reg = this.forceend_reg;
184
+ var program = this;
185
+ var queue_push = function (scope) {
186
+ var last = queue.last;
187
+ Object.defineProperty(scope, 'queue', { value: queue, enumerable: false });
188
+ scope.prev = last;
189
+ if (scope.type !== COMMENT && scope.type !== SPACE) {
190
+ if (program.setType(scope) === false) {
191
+ if (queue.last !== last) last = queue.last;
192
+ else if (scope.prev !== last) last = scope.prev;
193
+ while (queue[queue.length - 1] !== last) queue.pop();
194
+ last.end = scope.end;
195
+ last.text = text.slice(last.start, last.end);
196
+ return;
197
+ }
198
+ if (last) last.next = scope;
199
+ queue.last = scope;
200
+ for (var cx = queue.length - 1; cx >= 0; cx--) {
201
+ var o = queue[cx];
202
+ if (o === last) break;
203
+ o.next = scope;
204
+ }
205
+ if (!queue.first) queue.first = scope;
206
+ }
207
+ scope.row = row;
208
+ scope.col = scope.start - colstart;
209
+ queue.push(scope);
210
+ };
211
+ var row = 1, colstart = -1;
212
+ var save = (type) => {
213
+ if (lasttype === STAMP && type === STAMP && !/[,;\:\?]/.test(m)) {
214
+ var scope = queue[queue.length - 1];
215
+ if (/=>$/i.test(scope.text) ||
216
+ /[=>]$/.test(scope.text) && /[^>=]/.test(m) ||
217
+ /[?]$/.test(scope.text) && /[^?\.=\:]/.test(m) ||
218
+ /[,;]$/.test(scope.text) ||
219
+ scope.end !== start) {
220
+ } else {
221
+ scope.end = end;
222
+ scope.text = text.slice(scope.start, scope.end);
223
+ program.setType(scope);
224
+ return;
225
+ }
226
+ }
227
+ var last = queue.last;
228
+ if (type === SPACE) {
229
+ if (last && last.type === STRAP && forceend_reg.test(last.text)) {
230
+ last.isend = true;
231
+ queue.inExpress = false;
232
+ }
233
+ }
234
+ else if (type !== STAMP);
235
+ else if (m === ";") queue.inExpress = false;
236
+ else if (last) check: switch (m) {
237
+ case "?":
238
+ queue.inExpress = true;
239
+ if (!queue.question) queue.question = 1;
240
+ else queue.question++;
241
+ break;
242
+ case "=":
243
+ if (last.type === SCOPED && last.entry === "{") {
244
+ if (!last.isObject) {
245
+ setObject(last);
246
+ }
247
+ }
248
+ case ",":
249
+ if (queue.isObject) {
250
+ if (last.type === PROPERTY) {
251
+ last.short = true;
252
+ }
253
+ }
254
+ queue.inExpress = true;
255
+ break;
256
+ case ":":
257
+ if (queue.question) {
258
+ queue.question--;
259
+ queue.inExpress = true;
260
+ break;
261
+ }
262
+ if (queue.isObject) {
263
+ if (last.type === PROPERTY || last.isprop) {
264
+ queue.inExpress = true;
265
+ break;
266
+ }
267
+ if (last.type === SCOPED && (!last.prev || !last.prev.type === STAMP && last.prev.text === ",")) {
268
+ queue.inExpress = true;
269
+ }
270
+ break;
271
+ }
272
+ var temp = last;
273
+ while (temp) {
274
+ if (temp.type === STRAP && colonstrap_reg.test(temp.text)) {
275
+ queue.inExpress = false;
276
+ break check;
277
+ }
278
+ if (!temp.isExpress) break;
279
+ temp = temp.prev;
280
+ }
281
+ queue.inExpress = false;
282
+ if (last.type === EXPRESS) {
283
+ // label
284
+ last.type = LABEL;
285
+ last.text += ":";
286
+ last.end = end;
287
+ return;
288
+ }
289
+ break;
290
+ default:
291
+ queue.inExpress = true;
292
+ }
293
+ else {
294
+ queue.inExpress = true;
295
+ }
296
+ var scope = {
297
+ type,
298
+ start,
299
+ end,
300
+ isExpress: queue.inExpress,
301
+ text: m
302
+ }
303
+ if (isdigit) scope.isdigit = true;
304
+ lasttype = type;
305
+ queue_push(scope);
306
+ };
307
+ var space_exp = this.space_exp;
308
+ var openTag = function () {
309
+ queue.inTag = true;
310
+ var m1 = text.slice(start, match.index);
311
+ var s = space_exp.exec(m1);
312
+ if (s) var tag = m1.slice(0, s.index);
313
+ else {
314
+ tag = m1;
315
+ }
316
+ if (queue.tag) {
317
+ if (queue.last.text === quote.tag[1]) {
318
+ while (p && p.tag && p.tag !== p.tag) ps.push(p), p = parents[--pi];
319
+ if (p && ps.length) {
320
+ var pie = queue.pop();
321
+ queue.last = pie.prev;
322
+ queue = p;
323
+ while (ps.length) queue_push(ps.shift());
324
+ queue_push(pie);
325
+ }
326
+ m = tag;
327
+ save(PIECE);
328
+ queue.closed = true;
329
+ var p = queue;
330
+ var pi = parents.length;
331
+ var ps = [];
332
+ }
333
+
334
+ }
335
+ else {
336
+ queue.tag = tag;
337
+ m = m1;
338
+ save(PIECE);
339
+ }
340
+ if (queue.closed) {
341
+ index = match.index;
342
+ }
343
+ };
344
+ var closeTag = function () {
345
+ queue.inTag = false;
346
+ if (queue.closed) return;
347
+ return false;
348
+ };
349
+ var push_quote = function () {
350
+ var scope = [];
351
+ scope.entry = m;
352
+ scope.type = SCOPED;
353
+ scope.inExpress = true;
354
+ scope.leave_map = quote.leave;
355
+ end = match.index;
356
+ m = text.slice(start, end);
357
+ save(PIECE);
358
+ push_parents(scope);
359
+ };
360
+ var push_parents = function (scope) {
361
+ scope.queue = queue;
362
+ scope.prev = queue.last;
363
+ parents.push(queue);
364
+ queue = scope;
365
+ lasttype = null;
366
+ }
367
+ var pop_parents = function () {
368
+ var scope = queue;
369
+ queue = parents.pop();
370
+ queue_push(scope);
371
+ lasttype = scope.type;
372
+ }
373
+
374
+ loop: while (index < text.length) {
375
+ if (queue.type === QUOTED) {
376
+ var quote = this.quote_map[queue.entry];
377
+ var reg = quote.reg;
378
+ start = index;
379
+ while (index < text.length) {
380
+ reg.lastIndex = index;
381
+ var match = reg.exec(text);
382
+ if (!match) {
383
+ index = text.length;
384
+ break loop;
385
+ }
386
+ var m = match[0];
387
+ index = match.index + m.length;
388
+ if (quote.tag && queue.inTag === 0) {
389
+ openTag();
390
+ index = start = match.index;
391
+ continue;
392
+ }
393
+ if (quote.end.test(m)) {
394
+ end = match.index;
395
+ if (queue.tag && closeTag() === false) {
396
+ save(PIECE);
397
+ start = index;
398
+ continue loop;
399
+ }
400
+ queue.leave = m;
401
+ if (start < end) {
402
+ m = text.slice(start, end);
403
+ save(PIECE);
404
+ }
405
+ break;
406
+ }
407
+ a: if (quote.tag) {
408
+ var mi = quote.tag.indexOf(m);
409
+ if (mi < 0) break a;
410
+ if (mi === 0) {
411
+ var scope = [];
412
+ scope.entry = m;
413
+ scope.type = QUOTED;
414
+ scope.start = index;
415
+ push_parents(scope);
416
+ queue.inTag = 0;
417
+ start = index;
418
+ continue;
419
+ }
420
+ save(PIECE);
421
+ queue.inTag = 0;
422
+ start = index;
423
+ continue;
424
+ }
425
+ if (m in quote.entry) {
426
+ push_quote();
427
+ continue loop;
428
+ }
429
+ }
430
+ queue.end = match.index;
431
+ pop_parents();
432
+ continue;
433
+ }
434
+ var reg = this.entry_reg;
435
+ var start = reg.lastIndex = index;
436
+ var match = reg.exec(text);
437
+ if (!match) return null;
438
+ var end = match[0].length + match.index;
439
+ this.lastIndex = index = end;
440
+ var m = match[0];
441
+ test: if (this.quote_map.hasOwnProperty(m)) {
442
+ var last = queue.last;
443
+ if (this.stamp_reg.test(m) && last) {
444
+ if ((VALUE | EXPRESS) & last.type) break test;
445
+ if (last.type === QUOTED && !last.tag) break test;
446
+ if (last.type === SCOPED && queue.inExpress) break test;
447
+ if (lasttype === STAMP && m === last.text) break test;
448
+ }
449
+ var scope = [];
450
+ var quote = this.quote_map[m];
451
+ scope.type = this.comment_entry.test(m) ? COMMENT : QUOTED;
452
+ scope.start = start;
453
+ push_parents(scope);
454
+ if (quote.tag) {
455
+ queue.entry = m;
456
+ queue.inTag = 0;
457
+ continue loop;
458
+ }
459
+
460
+ var m0 = m;
461
+ var reg = quote.reg;
462
+ while (index < text.length) {
463
+ reg.lastIndex = index;
464
+ var match = reg.exec(text);
465
+ if (!match) {
466
+ index = text.length;
467
+ break;
468
+ }
469
+ var m = match[0];
470
+ index = this.lastIndex = match.index + m.length;
471
+ if (quote.length === 2) {
472
+ break;
473
+ }
474
+ if (quote.end.test(m)) {
475
+ break;
476
+ }
477
+ if (quote.length === 3) {
478
+ continue;
479
+ }
480
+ if (quote.length >= 4 && m in quote.entry) {
481
+ queue.entry = m0;
482
+ start += m0.length;
483
+ push_quote();
484
+ continue loop;
485
+ }
486
+ }
487
+ queue.inExpress = true;
488
+ queue.end = index;
489
+ queue.text = text.slice(queue.start, index);
490
+ row += queue.text.replace(/[^\r\n\u2028\u2029]+/g, ':').replace(/\r\n/g, ',').replace(/:/g, '').length;
491
+ pop_parents();
492
+ continue;
493
+ }
494
+ var parent = parents[parents.length - 1];
495
+ if (parent && this.quote_map[parent.entry] && queue.leave_map[m] === queue.entry) {
496
+ delete queue.leave_map;
497
+ queue.end = end;
498
+ queue.leave = m;
499
+ pop_parents();
500
+ continue;
501
+ }
502
+ if (this.space_reg.test(m)) {
503
+ if (/[\r\n\u2028\u2029]/.test(m)) {
504
+ m = m.replace(/^[^\r\n\u2028\u2029]+/, '').replace(/\r\n|\r|\n|\u2028|\u2029/g, "\r\n");
505
+ row += m.replace(/[^\r\n]+/g, '').length >> 1;
506
+ colstart = match.index + m.replace(/[^\r\n]+$/, '').length - 1;
507
+ save(SPACE);
508
+ }
509
+ lasttype = SPACE;
510
+ continue;
511
+ }
512
+ if (this.strap_reg.test(m)) {
513
+ if (!this.classstrap_reg.test(m)) queue.inExpress = this.transive_reg.test(m);
514
+ else {
515
+ var last = queue.last;
516
+ if (!last) queue.inExpress = false;
517
+ else if (last.type === STAMP) {
518
+ queue.inExpress = !/^(;|\+\+|\-\-)$/.test(last.text);
519
+ }
520
+ else if (last.type !== STRAP) {
521
+ queue.inExpress = false;
522
+ }
523
+ }
524
+ save(STRAP);
525
+ continue;
526
+ }
527
+ var isdigit = this.number_reg.test(m);
528
+ if (this.value_reg.test(m) || isdigit) {
529
+ save(VALUE);
530
+ queue.inExpress = true;
531
+ continue;
532
+ }
533
+ if (this.express_reg.test(m)) {
534
+ var last = queue.last;
535
+ if (last && last.type === STRAP && this.classstrap_reg.test(last.text));
536
+ else queue.inExpress = true;
537
+ save(EXPRESS);
538
+ continue;
539
+ }
540
+
541
+ if (this.scope_entry[m]) {
542
+ var scope = [];
543
+ scope.entry = m;
544
+ scope.type = SCOPED;
545
+ var last = queue.last;
546
+ if (m === "{") {
547
+ if (!last) {
548
+ scope.isObject = queue.inExpress;
549
+ }
550
+ else if (queue.classed > 0) {
551
+ if (last.type !== STAMP || last.text !== "=>") {
552
+ queue.classed--;
553
+ scope.isClass = true;
554
+ scope.extend += this.extends_reg.test(last.text);
555
+ scope.inExpress = false;
556
+ }
557
+ }
558
+ else if (last.type === STAMP) {
559
+ if (last.text === ':') {
560
+ scope.isObject = queue.inExpress;
561
+ }
562
+ else scope.isObject = !/^(;|\+\+|\-\-|=>)$/.test(last.text);
563
+ }
564
+ else if (last.type === STRAP) {
565
+ if (queue[queue.length - 1].type === SPACE && forceend_reg.test(last.text));
566
+ else if (this.export_reg.test(last.text));
567
+ else scope.isObject = queue.inExpress;
568
+ }
569
+ }
570
+ else {
571
+ if (!last || (last.type & (SCOPED | STAMP))) queue.inExpress = true;
572
+ scope.isExpress = queue.inExpress;
573
+ scope.inExpress = true;
574
+ }
575
+ scope.start = match.index;
576
+ push_parents(scope);
577
+ continue;
578
+ }
579
+ if (this.scope_leave[m] && queue.entry === this.scope_leave[m]) {
580
+ var lastUncomment = queue.last;
581
+ if (lastUncomment) {
582
+ if (lastUncomment.type === PROPERTY) {
583
+ lastUncomment.short = true;
584
+ }
585
+ }
586
+
587
+ queue.end = end;
588
+ queue.leave = m;
589
+ pop_parents();
590
+ continue;
591
+ }
592
+
593
+ if (this.stamp_reg.test(m)) {
594
+ save(STAMP);
595
+ }
596
+
597
+ }
598
+ if (queue !== origin) throw console.log(createString(origin), createString([queue])), new Error("代码异常结束");
599
+ return queue;
600
+ }
601
+ commit() {
602
+ this.strap_reg = this.createRegExp(this.straps);
603
+ this.comment_entry = this.createRegExp(this.comments.map(m => m[0]));
604
+ var stamps = this.stamps.join("");
605
+ stamps = this.compile(stamps);
606
+ this.stamp_reg = new RegExp(`^[${stamps}]$`);
607
+ var tokens = {};
608
+ var quote_map = {};
609
+ this.quote_map = quote_map;
610
+ this.tags.forEach(t => t.tag = t[0]);
611
+ var quoteslike = this.comments.concat(this.quotes, this.tags);
612
+ quoteslike.forEach(q => {
613
+ var a = q[0];
614
+ if (a instanceof RegExp) a = stringsFromRegExp(a);
615
+ if (typeof a === "string" && a.length === 1) tokens[a] = true;
616
+ if (a instanceof Array) {
617
+ a.forEach(a => quote_map[a] = q);
618
+ }
619
+ else quote_map[a] = q;
620
+ var r = q.slice(q[2] ? 2 : 3).concat(q[1]).map(q => {
621
+ if (q instanceof Array) {
622
+ q = q[q.length - 2];
623
+ }
624
+ if (q instanceof RegExp) {
625
+ return q.source;
626
+ }
627
+ return this.compile(q);
628
+ });
629
+ if (q.tag) r = r.concat(q.tag.slice().sort(sortRegExpSource));
630
+ r = r.join("|");
631
+ q.reg = new RegExp(r, 'g');
632
+ q.end = this.createRegExp([q[1]]);
633
+ if (q.length >= 4) {
634
+ var entry = q.slice(3);
635
+ if (q.tag) entry.push([q.tag, q[1]]);
636
+ [q.entry, q.leave] = createQuotedMap(entry);
637
+ }
638
+ });
639
+ var scope_entry = {};
640
+ this.scope_entry = scope_entry;
641
+ this.scope_leave = {};
642
+ var scope_leave = this.scope_leave;
643
+ this.scopes.forEach(s => {
644
+ var [a, b] = s;
645
+ scope_entry[a] = b;
646
+ scope_leave[b] = a;
647
+ tokens[a] = true;
648
+ tokens[b] = true;
649
+ });
650
+ this.stamps.forEach(s => {
651
+ tokens[s] = true;
652
+ });
653
+ var scopes = this.scopes.map(a => a.join("")).join("");
654
+ scopes = this.compile(scopes);
655
+ var spaces = this.spaces.join("");
656
+ tokens = Object.keys(tokens).join("");
657
+ tokens = this.compile(tokens) + spaces;
658
+ var express = `[^${tokens}]+`;
659
+ this.express_reg = new RegExp(`^${express}$`, 'u');
660
+ this.space_reg = new RegExp(`^[${spaces}]+$`, 'u');
661
+ this.space_exp = new RegExp(`[${spaces}]+`, 'u');
662
+ var quotes = this.createRegExp(quoteslike.map(q => q[0]), true).source;
663
+ this.entry_reg = new RegExp([`[${spaces}]+|${quotes}|[${scopes}]|${this.number_reg.source.replace(/^\^|\$$/g, "")}[^${tokens}]*|${express}|[${stamps}]`], "giu");
664
+ }
665
+ }
666
+ module.exports = Program;