efront 4.35.7 → 4.36.0

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.
@@ -81,17 +81,19 @@ math`S=sqrt(p*(p-a)*(p-b)*(p-c))`
81
81
  ```
82
82
  * 乘法
83
83
  ```mathscript
84
+ // 用`*`会自动转成`×`或`·`或省略
84
85
  1*2
85
86
  a*b
86
87
  2*a
88
+ a*2
87
89
  ```
88
90
  ```math
89
91
  1*2
90
92
  a*b
91
93
  2*a
94
+ a*2
92
95
  ```
93
96
  ```mathscript
94
- // 默认用`*`会自动转成`×`或`·`或省略
95
97
  // 如果自动生成的符号不符合预期
96
98
  // 可以使用`mul(a,b)`以强制生成`×`
97
99
  // `Mul(a,b)`生成`·`
@@ -104,9 +106,11 @@ mul(a,b),Mul(a,b),MUL(a,b)
104
106
  * 分数
105
107
  ```mathscript
106
108
  分子/分母
109
+ 1/(2/3),1/2/3;
107
110
  ```
108
111
  ```math
109
112
  分子/分母
113
+ 1/(2/3),1/2/3;
110
114
  ```
111
115
  * 以除号表示除法
112
116
  ```mathscript
@@ -117,10 +121,19 @@ mul(a,b),Mul(a,b),MUL(a,b)
117
121
  ```
118
122
  * 绝对值
119
123
  ```mathscript
120
- abs(a)
124
+ |a|;
125
+ |1+|a||*2;
121
126
  ```
122
127
  ```math
123
- abs(a)
128
+ |a|;
129
+ |1+|a||*2;
130
+ ```
131
+ * 行列式
132
+ ```mathscript
133
+ |1,2,3,4;5,6,7,8|;
134
+ ```
135
+ ```math
136
+ |1,2,3,4;5,6,7,8|;
124
137
  ```
125
138
  * 阶乘: n!
126
139
  ```mathscript
@@ -131,10 +144,12 @@ mul(a,b),Mul(a,b),MUL(a,b)
131
144
  ```
132
145
  * 幂
133
146
  ```mathscript
134
- 底数 ** 指数
147
+ 底数 ** 指数;
148
+ a**2**x=a**(2*x);
135
149
  ```
136
150
  ```math
137
- 底数 ** 指数
151
+ 底数 ** 指数;
152
+ a**2**x=a**(2*x);
138
153
  ```
139
154
  * 平方根
140
155
  ```mathscript
@@ -162,16 +177,28 @@ mul(a,b),Mul(a,b),MUL(a,b)
162
177
 
163
178
  * 三角函数
164
179
  ```mathscript
165
- sin(theta);
166
- sin(theta,2);
167
- sin(theta**2);
168
- sin(theta)**2;
180
+ // 指令形式,函数形式
181
+ sin theta, sin(theta);
182
+ // 不同位置的指数
183
+ sin(theta**2),sin(theta)**2, (sin theta)**2,"sin"(theta)**2;
184
+ // 和角公式
185
+ sin(alpha+beta)=sin(alpha)*cos(beta)+cos(alpha)*sin(beta);
186
+ // 倍角公式
187
+ sin(2*alpha)=2*sin(alpha)*cos(alpha);
188
+ // 反三角函数
189
+ arctan x+arctan y = arctan ((x+y)/(1-x*y))
169
190
  ```
170
191
  ```math
171
- sin(theta);
172
- sin(theta,2);
173
- sin(theta**2);
174
- sin(theta)**2;
192
+ // 指令形式,函数形式
193
+ sin theta, sin(theta);
194
+ // 不同位置的指数
195
+ sin(theta**2),sin(theta)**2, (sin theta)**2,"sin"(theta)**2;
196
+ // 和角公式
197
+ sin(alpha+beta)=sin(alpha)*cos(beta)+cos(alpha)*sin(beta);
198
+ // 倍角公式
199
+ sin(2*alpha)=2*sin(alpha)*cos(alpha);
200
+ // 反三角函数
201
+ arctan x+arctan y = arctan ((x+y)/(1-x*y))
175
202
  ```
176
203
 
177
204
  * 向量
@@ -211,19 +238,29 @@ sin(theta)**2;
211
238
 
212
239
  * 积分
213
240
  ```mathscript
