efront 4.0.56 → 4.0.57
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 +9 -8
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/compile/common.js
CHANGED
|
@@ -1001,6 +1001,7 @@ var setqueue = function (list, queue = list) {
|
|
|
1001
1001
|
var createString = function (parsed) {
|
|
1002
1002
|
var autospace = parsed.autospace !== false;
|
|
1003
1003
|
var keepspace = parsed.keepspace !== false;
|
|
1004
|
+
var patchspace = autospace && keepspace;
|
|
1004
1005
|
var helpcode = parsed.helpcode;
|
|
1005
1006
|
var lasttype = SPACE;
|
|
1006
1007
|
var uncomment = parsed.comment === false;
|
|
@@ -1008,7 +1009,7 @@ var createString = function (parsed) {
|
|
|
1008
1009
|
var helpcolor = parsed.keepcolor === false;
|
|
1009
1010
|
var run = (o, i, a) => {
|
|
1010
1011
|
var prev = o.prev;
|
|
1011
|
-
if (!((SPACE | COMMENT | STAMP | PIECE | SCOPED) & o.type) && prev && lasttype !== SPACE &&
|
|
1012
|
+
if (!((SPACE | COMMENT | STAMP | PIECE | SCOPED) & o.type) && prev && lasttype !== SPACE && patchspace) {
|
|
1012
1013
|
if ((QUOTED | SCOPED | STRAP | LABEL | COMMENT) & lasttype
|
|
1013
1014
|
|| prev.type === STAMP && !prev.unary
|
|
1014
1015
|
) {
|
|
@@ -1049,7 +1050,7 @@ var createString = function (parsed) {
|
|
|
1049
1050
|
}
|
|
1050
1051
|
}
|
|
1051
1052
|
if (keepspace && !opentmp) {
|
|
1052
|
-
if (
|
|
1053
|
+
if (patchspace && lasttype !== SPACE && lasttype !== EXPRESS) result.push(" ");
|
|
1053
1054
|
result.push(tmp);
|
|
1054
1055
|
}
|
|
1055
1056
|
break;
|
|
@@ -1069,21 +1070,21 @@ var createString = function (parsed) {
|
|
|
1069
1070
|
break;
|
|
1070
1071
|
}
|
|
1071
1072
|
case SCOPED:
|
|
1072
|
-
if (
|
|
1073
|
+
if (patchspace && o.type !== QUOTED && (lasttype & (STRAP | COMMENT | STAMP)
|
|
1073
1074
|
&& (!o.prev || !/[\+\-\~\!]$/.test(o.prev.text) || /[\+\-]$/.test(o.prev.text) && (!o.prev.prev || !((STAMP | STRAP) & o.prev.prev.type)))
|
|
1074
1075
|
|| lasttype === SCOPED && o.entry === "{"
|
|
1075
1076
|
)) result.push(" ");
|
|
1076
1077
|
result.push(o.entry);
|
|
1077
1078
|
if (o.length > 0) {
|
|
1078
1079
|
if (o.entry === "{" && o[0].type !== SPACE) {
|
|
1079
|
-
if (
|
|
1080
|
+
if (patchspace && lasttype !== PIECE) {
|
|
1080
1081
|
result.push(" ");
|
|
1081
1082
|
}
|
|
1082
1083
|
}
|
|
1083
1084
|
lasttype = SPACE;
|
|
1084
1085
|
o.forEach(run);
|
|
1085
1086
|
if (o.prev && o.prev.type === STRAP && /^for$/.test(o.prev.text));
|
|
1086
|
-
else if (/^[,;]$/.test(result[result.length - 1]) && !keepspace) {
|
|
1087
|
+
else if (/^[,;]$/.test(result[result.length - 1]) && autospace && !keepspace) {
|
|
1087
1088
|
var last = o.last;
|
|
1088
1089
|
var lp = last && last.prev;
|
|
1089
1090
|
if (!lp) result.pop();
|
|
@@ -1094,7 +1095,7 @@ var createString = function (parsed) {
|
|
|
1094
1095
|
}
|
|
1095
1096
|
}
|
|
1096
1097
|
if (o.leave === "}" && o.entry === "{" && o[o.length - 1].type !== SPACE) {
|
|
1097
|
-
if (
|
|
1098
|
+
if (patchspace) result.push(" ");
|
|
1098
1099
|
}
|
|
1099
1100
|
}
|
|
1100
1101
|
result.push(o.leave);
|
|
@@ -1120,10 +1121,10 @@ var createString = function (parsed) {
|
|
|
1120
1121
|
}
|
|
1121
1122
|
|
|
1122
1123
|
else if (o.text === '*') {
|
|
1123
|
-
if (
|
|
1124
|
+
if (patchspace && lasttype !== SPACE && (lasttype !== STRAP || o.prev && o.prev.text !== 'function')) result.push(" ");
|
|
1124
1125
|
}
|
|
1125
1126
|
else if (!/^(\+\+|\-\-)$/.test(o.text) || o.prev && o.prev.type & (STAMP | STRAP)) {
|
|
1126
|
-
if (
|
|
1127
|
+
if (patchspace && lasttype !== SPACE) result.push(" ");
|
|
1127
1128
|
}
|
|
1128
1129
|
}
|
|
1129
1130
|
if (o.type === VALUE) {
|