efront 4.3.9 → 4.3.10
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/coms/compile/common.js
CHANGED
package/coms/compile/unstruct.js
CHANGED
|
@@ -969,7 +969,7 @@ var _express = function (body, getname, ret) {
|
|
|
969
969
|
if (/^([!~]|\+\-|\-\+)*$/.test(o.text)) p = powermap["!"];
|
|
970
970
|
if (!p && /^[\+\-]$/.test(o.text)) p = needpunc ? powermap["+"] : powermap["!"];
|
|
971
971
|
if (!p) p = powermap[o.text];
|
|
972
|
-
|
|
972
|
+
if (o.unary) needpunc = false;
|
|
973
973
|
var b = body.slice(bx, cx + 1);
|
|
974
974
|
bx = cx + 1;
|
|
975
975
|
b.index = nameindex;
|
|
@@ -137,7 +137,6 @@ test("rgb=(rgb<<8|rgb>>16)&0xffffff", "_ = rgb << 8, _0 = rgb >> 16, _ = _ | _0;
|
|
|
137
137
|
test(`if (c) a; else return true; return false`, "if (!c) return [1, 0]; a; return [2, 0];\r\n return [true, 2];\r\n return [false, 2]")
|
|
138
138
|
test(`switch(a){case a:a=a?1:0;break;case b:a=b;break;}`, "if (a === a) return [1, 0]; if (a === b) return [4, 0]; return [5, 0];\r\n if (!a) return [1, 0]; a = 1; return [2, 0];\r\n a = 0; return [1, 0];\r\n return [2, 0];\r\n a = b; return [1, 0]");
|
|
139
139
|
test(`a=typeof a!==1`, "_ = typeof a, a = _ !== 1");
|
|
140
|
-
unstruct.debug = true; r++;
|
|
141
140
|
test(`a[0]++`, "a[0]++");
|
|
142
141
|
test(`1+a[0]++`, "_ = a[0]++, 1 + _");
|
|
143
142
|
test(`a[0]++ + 1`, "_ = a[0]++, _ + 1");
|
|
@@ -145,3 +144,7 @@ test(`a[0]-- + 1`, "_ = a[0]--, _ + 1");
|
|
|
145
144
|
test(`a[0]-- +1`, "_ = a[0]--, _ + 1");
|
|
146
145
|
test(`a[0]--+1`, "_ = a[0]--, _ + 1");
|
|
147
146
|
test(`a[0]+++1`, "_ = a[0]++, _ + 1");
|
|
147
|
+
unstruct.debug = true; r++;
|
|
148
|
+
test(`c=b\r\n++a`, "c = b; ++a");
|
|
149
|
+
test(`c=b+\r\n++a`, "_ =\r\n++a, c = b + _");
|
|
150
|
+
test(`c=b+ ++a`, "_ = ++a, c = b + _");
|