214
- integral(表达式,下界,上界)
241
+ integral(表达式,下界,上界) // 内联样式
242
+ Integral(表达式,下界,上界) // 块级样式
215
243
  ```
216
244
  ```math
217
245
  integral(表达式,下界,上界)
246
+ Integral(表达式,下界,上界)
218
247
  ```
219
248
  * 级数
220
249
  ```mathscript
250
+ // 内联样式
221
251
  sigma(公式主体,n=1,+Infinity)
222
252
  series(公式主体,n=1,+Infinity)
253
+ // 块级样式
254
+ Sigma(公式主体,n=1,+Infinity)
255
+ Series(公式主体,n=1,+Infinity)
223
256
  ```
224
257
  ```math
258
+ // 内联样式
225
259
  sigma(公式主体,n=1,+Infinity)
226
260
  series(公式主体,n=1,+Infinity)
261
+ // 块级样式
262
+ Sigma(公式主体,n=1,+Infinity)
263
+ Series(公式主体,n=1,+Infinity)
227
264
  ```
228
265
  * 矩阵
229
266
  ```mathscript
@@ -241,10 +278,12 @@ series(公式主体,n=1,+Infinity)
241
278
  ```
242
279
  * 转置
243
280
  ```mathscript
244
- [1,2;3,4]'
281
+ [1,2;3,4]';
282
+ A'*B';
245
283
  ```
246
284
  ```math
247
- [1,2;3,4]'
285
+ [1,2;3,4]';
286
+ A'*B';
248
287
  ```
249
288
  * 离子
250
289
  ```mathscript
@@ -292,39 +331,50 @@ series(公式主体,n=1,+Infinity)
292
331
  1.3.e3;
293
332
  a*1.3e3
294
333
  ```
334
+ * 虚数
335
+ ```mathscript
336
+ 1+2i;
337
+ 1+2.3i;
338
+ 2+3e10k;
339
+ 3e10j;
340
+ ```
341
+ ```math
342
+ 1+2i;
343
+ 1+2.3i;
344
+ 2+3e10k;
345
+ 3e10j;
346
+ ```
295
347
  * 方程组
296
348
  ```mathscript
297
- group(
349
+ {
298
350
  a+1=b;
299
- a+b=3;
300
- )
351
+ a+b**2=3;
352
+ }
301
353
  ```
302
354
  ```math
303
- group(
304
- a+1=b,
305
- a+b**2=3
306
- )
355
+ {
356
+ a+1=b;
357
+ a+b**2=3;
358
+ }
307
359
  ```
308
360
  * 标号
309
361
  ```mathscript
310
362
  tab(1); // 带小括号的数字
311
- tab(circle,1,2,3,10); // 带圆圈的数字
312
- tab(roman,1); //罗马数字
313
- tab(roman,3888); //罗马数字
314
- group(// 方程组中使用
315
- x+y=10 tab(circle,1),
316
- x*y=25 tab(circle,2)
317
- )
318
- ```
319
- ```math
320
- tab(1);
321
- tab(circle,1,2,3,10);
322
- tab(roman,1);
323
- tab(roman,3888);
324
- group(
325
- x+y=10 tab(circle,1),
326
- x*y=25 tab(circle,2)
327
- )
363
+ @1,@2,@3,@4,@20,@50; // 带圆圈的数字
364
+ $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$3888; //罗马数字
365
+ {// 方程组中使用
366
+ x+y=10, @1;
367
+ x*y=25, @2;
368
+ }
369
+ ```
370
+ ```math
371
+ tab(1); // 带小括号的数字
372
+ @1,@2,@3,@4,@20,@50; // 带圆圈的数字
373
+ $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$3888; //罗马数字
374
+ {// 方程组中使用
375
+ x+y=10, @1;
376
+ x*y=25, @2;
377
+ }
328
378
  ```
329
379
  * 角
330
380
  ```mathscript
@@ -349,6 +399,34 @@ series(公式主体,n=1,+Infinity)
349
399
  ln(x);
