efront 4.0.58 → 4.1.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.
@@ -1,3 +1,237 @@
1
+ - zh-CN: 未没找到匹配的资源:$1
2
+ en: "No matching resources found: $1"
3
+
4
+ - zh-CN: 检查到$1可以正常访问
5
+ en: Checked that $1 can be accessed normally
6
+
7
+ - zh-CN: 服务器地址:$1
8
+ en: "Server address: $1"
9
+
10
+ - zh-CN: 正常访问
11
+ en: Normal access
12
+
13
+ - zh-CN: 端口被占用
14
+ en: Port is occupied
15
+
16
+ - zh-CN: 没有权限
17
+ en: No permission
18
+
19
+ - zh-CN: 端口打开失败
20
+ en: Port opening failed
21
+
22
+ - zh-CN: HTTPS端口正在使用默认证书,请不要在生产环境使用此功能!
23
+ en: "HTTPS port is using default certificate, please do not use this feature in production environment!"
24
+
25
+ - zh-CN: 没有找到指定的全局变量
26
+ en: The specified global variable was not found
27
+
28
+ - zh-CN: 在以上 $1 个文件中找到了指定的全局变量
29
+ en: Found the specified global variable in the $1 file above
30
+
31
+ - zh-CN: 正在查找
32
+ en: Finding
33
+
34
+ - zh-CN: "路径不正在:"
35
+ en: "Path not in progress:"
36
+
37
+ - zh-CN: "处理完成:$1\r\n => $2"
38
+ en: "Processing completed: $1\r\n => $2"
39
+
40
+ - zh-CN: 请输入目标路径!
41
+ en: Please enter the target path!
42
+
43
+ - zh-CN: 请输入网络路径!
44
+ en: Please enter the network path!
45
+
46
+ - zh-CN: 无法确定文件名
47
+ en: Unable to determine file name
48
+
49
+ - zh-CN: 完成:
50
+ en: "Complete:"
51
+
52
+ - zh-CN: 服务器忙,请稍后再试!
53
+ en: "The server is busy, please try again later!"
54
+
55
+ - zh-CN: 重试
56
+ en: retry
57
+
58
+ - zh-CN: $1秒后再试
59
+ en: Try again in $1 second
60
+
61
+ - zh-CN: $1分钟后再试
62
+ en: Try again in $1 minute
63
+
64
+ - zh-CN: $1小时后再试
65
+ en: Try again in $1 hour
66
+
67
+ - zh-CN: 过几天再试
68
+ en: Try again in a few days
69
+
70
+ - zh-CN: 操作过于频繁,请$1
71
+ en: "Operation too frequent, please $1"
72
+
73
+ - zh-CN: 禁止访问!
74
+ en: Access prohibited!
75
+
76
+ - zh-CN: 检查到未知环境变量
77
+ en: Unknown environment variable detected
78
+
79
+ - zh-CN: 发现重名配置
80
+ en: Found duplicate name configuration
81
+
82
+ - zh-CN: 注册表操作暂不支持当前操作系统!
83
+ en: Registry operation currently does not support the current operating system!
84
+
85
+ - zh-CN: 注册表操作不支持$1
86
+ en: Registry operation does not support $1
87
+
88
+ - zh-CN: 注册表操作不支持此项 $1
89
+ en: Registry operation does not support this key $1
90
+
91
+ - zh-CN: 启动失败
92
+ en: Start failed
93
+
94
+ - zh-CN: 格式错误
95
+ en: Format error
96
+
97
+ - zh-CN: 代码结构异常!
98
+ en: Code structure exception!
99
+
100
+ - zh-CN: 缺少from语句
101
+ en: Missing from statement
102
+
103
+ - zh-CN: 缺少导入路径!
104
+ en: Missing import path!
105
+
106
+ - zh-CN: 缺少导出名!
107
+ en: Lack of guidance!
108
+
109
+ - zh-CN: 标记不匹配
110
+ en: Tag mismatch
111
+
112
+ - zh-CN: 类型不支持
113
+ en: Type not supported
114
+
115
+ - zh-CN: 参数异常!
116
+ en: Parameter exception!
117
+
118
+ - zh-CN: "range参数错误:"
119
+ en: "Range parameter error:"
120
+
121
+ - zh-CN: each参数异常!
122
+ en: Abnormal each parameter!
123
+
124
+ - zh-CN: 结构异常
125
+ en: Structural abnormalities
126
+
127
+ - zh-CN: 请指定输出路径!
128
+ en: Please specify the output path!
129
+
130
+ - zh-CN: 输出路径已存在,并且不是文件夹!
131
+ en: The output path already exists and is not a folder!
132
+
133
+ - zh-CN: 正在重写ASM
134
+ en: Rewriting ASM
135
+
136
+ - zh-CN: 正在导出组件
137
+ en: Exporting components
138
+
139
+ - zh-CN: 正在编译项目
140
+ en: Compiling project
141
+
142
+ - zh-CN: 项目内未发面主页面
143
+ en: Unpublished homepage within the project
144
+
145
+ - zh-CN: 启动自动刷新服务失败!
146
+ en: Failed to start automatic refresh service!
147
+
148
+ - zh-CN: 编译异常
149
+ en: Compilation exception
150
+
151
+ - zh-CN: 正在合成
152
+ en: Synthesizing
153
+
154
+ - zh-CN: 在 $1 中检测到可能不存在的外部变量:
155
+ en: "Detected external variables that may not exist in $1:"
156
+
157
+ - zh-CN: "压缩($1/$2):"
158
+ en: "Compression ($1/$2):"
159
+
160
+ - zh-CN: 存在环形引用:$1
161
+ en: "There is a circular reference: $1"
162
+
163
+ - zh-CN: 没有可导出的文件!
164
+ en: There are no files to export!
165
+
166
+ - zh-CN: 缺少变量:
167
+ en: "Missing variable:"
168
+
169
+ - zh-CN: 缺少常量:
170
+ en: "Missing constant:"
171
+
172
+ - zh-CN: watch功能在当前操作系统可能无法使用!
173
+ en: The watch function may not be available on the current operating system!
174
+
175
+ - zh-CN: 正在写入文件..
176
+ en: Writing file
177
+
178
+ - zh-CN: 请不要在非发布目录写文件!
179
+ en: Please do not write files in non published directories!
180
+
181
+ - zh-CN: 请不要将文件写入非发布目录!
182
+ en: Please do not write files to non publishing directories!
183
+
184
+ - zh-CN: 十进制
185
+ en: Decimal system
186
+
187
+ - zh-CN: 十六进制
188
+ en: Hexadecimal
189
+
190
+ - zh-CN: 二进制
191
+ en: Binary
192
+
193
+ - zh-CN: 八进制
194
+ en: Octal
195
+
196
+ - zh-CN: 三十六进制
197
+ en: Thirty six base
198
+
199
+ - zh-CN: 浮点数机器码
200
+ en: Floating point machine code
201
+
202
+ - zh-CN: 双精度机器码
203
+ en: Double precision machine code
204
+
205
+ - zh-CN: 数值换算
206
+ en: Numerical conversion
207
+
208
+ - zh-CN: 检查utf8
209
+ en: Check utf8
210
+
211
+ - zh-CN: 检查gbk
212
+ en: Check gbk
213
+
214
+ - zh-CN: 要检查的字符集区间(双字节以内)
215
+ en: Character set interval to check (within double bytes)
216
+
217
+ - zh-CN: 编码
218
+ en: coding
219
+
220
+ - zh-CN: 识别为unicode后的字符
221
+ en: Characters recognized as unicode
222
+
223
+ - zh-CN: 识别为gbk后的字符
224
+ en: Characters recognized as gbk
225
+
226
+ - zh-CN: 正在生成报告
227
+ en: Generating report
228
+
229
+ - zh-CN: 从网络下载文件,类似unix中的wget
230
+ en: "Download files from the network, similar to wget in Unix"
231
+
232
+ - zh-CN: 输入内容..
233
+ en: Input content
234
+
1
235
  - zh-CN: readme.md
