@xuda.io/xuda-worker-bundle-min 1.3.1511 → 1.3.1512
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/index.js +7 -34
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -8266,50 +8266,23 @@ func.expression.parse = function (input) {
|
|
|
8266
8266
|
const segments = [];
|
|
8267
8267
|
let pos = 0;
|
|
8268
8268
|
|
|
8269
|
-
const parts = input.split(/(
|
|
8269
|
+
const parts = input.split(/(@\w+)/).filter(Boolean);
|
|
8270
8270
|
|
|
8271
|
-
for (
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
if (part === '@' && i + 1 < parts.length) {
|
|
8275
|
-
const nextPart = parts[i + 1];
|
|
8276
|
-
const varEnd = nextPart.search(/[.\[]/); // Split at first . or [
|
|
8277
|
-
let fieldId, remainder;
|
|
8278
|
-
|
|
8279
|
-
if (varEnd > 0) {
|
|
8280
|
-
fieldId = nextPart.slice(0, varEnd);
|
|
8281
|
-
remainder = nextPart.slice(varEnd);
|
|
8282
|
-
} else {
|
|
8283
|
-
fieldId = nextPart;
|
|
8284
|
-
remainder = '';
|
|
8285
|
-
}
|
|
8286
|
-
|
|
8287
|
-
// Add @variable segment
|
|
8288
|
-
const fullVarValue = `@${fieldId}`;
|
|
8271
|
+
for (const part of parts) {
|
|
8272
|
+
if (part.startsWith('@')) {
|
|
8273
|
+
const fieldId = part.slice(1);
|
|
8289
8274
|
segments.push({
|
|
8290
|
-
value:
|
|
8275
|
+
value: part,
|
|
8291
8276
|
fieldId,
|
|
8292
8277
|
pos,
|
|
8293
8278
|
});
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
// Add remainder as a separate segment, if any
|
|
8297
|
-
if (remainder) {
|
|
8298
|
-
segments.push({
|
|
8299
|
-
value: remainder,
|
|
8300
|
-
pos,
|
|
8301
|
-
});
|
|
8302
|
-
pos += remainder.length;
|
|
8303
|
-
}
|
|
8304
|
-
|
|
8305
|
-
i++; // Skip the next part since we consumed it
|
|
8306
|
-
} else if (part !== '@') {
|
|
8279
|
+
} else {
|
|
8307
8280
|
segments.push({
|
|
8308
8281
|
value: part,
|
|
8309
8282
|
pos,
|
|
8310
8283
|
});
|
|
8311
|
-
pos += part.length;
|
|
8312
8284
|
}
|
|
8285
|
+
pos += part.length;
|
|
8313
8286
|
}
|
|
8314
8287
|
|
|
8315
8288
|
return segments;
|