350
400
  ```
351
401
 
402
+ * 共轭
403
+ ```mathscript
404
+ conj(A);// 上划线
405
+ conj(1+2i);// 上划线
406
+ conj(1+2i)*2;
407
+ ```
408
+ ```math
409
+ conj(A);// 上划线
410
+ conj(1+2i);// 上划线
411
+ conj(1+2i)*2;
412
+ ```
413
+ * 共轭转置
414
+ ```mathscript
415
+ A[*];
416
+ [1+2i, 3+4i;5+6j,7+8k][*];
417
+ ```
418
+ ```math
419
+ A[*];
420
+ [1+2i, 3+4i;5+6j,7+8k][*];
421
+ ```
422
+ * 带整数部分的分数,1右1/2
423
+ ```mathscript
424
+ 1 .(1/2) * 2.(3/5) + 5.(7/8)
425
+ ```
426
+ ```math
427
+ 1 .(1/2) * 2.(3/5) + 5.(7/8)
428
+ ```
429
+
352
430
  ## 希腊字母对照表如下
353
431
  按此表中的英文单词命名的变量将自动转换为希腊字母
354
432
  ```javascript
@@ -34,6 +34,16 @@
34
34
  }
35
35
  </div>
36
36
  </p>
37
+ <p>
38
+ <h2>
39
+ 求根公式
40
+ </h2>
41
+ <div>
42
+ ${
43
+ math`x=(-b+-sqrt(b**2-4*a*c))/(2*a)`
44
+ }
45
+ </div>
46
+ </p>
37
47
  <p>
