@kontur.candy/generator 5.14.0-rsvfunctions.4 → 5.14.0-rsvfunctions.6
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/dist/index.js +6 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -81246,7 +81246,7 @@ class ReduceCallExpression extends CallExpression {
|
|
|
81246
81246
|
return this.reduceFunction.getType();
|
|
81247
81247
|
}
|
|
81248
81248
|
convertToString() {
|
|
81249
|
-
return `reduce(${toFLangString(this.modelPath)}/#iter, ${this.reduceFunction.convertToString()}, ${this.initialValue.convertToString()})`;
|
|
81249
|
+
return `reduce(${toFLangString(this.modelPath)}${this.modelPath.isEndsWithIteration() ? "" : "/#iter"}, ${this.reduceFunction.convertToString()}, ${this.initialValue.convertToString()})`;
|
|
81250
81250
|
}
|
|
81251
81251
|
}
|
|
81252
81252
|
class ReduceMultipleCallExpression extends CallExpression {
|
|
@@ -82612,16 +82612,15 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
82612
82612
|
const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
|
|
82613
82613
|
const firstPart = matchPaths.matchedPath.toCurrentIteration();
|
|
82614
82614
|
let finalIterPath;
|
|
82615
|
-
|
|
82616
|
-
|
|
82617
|
-
|
|
82618
|
-
finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(sourceKeyParts.slice(0, firstPartLength));
|
|
82619
|
-
} else {
|
|
82620
|
-
const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.count(firstPart.getPathParts());
|
|
82615
|
+
const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.count(firstPart.getPathParts());
|
|
82616
|
+
const secondParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength));
|
|
82617
|
+
if (secondParts.isContainIteration() || secondParts.isContainCurrentIteration()) {
|
|
82621
82618
|
const secondPartParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength)).getPathPartsAsArray();
|
|
82622
82619
|
const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
82623
82620
|
const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
|
|
82624
82621
|
finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
|
|
82622
|
+
} else {
|
|
82623
|
+
finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(sourceKeyParts.slice(0, firstPartLength - 1));
|
|
82625
82624
|
}
|
|
82626
82625
|
if (!finalIterPath) {
|
|
82627
82626
|
throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
|