2
236
  en: readme-en.md
3
237
 
@@ -152,10 +386,10 @@
152
386
  en: "Translation:"
153
387
 
154
388
  - zh-CN: "跳过了缺少参数的请求:$1 $2 $3\r\n缺少参数:$4"
155
- en:
389
+ en: "Skipped request $1 $2 $3 \r\n Missing parameters $4"
156
390
 
157
391
  - zh-CN: ", 可能的取值有 $1"
158
- en: Possible values are $1
392
+ en: ", possible values are $1"
159
393
 
160
394
  - zh-CN: 修改国际化参数
161
395
  en: Modify internationalization parameters
@@ -281,7 +515,7 @@
281
515
  en: Api with the same id set multiple times:%c $1
282
516
 
283
517
  - zh-CN: 跳过了缺少参数的请求:$1 $2 $3\r\n缺少参数:$4
284
- en:
518
+ en: Skipped request $1 $2 $3 Missing parameter $4
285
519
 
286
520
  - zh-CN: 没有找到对应的接口 id $1.
287
521
  en: No corresponding interface id $1 was found
@@ -311,7 +545,7 @@
311
545
  en: "The command syntax that can be used for $1 is:"
312
546
 
313
547
  - zh-CN: 其中
314
- en: among
548
+ en: among them
315
549
 