38
48
  ${
39
49
  math`cos(theta,2)*E+(1 - cos(theta))*K'*K+sin(theta)*[0,-K_2,K_1;K_2,0,-K_0;-K_1,K_0,0]`
@@ -272,28 +272,26 @@ var getComment = function (piece) {
272
272
  return '';
273
273
  };
274
274
  function spreadkey(name) {
275
- if (/^\([\s\S]*\)$/.test(name) && /,/.test(name)) {
276
- var [, name, rest_piece] = /^([\s\S]*?),([^\]]*)$/.exec(name.slice(1, name.length - 1));
275
+ var repeat = /^\[/.test(name) ? true : void 0;
276
+ if (/^\([\s\S]*\)$|^\[[\s\S]*\]$/.test(name)) {
277
+ name = name.slice(1, name.length - 1);
278
+ if (/,/.test(name)) var [, name, rest_piece] = /^([\s\S]*?),([^\]]*)$/.exec(name);
277
279
  }
278
- if (/^\[[\s\S]*\]$/.test(name)) {
279
- repeat = true;
280
- name = name.replace(/^\[|\]$/g, '');
281
- if (/\,/.test(name)) {
282
- var commaindex = name.indexOf(",");
283
- var endwith = parseKV(name.slice(commaindex + 1));
280
+ if (repeat) {
281
+ if (rest_piece) {
282
+ var endwith = parseKV(rest_piece);
284
283
  endwith = parseValue(endwith);
285
- name = name.slice(0, commaindex);
286
284
  }
287
285
  }
288
286
  var [name, key, holder] = scanSlant(name, '/', 0, name.length + 1);
289
- if (rest_piece) {
287
+ if (!repeat && rest_piece) {
290
288
  if (rest_piece && !/=/.test(rest_piece)) {
291
289
  var needs = { [key || name]: parseValue(rest_piece) };
292
290
  } else {
293
291
  var needs = scanNeeds(rest_piece);
294
292
  }
295
293
  }
296
- return [name, key, needs, holder];
294
+ return [name, key, needs, holder, repeat, endwith];
297
295
  }
298
296
  function parseOptions(size, options) {
299
297
  if (typeof options === "string" && !/^[\$&]+\d+$/.test(options)) {
@@ -394,7 +392,7 @@ function parse(piece) {
394
392
  last_type = type;
395
393
  }
396
394
  }
397
- [name, key, needs, holder] = spreadkey(name);
395
+ [name, key, needs, holder, repeat, endwith] = spreadkey(name);
398
396
  if (key === undefined && !/^(title|label|headline)$/i.test(type)) key = name;
399
397
  }
400
398
  var value = /\/?\=([^\/\\]+)/.exec(type);
@@ -405,10 +403,10 @@ function parse(piece) {
405
403
  if (d & 0b111 === 0) type = (d >>> 3) + 'byte/' + t;
406
404
  else type = d + 'bit/' + t;
407
405
  }
408
- var sizematch = /^(\-?\d+|\-?\d*\.\d+)?([YZEPTGMK]i?b?|bytes?|bits?|words?|dword|real[48]|long|B|[^\/]*)([\/]|$|\s|\=)/i.exec(type);
406
+ var sizematch = !/^\:/.test(type) && /^(\-?\d+|\-?\d*\.\d+)?([YZEPTGMK]i?b?|bytes?|bits?|words?|dword|real[48]|long|B|[^\/]*)([\/]|$|\s|\=)/i.exec(type);
409
407
  if (!sizematch[1] && /^\$\d/.test(sizematch[2])) sizematch = null;
410
408
  if (sizematch) {
411
- var [size_text, size = 1, unit, eq] = sizematch;
409
+ var [size_text, size, unit, eq] = sizematch;
412
410
  if (unit && /^i?b?$/i.test(unit.slice(1))) {
413
411
  let ratio = KMGT.indexOf(unit.toUpperCase().charAt(0));
414
412
  size *= Math.pow(1024, ratio + 1);
@@ -470,7 +468,7 @@ function parse(piece) {
470
468
  var size = /^\:[^\/\:\-\,\/]+/.exec(type)[0];
471
469
  type = type.slice(size.length + 1);
472
470
  if (!type) {
473
- type = size.slice(1);
471
+ type = "bytes";
474
472
  }
475
473
  } else if (/^[\/]/.test(type)) {
476
474
  type = type.slice(1);
@@ -485,9 +483,9 @@ function parse(piece) {
485
483
  key = is(key);
486
484
  }
487
485
  else if (typeof name === 'string') {
488
- [name, key = name, needs, holder] = spreadkey(name);
486
+ [name, key = name, needs, holder, repeat, endwith] = spreadkey(name);
489
487
  }
490
- if (typeof size === 'string') size = parseFloat(size);
488
+ if (typeof size === 'string' && !/^\:/.test(size)) size = parseFloat(size);
491
489
  if (unit === type) unit = '';
492
490
  var field = {
493
491
  name, type, key, value, comment, options,
@@ -504,7 +502,11 @@ function parse(piece) {
504
502
  };
505
503
  var parent = piecepath[piecepath.length - 1];
506
504
  if (parent) {
507
- field.parent = parent;
505
+ Object.defineProperty(field, 'parent', {
506
+ value: parent,
507
+ configurable: true,
508
+ enumerable: false
509
+ });
508
510
  if (parent.options) {
509
511
  parent.options.push(field);
510
512
  } else {
@@ -106,7 +106,6 @@ var getUnaryRest = function (buff, index, flag) {
106
106
  var binc = index * 8;
107
107
  var savedb = binc;
108
108
  do {
109
-
110
109
  var i = binc / 8 | 0;
111
110
  var b = binc - i * 8;
112
111
  if (i >= buff.length) break;
@@ -127,7 +126,7 @@ var readFromIndex = function (data, index, offset) {
127
126
  byteOffset++;
128
127
  bitOffset = 8 - bitOffset;
129
128
  }
130
- var bytes = data.slice(byteIndex, byteOffset);
129
+ var bytes = data.subarray(byteIndex, byteOffset);
131
130
  if (bitOffset > 0 || bitIndex > 0) bytes = bytes.map(copy);
132
131
  if (bitOffset > 0) {
133
132
  bytes[bytes.length - 1] = bytes[bytes.length - 1] >> bitOffset << bitOffset;
@@ -139,7 +138,7 @@ var readFromIndex = function (data, index, offset) {
139
138
  bytes[bytes.length - 1] = bytes[bytes.length - 1] << bitIndex;
140
139
  }
141
140
  if (bitIndex + bitOffset >= 8) {
142
- bytes = bytes.slice(0, bytes.length - 1);
141
+ bytes = bytes.subarray(0, bytes.length - 1);
143
142
  }
144
143
  return bytes;
145
144
  };
@@ -232,13 +231,13 @@ function refilm_parse(data, start = 0) {
232
231
  bytes = readFromIndex(data, index, offset);
233
232
  value = bufferToUTF8String(bytes, 0);
234
233
  }
235
- else if (/^(small|little|small-end|litte-end|end)$/i.test(field.type)) {
234
+ else if (/^(small|little|small-end|litte-end|end|le)\d*$/i.test(field.type)) {
236
235
  value = numberFromSmallEnd(value);
237
236
  }
238
237
  else if (/^(string|str)$/i.test(field.type)) {
239
238
  value = bufferToUTF8String(value);
240
239
  }
241
- else if (/^num$|^number$|^int$|^integer$|^float$|^uint$/i.test(field.type)) {
240
+ else if (/^(num|number|int|integer|float|uint|double|real)\d*$/i.test(field.type)) {
242
241
  value = numberFromBuffer(value, 0, field.size * field.ratio * 8);
243
242
  }
244
243
  else if (/^bool$|^boolean$/i.test(field.type)) {
@@ -248,7 +247,7 @@ function refilm_parse(data, start = 0) {
248
247
  value = 1 + numberFromBuffer(value, 0, field.size * field.ratio * 8);
249
248
  }
250
249
  else {
251
- value = bytes.map(copy);
250
+ value = bytes;
252
251
  }
253
252
  index = offset;
254
253
  }
@@ -268,7 +267,7 @@ function refilm_parse(data, start = 0) {
268
267
  };
269
268
  var readone = function (field) {
270
269
  var inc = 0;
271
- var value = read(field, inc);
270
+ var value = read(field, field.repeat && inc);
272
271
  if (field.repeat) {
273
272
  var result = [value];
274
273
  var { size } = field;
@@ -10,8 +10,17 @@ var escapeMap = {
10
10
  };
11
11
  var unescapeFun = a => escapeMap[a];
12
12
  var unescapeUnc = function (a) {
13
- if (escapeMap.hasOwnProperty(a)) return escapeMap[a];
14
- var code = a.charCodeAt(0).toString(16);
13
+ if (a.length !== 1) a: {
14
+ var a1 = a[1];
15
+ if (escapeMap.hasOwnProperty(a1)) {
16
+ return escapeMap[a1];
17
+ }
18
+ var code = a1.charCodeAt(0);
19
+ if (code <= 0x001f || code >= 0x80) break a;
20
+ return a;
21
+ }
22
+ else if (escapeMap.hasOwnProperty(a)) return escapeMap[a];
23
+ else var code = a.charCodeAt(0).toString(16);
15
24
  switch (code.length) {
16
25
  case 1:
17
26
  return "\\u000" + code;
@@ -27,9 +36,13 @@ var unescapeMap = {
27
36
  };
28
37
  for (var k in escapeMap) unescapeMap[escapeMap[k]] = k;
29
38
  var unescapeReg = new RegExp(`[${Object.keys(escapeMap).map(a => escapeMap[a]).join('')}]`, 'g');
39
+ function escape(str) {
40
+ str = str.replace(/\\[\s\S]|[\r\n\t\v\f\u0008\u0000-\u001f\u007f-\uffff]/g, unescapeUnc);
41
+ return str;
42
+ }
30
43
  function encode(str, q = "\"", escapeUnicode = true) {
31
44
  str = str.replace(new RegExp(`[\\\\${q}]`, 'g'), "\\$&");
32
- if (escapeUnicode) str = str.replace(/[\r\n\t\v\f\u0008\u0000-\u001f\u007f-\uffff]/g, unescapeUnc);
45
+ if (escapeUnicode) str = escape(str);
33
46
  else str = str.replace(unescapeReg, unescapeFun);
34
47
  return q + str + q;
35
48
  }
@@ -73,10 +86,34 @@ function decode(s, singleSlash) {
73
86
  if (!r) return s;
74
87
  return kicode(r[2], singleSlash ? r[1] : null);
75
88
  }
76
-
89
+ var forbiddens = {
90
+ "极兔与狗": "jtexpress.cn",
91
+ "狗府与狗共": "gov.cn",
92
+ "淘宝与狗": "taobao.com",
93
+ "支付宝与狗": "alipay.com",
94
+ "华为与狗": "huawei.com",
95
+ "京东与狗": "jd.com",
96
+ "美团与狗": "meituan.com",
97
+ "美团公司与狗": "sankuai.com",
98
+ "腾讯与狗": "tencent.com",
99
+ "QQ团队与狗": "qq.com",
100
+ "微信团队与狗": "wechat.com",
101
+ };
102
+ var regs = recode.name === 'recode' ? [] : Object.keys(forbiddens).map(k => {
103
+ var r = forbiddens[k];
104
+ r = new RegExp("(?:^|\\:|\\/\\/|\\.)" + escapeRegExp(r) + "(\\/|$\\:)", 'i');
105
+ r.name = k;
106
+ return r;
107
+ });
77
108
  function recode(s, singleSlash) {
78
109
  s = decode(s, singleSlash);
79
- s = encode(s);
110
+ for (var r of regs) {
111
+ if (r.test(s)) {
112
+ s = r.name + "不得使用";
113
+ console.error(s);
114
+ }
115
+ }
116
+ s = encode(s, '"', false);
80
117
  return s;
81
118
  }
82
- export { encode, decode, recode, kicode, uncode };
119
+ export { encode, decode, recode, escape, kicode, uncode };
@@ -25,7 +25,7 @@ var scan_number = function (str, start) {
25
25
  return false;
26
26
  };
27
27
  var scan_null = function (str, start) {
28
- var reg = /null|false|true|\-?Infinity/g;
28
+ var reg = /null|false|true|\-?Infinity|NaN/g;
29
29
  reg.lastIndex = start;
30
30
  var match = reg.exec(str);
31
31
  if (match && match.index === start) {
@@ -45,6 +45,9 @@ var scan_null = function (str, start) {
45
45
  case "-":
46
46
  data = -Infinity;
47
47
  break;
48
+ case "N":
49
+ data = NaN;
50
+ break;
48
51
  }
49
52
  return reg.lastIndex;
50
53
  }
@@ -129,6 +132,7 @@ var _safeparse = function (str, start) {
129
132
  case "f":
130
133
  case "t":
131
134
  case "I":
135
+ case "N":
132
136
  start = scan_null(str, start);
133
137
  break;
134
138
  default:
@@ -135,7 +135,27 @@ var property = new Program;
135
135
  property.stamps = "=".split('');
136
136
  var progExp = new Javascript;
137
137
  var replaceISO8859 = function (data) {
138
- return String(data).replace(/<\!--([\s\S]*)--\>$/g, '$1').replace(/&\w+;/g, a => iso8859[a] || a).replace(/&#(\d+);/g, (_, a) => String.fromCodePoint(a))
138
+ return String(data)
139
+ .replace(/<\!--([\s\S]*)--\>$/g, '$1')
140
+ .replace(/&\w+;/g, a => iso8859[a] || a)
141
+ .replace(/&#([0-9a-f]+);/ig, (_, x, a) => {
142
+ if (x) switch (x) {
143
+ case "u":
144
+ a = parseInt(a, 16);
145
+ break;
146
+ case "x":
147
+ a = parseInt(a, 16);
148
+ break;
149
+ case "b":
150
+ a = parseInt(a, 2);
151
+ break;
152
+ case "o":
153
+ a = parseInt(a, 8);
154
+ break;
155
+ }
156
+ else a = +a;
157
+ return String.fromCodePoint(a);
158
+ });
139
159
  };
140
160
  var parseExpress = function (data, mayberepeat) {
141
161
  if (mayberepeat && /\s+(in|of)\s+/.test(data)) {
@@ -1031,7 +1031,9 @@ class Program {
1031
1031
  else if (type_reg.test(m)) {
1032
1032
  last.istype = true;
1033
1033
  }
1034
- if (this.transive_reg.test(m)) {
1034
+ var power = powermap[m];
1035
+ last.unary = power >= powermap.new;
1036
+ if (this.transive_reg.test(m) || power >= 0) {
1035
1037
  last.transive = queue.inExpress = true;
1036
1038
  }
1037
1039
  else {
@@ -1079,8 +1081,12 @@ class Program {
1079
1081
 
1080
1082
  if (scope_entry[m]) scope: {
1081
1083
  if (stamp_reg.test(m)) {
1084
+ if (cache_stamp) {
1085
+ if (cache_stamp.text + m in powermap) break scope;
1086
+ push_stamp();
1087
+ }
1082
1088
  var last = queue.last;
1083
- if (last) {
1089
+ if (last && last.type & ~(STAMP | STRAP) && !last.ion) {
1084
1090
  if (last.isExpress && !last.istype) break scope;
1085
1091
  }
1086
1092
  }
@@ -1099,7 +1105,7 @@ class Program {
1099
1105
  if (last.type !== STAMP || last.text !== "=>") {
1100
1106
  var classed = queue.classed;
1101
1107
  var clsd = classed.pop();
1102
- scope.isClass = true;
1108
+ scope.isClass = /^(class|interface)$/.test(clsd);
1103
1109
  if (!classed.length) queue.classed = null;
1104
1110
  scope.istype = clsd !== 'class';
1105
1111
  scope.extend += extends_reg.test(last.text);
@@ -296,7 +296,7 @@ function solve(body, ox, dx) {
296
296
  var p1 = p;
297
297
  var pt1 = pt;
298
298
  var p2 = p;
299
- while (p1 <= cache[cache.length - 1]) {
299
+ while (p <= cache[cache.length - 1]) {
300
300
  p2 = p1;
301
301
  p1 = cache.pop();
302
302
  pt1 = cache.pop();
@@ -306,7 +306,7 @@ function solve(body, ox, dx) {
306
306
  if (p === p1 && p > powermap[">>>"]) cache.push(bx, pt1, p1);
307
307
  continue;
308
308
  }
309
- var cx1 = make(body, bx, cx, p === p2 ? pt1 : null);
309
+ var cx1 = make(body, bx, cx, pt1);
310
310
  if (cx1 !== cx) {
311
311
  dx -= cx - cx1;
312
312
  cx = cx1;
@@ -316,6 +316,12 @@ function solve(body, ox, dx) {
316
316
  }
317
317
  if (p === 0) {
318
318
  cache.splice(0, cache.length);
319
+ continue;
320
+ }
321
+ if (p > p0) {
322
+ bx = cx + 1;
323
+ cache.push(bx, pt, p);
324
+ continue;
319
325
  }
320
326
  continue;
321
327
  }
@@ -65,7 +65,6 @@ t("a+ b*3**2", "a + b * 9");
65
65
  t("a+ 2*3**b", "a + 2 * 3 ** b");
66
66
  t("a+ 2*3 +c", "a + 6 + c");
67
67
  t("a+ 2*3 +4+c", "a + 10 + c");
68
- autoeval.debug = true;
69
68
  t("a- 2*3 +4+c", "a - 2 + c");
70
69
  t("a- 1 +4", "a + 3");
71
70
  t("a / 6 * 3", "a * 0.5");
@@ -84,14 +83,17 @@ tc("calc(10 / 20)", "0.5");
84
83
  tc("calc(10 / 20)", "0.5");
85
84
  tc("Math.log(f) / Math.LN2 / 10 | 0", "Math.log(f) * 0.14426950408889633 | 0");
86
85
  tc("Math.log(f) / Math.LN2 / 10 * 10 | 0", "Math.log(f) * 1.4426950408889634 | 0");
86
+ autoeval.debug = true;
87
87
  tc("Math.log(f) / Math.LN2 / 10 ** 2 | 0", "Math.log(f) * 0.014426950408889633 | 0");
88
+ autoeval.debug = false;
88
89
  // tf(path.join(__dirname, "../zimoli/spacechar_test.js"))
89
90
  t("1<<0", '1');
90
91
  t("1<<3", '8');
91
- t("(1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)",'1335')
92
- t("(1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)","7973")
93
- t("(1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)","21522")
94
- t('1n<<32n','4294967296n');
95
- t('4294967296n*4294967296n','18446744073709551616n');
96
- t('4294967296n*2147483648n','9223372036854775808n');
97
- t('0x20000000n*0x1000000n','9007199254740992n');
92
+ t("(1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)", '1335')
93
+ t("(1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)", "7973")
94
+ t("(1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)", "21522")
95
+ t('1n<<32n', '4294967296n');
96
+ t('4294967296n*4294967296n', '18446744073709551616n');
97
+ t('4294967296n*2147483648n', '9223372036854775808n');
98
+ t('0x20000000n*0x1000000n', '9007199254740992n');
99
+ t("1 + 1 / 2 + 1 / 3 + 1 / 4 + 1 / 5 + 1 / 6 + 1 / 7 + 1 / 8 + 1 / 9 + 1 / 10 + 1 / 11 + 1 / 12 + 1 / 13 + 1 / 14 + 1 / 15 + 1 / 16 + 1 / 17 + 1 / 18 + 1 / 19 + 1 / 20", "3.5977396571436824")