316
550
  - zh-CN: 请指定输出文件名!
317
551
  en: Please specify the output file name!
@@ -648,8 +648,8 @@ var removeImport = function (c, i, code) {
648
648
  var { used, envs, vars } = code;
649
649
  if (next && next.type !== QUOTED) {
650
650
  var [dec, map, o] = getDeclared(c.next);
651
- if (!o) throw new Error("代码结构异常!");
652
- if (o.type !== STRAP || o.text !== 'from') throw new Error("缺少from语句");
651
+ if (!o) throw new Error(i18n`代码结构异常!`);
652
+ if (o.type !== STRAP || o.text !== 'from') throw new Error(i18n`缺少from语句`);
653
653
  var oi = code.indexOf(o, i);
654
654
  }
655
655
  else code.splice(i, 1), o = c, oi = i - 1;
@@ -666,7 +666,7 @@ var removeImport = function (c, i, code) {
666
666
  splice(code, ni, 1);
667
667
  n = n.next;
668
668
  }
669
- if (!n || n.type !== QUOTED) throw new Error("缺少导入路径!");
669
+ if (!n || n.type !== QUOTED) throw new Error(i18n`缺少导入路径!`);
670
670
  var ns = skipAssignment(n);
671
671
  var nsi = ns ? code.indexOf(ns, i) : code.length;
672
672
  var q = scan(`require()`);
@@ -748,7 +748,7 @@ var removeExport = function (c, i, code) {
748
748
  var n = o.next;
749
749
  if (n && n.type === STRAP && n.text === 'as') {
750
750
  var nn = n.next;
751
- if (!nn) throw new Error("缺少导出名!");
751
+ if (!nn) throw new Error(i18n`缺少导出名!`);
752
752
  prop = nn.text;
753
753
  o = nn;
754
754
  n = o.next;
@@ -766,7 +766,7 @@ var removeExport = function (c, i, code) {
766
766
  }
767
767
  return;
768
768
  }
769
- if (n.type !== STRAP) throw new Error("代码结构异常!");
769
+ if (n.type !== STRAP) throw new Error(i18n`代码结构异常!`);
770
770
  if (n.text === 'default') {
771
771
  n.text = '=';
772
772
  n.type = STAMP;
@@ -523,7 +523,7 @@ class Program {
523
523
  pop_parents();
524
524
  continue;
525
525
  }
526
- if (this.scope_leave[m]) console.warn("标记不匹配", queue.entry, m, "queue:", `${queue.row}:${queue.col}`, "position:", `${row}:${index - colstart}\r\n`, text.slice(queue.start, index));
526
+ if (this.scope_leave[m]) console.warn(i18n`标记不匹配`, queue.entry, m, "queue:", `${queue.row}:${queue.col}`, "position:", `${row}:${index - colstart}\r\n`, text.slice(queue.start, index));
527
527
  if (this.stamp_reg.test(m)) {
528
528
  save(STAMP);
529
529
  }
@@ -9,7 +9,7 @@ var createRefId = function (o) {
9
9
  if (o.type === SCOPED) {
10
10
  if (o.entry !== '[') break;
11
11
  var t = o.last;
12
- if (!t) throw new Error("格式错误");
12
+ if (!t) throw new Error(i18n`格式错误`);
13
13
  if (t.type === QUOTED) {
14
14
  if (!t.length) {
15
15
  if (/\.|^#/.test(t.text)) {
@@ -61,30 +61,38 @@ var maplist = function (u) {
61
61
  map[r].ccount = 0;
62
62
  }
63
63
  var m = map[r];
64
- m.push(o);
64
+ if (!o.equal && o.kind) m.unshift(o);
65
+ else m.push(o);
65
66
  if (o.equal || o.kind) {
66
- var typeref = o.typeref;
67
- if (typeref && typeof typeref === 'object') {
68
- typeref = typeref.typeref;
69
- o.typeref = typeref;
70
- }
71
- if (typeref && typeref !== m.typeref) {
72
- m.typeref = typeref;
73
- m.wcount++;
67
+ if (enumtype & REFTYPE) {
68
+ var typeref = o.typeref;
69
+ if (typeref && typeof typeref === 'object') {
70
+ typeref = typeref.typeref;
71
+ o.typeref = typeref;
72
+ }
73
+ if (typeref) {
74
+ if (m.typeref !== typeref) {
75
+ m.typeref = typeref;
76
+ m.wcount++;
77
+ }
78
+ }
79
+ else if (m.typeref) {
80
+ var n = o.next;
81
+ o[ignore] = true;
82
+ if (n.type === STAMP && /^(\+\+|\-\-)$/.test(n.text)) continue;
83
+ if (/^[\+\-]\=$/.test(n.text)) {
84
+ var nn = n.next;
85
+ if (nn && snapExpressFoot(nn) == nn && nn.isdigit && (nn.text & 0x1ff) === +nn.text) continue;
86
+ }
87
+ else if (!n || !/[^=!]?=$/.test(n.text)) continue;
88
+ o[ignore] = false;
89
+ m.wcount++;
90
+ }
74
91
  }
75
- else if (m.typeref) {
76
- var n = o.next;
77
- o[ignore] = true;
78
- if (n.type === STAMP && /^(\+\+|\-\-)$/.test(n.text)) continue;
79
- if (/^[\+\-]\=$/.test(n.text)) {
80
- var nn = n.next;
81
- if (nn && snapExpressFoot(nn) == nn && nn.isdigit && (nn.text & 0x1ff) === +nn.text) continue;
82
- }
83
- else if (!n || !/=$/.test(n.text)) continue;
84
- o[ignore] = false;
85
- m.wcount++;
92
+ if (enumtype & (REFSTRC | REFMOVE)) {
93
+ if (o.property) o[ignore] = true;
94
+ else m.wcount++;
86
95
  }
87
- else m.wcount++;
88
96
  }
89
97
  if (o.called) m.ccount++;
90
98
  }
@@ -140,6 +148,10 @@ function inCondition(o) {
140
148
  }
141
149
  if (p.type === STAMP) {
142
150
  if (p.text === ";") break;
151
+ if (/^[\?\:]$/i.test(p.text)) {
152
+ incondition = true;
153
+ break;
154
+ }
143
155
  o = p.prev;
144
156
  continue;
145
157
  }
@@ -149,62 +161,79 @@ function inCondition(o) {
149
161
 
150
162
  }
151
163
 
152
- function enumref(scoped) {
153
- var { refs } = scoped;
154
- for (var k in refs) {
155
- var rs = refs[k];
156
- for (var rk in rs) {
157
- var os = rs[rk];
158
- if (os.wcount !== 1 || os.length < 2) continue;
159
- var eq = null, em = null, tp = null;
160
- loop: for (var o of os) {
161
- if (o.equal && !o[ignore]) {
162
- if (o.equal.text !== '=') break;
163
- if (o.queue.kind) break;
164
- var q = o.queue;
165
- if (q !== scoped.body) {
166
- if (q.entry === '(' && q.queue === scoped.body) {
167
- var qp = q.prev;
168
- if (qp.type === EXPRESS) qp = qp.prev;
169
- if (qp && qp.type === STRAP && qp.text === "await") qp = qp.prev;
170
- if (qp && qp.type === STRAP && qp.text === 'for') {
171
- var f = q.first;
172
- var fc = 0;
173
- while (f && f !== o) {
174
- if (f.type === STAMP && f.text === ";") {
175
- fc++;
176
- if (fc > 1) break loop;
177
- }
178
- f = f.next;
164
+ function enumref(refitem, scoped) {
165
+ for (var rk in refitem) {
166
+ var os = refitem[rk];
167
+ if (os.wcount !== 1 || os.length < 2) continue;
168
+ var eq = null, em = null, tp = null;
169
+ loop: for (var o of os) {
170
+ if (o.equal && !o[ignore]) {
171
+ if (o.equal.text !== '=') break;
172
+ if (o.queue.kind) break;
173
+ var q = o.queue;
174
+ if (q !== scoped.body) {
175
+ if (q.entry === '(' && q.queue === scoped.body) {
176
+ var qp = q.prev;
177
+ if (qp.type === EXPRESS) qp = qp.prev;
178
+ if (qp && qp.type === STRAP && qp.text === "await") qp = qp.prev;
179
+ if (qp && qp.type === STRAP && qp.text === 'for') {
180
+ var f = q.first;
181
+ var fc = 0;
182
+ while (f && f !== o) {
183
+ if (f.type === STAMP && f.text === ";") {
184
+ fc++;
185
+ if (fc > 1) break loop;
179
186
  }
187
+ f = f.next;
180
188
  }
181
189
  }
182
- else break;
183
190
  }
184
- if (inCondition(o)) break;
191
+ else break;
192
+ }
193
+ if (inCondition(o)) break;
194
+ if (enumtype & REFTYPE) {
185
195
  if (o.typeref) {
186
196
  tp = o.typeref;
187
197
  if (isObject(tp)) tp = tp.typeref;
188
198
  continue;
189
199
  }
200
+ }
201
+ if (enumtype & REFSTRC) {
190
202
  if (o.enumref) {
191
203
  em = o.enumref;
192
204
  continue;
193
205
  }
206
+ }
207
+ if (enumtype & REFMOVE) {
194
208
  o = o.equal.next;
195
209
  var n = skipAssignment(o);
196
210
  if (!o || n !== o.next) break loop;
197
211
  if (o.type === VALUE && o.isdigit) eq = o;
198
212
  }
199
- else {
213
+ }
214
+ else if (o.kind) {
215
+ if (enumtype & REFTYPE) {
216
+ if (o.typeref) {
217
+ tp = o.typeref;
218
+ if (isObject(tp)) tp = tp.typeref;
219
+ continue;
220
+ }
221
+ }
222
+ }
223
+ else {
224
+ if (enumtype & REFTYPE) {
200
225
  if (tp) {
201
226
  o.typeref = tp;
202
227
  continue;
203
228
  }
229
+ }
230
+ if (enumtype & REFSTRC) {
204
231
  if (em) {
205
232
  o.enumref = em;
206
233
  continue;
207
234
  }
235
+ }
236
+ if (enumtype & REFMOVE) {
208
237
  if (!eq) break;
209
238
  if (o.short) continue;
210
239
  o.type = eq.type;
@@ -216,13 +245,17 @@ function enumref(scoped) {
216
245
  }
217
246
  }
218
247
  }
219
-
220
248
  function atuoenum(scoped) {
221
- createRefMap(scoped);
222
- enumref(scoped);
249
+ var { used } = scoped;
250
+ for (var k in used) {
251
+ var rs = maplist(used[k]);
252
+ enumref(rs, scoped);
253
+ }
223
254
  }
224
- var exports = module.exports = function main(code) {
255
+ var enumtype = 0;
256
+ var exports = module.exports = function main(code, type = REFMOVE) {
225
257
  var rest = [code.scoped];
258
+ enumtype = type;
226
259
  while (rest.length) {
227
260
  var s = rest.pop();
228
261
  if (s.length) rest.push(...s);
@@ -230,6 +263,9 @@ var exports = module.exports = function main(code) {
230
263
  }
231
264
  return code;
232
265
  }
266
+ var REFMOVE = exports.REFMOVE = 1;
267
+ var REFSTRC = exports.REFSTRC = 2;
268
+ var REFTYPE = exports.REFTYPE = 4;
233
269
  exports.createRefId = createRefId;
234
270
  exports.createRefMap = createRefMap;
235
271
  exports.enumscoped = atuoenum;
@@ -31,4 +31,5 @@ t("var a=-1; console.log(--a)", "var a = -1; console.log(--a)");
31
31
  t("var a=-1; return ++a", "var a = -1; return ++a");
32
32
  t("var a=-1; typeof ++a", "var a = -1; typeof ++a");
33
33
  t("var a=-1; ++a", "var a = -1; ++a");
34
+ t("b?a=1:b=2;console.log(a)", "b ? a = 1 : b = 2; console.log(a)");
34
35
  // t(fs.readFileSync(path.join(__dirname,"../zimoli/spacechar_test.js")).toString())
@@ -259,9 +259,15 @@ function snapSentenceHead(o) {
259
259
  break;
260
260
  }
261
261
  if (p.type === STAMP) {
262
- if (/=>|[,;]/.test(p.text) || equal_reg.test(p.text)) {
262
+ if (/=>|[,;]/.test(p.text)) {
263
263
  break;
264
264
  }
265
+ if (/^[\?\:]$/.test(p.text)) {
266
+ if (o) {
267
+ var e = snapExpressFoot(o).next;
268
+ if (e.type === STAMP && equal_reg.test(e.text)) break;
269
+ }
270
+ }
265
271
  if (/^(?:[!~]|\+\+|\-\-)$/.test(p.text)) {
266
272
  o = p;
267
273
  continue;
@@ -496,6 +502,7 @@ var createScoped = function (parsed, wash) {
496
502
  case "var":
497
503
  m = m || vars;
498
504
  var [declared, used0, o0, skiped] = getDeclared(o.next, s);
505
+ mergeTo(used, used0);
499
506
  while (skiped.length) {
500
507
  var o1 = run(skiped[0], 0);
501
508
  let sindex = skiped.indexOf(o1);
@@ -503,7 +510,6 @@ var createScoped = function (parsed, wash) {
503
510
  skiped.splice(0, sindex + 1);
504
511
  }
505
512
  o = o0;
506
- mergeTo(used, used0);
507
513
  mapDeclared(m, declared);
508
514
  continue loop;
509
515
  case "static":
@@ -1222,16 +1228,16 @@ var splice = function (queue, index, size, ...args) {
1222
1228
  var res = queue.splice(index, size, ...args);
1223
1229
  var previ = queue.lastIndexOf(prev, index);
1224
1230
  var nexti = queue.indexOf(next, index + args.length);
1225
- if (previ < 0) previ = 0;
1226
- if (nexti < 0) nexti = queue.length;
1231
+ if (previ < 0) previ = 0, prev = null;
1232
+ if (nexti < 0) nexti = queue.length, next = null;
1227
1233
  else nexti++;
1228
1234
  var changedargs = queue.slice(previ, nexti);
1229
1235
  var pp = prev && prev.prev;
1230
1236
  var nn = next && next.next;
1231
1237
  relink(changedargs);
1232
- if (prev) prev.prev = pp;
1238
+ if (pp) changedargs.first.prev = pp, pp.next = changedargs.first;
1233
1239
  else queue.first = changedargs.first;
1234
- if (next) next.next = nn;
1240
+ if (nn) changedargs.last.next = nn, nn.prev = changedargs.last;
1235
1241
  else queue.last = changedargs.last;
1236
1242
  setqueue(args, queue);
1237
1243
  return res;
@@ -1276,6 +1282,27 @@ var canbeTemp = function (body, strip = false) {
1276
1282
  return o.type === EXPRESS && (strip || !/[\.\[]/.test(o.text)) || o.type === VALUE || o.type === QUOTED && !o.length;
1277
1283
  };
1278
1284
 
1285
+ var pickSentence = function (o) {
1286
+ if (!o) return [];
1287
+ if (o && o.type & (SPACE | COMMENT) && o.prev) o = o.prev;
1288
+ if (o && o.type === STAMP && o.prev) o = o.prev;
1289
+ if (o.type === STRAP && /^(in|instanceof|as|of)$/.test(o.text) && o.prev) o = o.prev;
1290
+ var h = snapSentenceHead(o);
1291
+ var e = skipAssignment(o);
1292
+ var q = o.queue;
1293
+ if (q) {
1294
+ var qh = q.indexOf(h);
1295
+ var qe = e ? q.indexOf(e) : q.length;
1296
+ if (qh >= 0 && qe >= 0) return q.slice(qh, qe);
1297
+ }
1298
+ var res = [];
1299
+ do {
1300
+ res.push(h);
1301
+ h = h.next;
1302
+ } while (h !== e);
1303
+ return res;
1304
+ };
1305
+
1279
1306
  module.exports = {
1280
1307
  /* 1 */COMMENT,
1281
1308
  /* 2 */SPACE,
@@ -1297,6 +1324,7 @@ module.exports = {
1297
1324
  createScoped,
1298
1325
  createExpressList,
1299
1326
  snapSentenceHead,
1327
+ pickSentence,
1300
1328
  snapExpressHead,
1301
1329
  snapExpressFoot,
1302
1330
  skipSentenceQueue,
@@ -201,7 +201,7 @@ function scan(text, type = "js", lastIndex = 0) {
201
201
  program = type;
202
202
  }
203
203
  else {
204
- console.log("类型不支持", type)
204
+ console.log(i18n`类型不支持`, type)
205
205
  }
206
206
  break;
207
207
  }
@@ -335,6 +335,7 @@ var _while = function (body, cx, unblock, result) {
335
335
  pushstep(result, wend);
336
336
  we[0].text = String(1 + i - result.length);
337
337
  be.push(...scanner2(`${result.length - i}, 0`));
338
+ relink(be);
338
339
  return cx;
339
340
  };
340
341
  var pushstep = function (result, step) {
@@ -607,7 +608,7 @@ var _invoke = function (t, getname) {
607
608
  else if (t.length) {
608
609
  var t0 = t[0];
609
610
  if (t0.type === EXPRESS && /^[\.\[]/.test(t0.text) || t0.type & (STAMP | STRAP) && powermap[t0.text] < powermap.new) {
610
- t.unshift(...scanner2(`${qname}=${qname}`));
611
+ t.unshift(...rescan(`${qname}=${qname}`));
611
612
  relink(t);
612
613
  }
613
614
  pushstep(result, t);
@@ -1073,6 +1074,7 @@ var getblock = function (body, cx) {
1073
1074
  while (o) {
1074
1075
  cx = skipAssignment(body, cx);
1075
1076
  var o = body[cx];
1077
+ if (o && o.prev && o.prev.type === LABEL) continue;
1076
1078
  if (!o || o.type !== STAMP || o.text !== ',') break;
1077
1079
  cx++;
1078
1080
  }
@@ -131,4 +131,7 @@ test("predef[key[1]](r.slice(key[0].length).trim())", '_ = key[1]; _0 = key[0].l
131
131
  test("predef[key[1]](r.slice())(r.slice())", '_ = key[1]; _0 = r.slice(); _ = predef[_](_0); _0 = r.slice(); _(_0)');
132
132
  test("predef[key[1]][key[2]][key[3]]", '_ = key[1]; _ = predef[_]; _0 = key[2]; _ = _[_0]; _0 = key[3]; _[_0]');
133
133
  test("[key[1]][key[2]][key[3]]", '_ = key[1]; _ = [_]; _0 = key[2]; _ = _[_0]; _0 = key[3]; _[_0]');
134
- test("[key[1]][key[2]]+[key[3]][key[4]]", '_ = key[1]; _ = [_]; _0 = key[2]; _ = _[_0]; _0 = key[3]; _0 = [_0]; _1 = key[4]; _ + _0[_1]');
134
+ test("[key[1]][key[2]]+[key[3]][key[4]]", '_ = key[1]; _ = [_]; _0 = key[2]; _ = _[_0]; _0 = key[3]; _0 = [_0]; _1 = key[4]; _ + _0[_1]');
135
+ test("if(a)a:{break a}", "if (!a) return [2, 0]; return [1, 0];\r\n return [1, 0]", true);
136
+ unstruct.debug = true;
137
+ test("rgb=(rgb<<8|rgb>>16)&0xffffff", "_ = rgb << 8, _0 = rgb >> 16, _ = _ | _0; _ = (_); rgb = _ & 0xffffff", true);