@kontur.candy/generator 5.97.0-optimize-engine.0 → 5.97.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.
Files changed (2) hide show
  1. package/dist/index.js +50 -93
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -47768,7 +47768,6 @@ __webpack_require__.r(__webpack_exports__);
47768
47768
  /* harmony export */ ensureArrayHasLength: () => (/* binding */ ensureArrayHasLength),
47769
47769
  /* harmony export */ ensureArrayIsNotEmpty: () => (/* binding */ ensureArrayIsNotEmpty),
47770
47770
  /* harmony export */ ensureArrayLengthGreaterThenOrEqual: () => (/* binding */ ensureArrayLengthGreaterThenOrEqual),
47771
- /* harmony export */ ensureHasFunctionType: () => (/* binding */ ensureHasFunctionType),
47772
47771
  /* harmony export */ ensureIsArray: () => (/* binding */ ensureIsArray),
47773
47772
  /* harmony export */ ensureNever: () => (/* binding */ ensureNever),
47774
47773
  /* harmony export */ ensureNotNullOrUndefined: () => (/* binding */ ensureNotNullOrUndefined),
@@ -47796,14 +47795,9 @@ function stringifyUnknownError(error) {
47796
47795
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
47797
47796
  return typeof error === "object" && (error === null || error === void 0 ? void 0 : error["message"]);
47798
47797
  }
47799
- function ensureNotNullOrUndefined(input, message) {
47798
+ function ensureNotNullOrUndefined(input) {
47800
47799
  if (!isNotNullOrUndefined(input)) {
47801
- throw new Error(message !== null && message !== void 0 ? message : `Value must be defined`);
47802
- }
47803
- }
47804
- function ensureHasFunctionType(input, message) {
47805
- if (typeof input !== "function") {
47806
- throw new Error(message !== null && message !== void 0 ? message : `Value must be defined`);
47800
+ throw new Error(`Value must be defined`);
47807
47801
  }
47808
47802
  }
47809
47803
  function noop() {
@@ -51396,7 +51390,7 @@ class KCLangAntlrVisitor {
51396
51390
  return {
51397
51391
  type: "withBlock",
51398
51392
  name: ctx.NAME().text,
51399
- value: hasInterpolation ? value.replace(/```/g, "") : value.replace(/^'|^"|'$|"$/g, "")
51393
+ value: hasInterpolation ? this.removeEscapeSimbolsFromDescription(value.replace(/```/g, "")) : value.replace(/^'|^"|'$|"$/g, "")
51400
51394
  };
51401
51395
  }
51402
51396
  visitFormula(ctx) {
@@ -51664,6 +51658,14 @@ class KCLangAntlrVisitor {
51664
51658
  if (interpolationResult) {
51665
51659
  return interpolationResult.interpolationContent().accept(this);
51666
51660
  }
51661
+ const textNode = ctx.TEXT();
51662
+ if (textNode != undefined) {
51663
+ return {
51664
+ type: "interpolationDescriptionToken",
51665
+ tokenType: "text",
51666
+ text: this.removeEscapeSimbolsFromDescription(textNode.text)
51667
+ };
51668
+ }
51667
51669
 
51668
51670
  // текст вокруг
51669
51671
  return {
@@ -51853,6 +51855,10 @@ class KCLangAntlrVisitor {
51853
51855
  const interval = new antlr4ts_misc__WEBPACK_IMPORTED_MODULE_0__.Interval(context.start.startIndex, (_context$stop$stopInd = (_context$stop = context.stop) === null || _context$stop === void 0 ? void 0 : _context$stop.stopIndex) !== null && _context$stop$stopInd !== void 0 ? _context$stop$stopInd : -1);
51854
51856
  return interval.length === 0 ? "" : (_context$start$inputS = (_context$start$inputS2 = context.start.inputStream) === null || _context$start$inputS2 === void 0 ? void 0 : _context$start$inputS2.getText(interval)) !== null && _context$start$inputS !== void 0 ? _context$start$inputS : "";
51855
51857
  }
51858
+ removeEscapeSimbolsFromDescription(text) {
51859
+ const cleanedValue = text.replace("\\[", "[").replace("\\]", "]").replace("\\{", "{").replace("\\}", "}").replace("\\`", "`").replace("\\*", "*");
51860
+ return cleanedValue;
51861
+ }
51856
51862
  }
51857
51863
 
51858
51864
  /***/ }),
@@ -61296,49 +61302,6 @@ class DefaultKCLangExpressionVisitor {
61296
61302
 
61297
61303
  /***/ }),
61298
61304
 
61299
- /***/ "./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts":
61300
- /*!*****************************************************************!*\
61301
- !*** ./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts ***!
61302
- \*****************************************************************/
61303
- /***/ ((module) => {
61304
-
61305
- // this file was prevaled
61306
- /* eslint-disable */
61307
- // @ts-ignore
61308
- module.exports = "/*\n * Generated by PEG.js 0.10.0.\n *\n * http://pegjs.org/\n */\n(function() {\n \"use strict\";\n\n function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }\n\n function peg$SyntaxError(message, expected, found, location) {\n this.message = message;\n this.expected = expected;\n this.found = found;\n this.location = location;\n this.name = \"SyntaxError\";\n\n if (typeof Error.captureStackTrace === \"function\") {\n Error.captureStackTrace(this, peg$SyntaxError);\n }\n }\n\n peg$subclass(peg$SyntaxError, Error);\n\n peg$SyntaxError.buildMessage = function(expected, found) {\n var DESCRIBE_EXPECTATION_FNS = {\n literal: function(expectation) {\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n },\n\n \"class\": function(expectation) {\n var escapedParts = \"\",\n i;\n\n for (i = 0; i < expectation.parts.length; i++) {\n escapedParts += expectation.parts[i] instanceof Array\n ? classEscape(expectation.parts[i][0]) + \"-\" + classEscape(expectation.parts[i][1])\n : classEscape(expectation.parts[i]);\n }\n\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";\n },\n\n any: function(expectation) {\n return \"any character\";\n },\n\n end: function(expectation) {\n return \"end of input\";\n },\n\n other: function(expectation) {\n return expectation.description;\n }\n };\n\n function hex(ch) {\n return ch.charCodeAt(0).toString(16).toUpperCase();\n }\n\n function literalEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function classEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\]/g, '\\\\]')\n .replace(/\\^/g, '\\\\^')\n .replace(/-/g, '\\\\-')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function describeExpectation(expectation) {\n return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n }\n\n function describeExpected(expected) {\n var descriptions = new Array(expected.length),\n i, j;\n\n for (i = 0; i < expected.length; i++) {\n descriptions[i] = describeExpectation(expected[i]);\n }\n\n descriptions.sort();\n\n if (descriptions.length > 0) {\n for (i = 1, j = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n };\n\n function peg$parse(input, options) {\n options = options !== void 0 ? options : {};\n\n var peg$FAILED = {},\n\n peg$startRuleFunctions = { Text: peg$parseText },\n peg$startRuleFunction = peg$parseText,\n\n peg$c0 = function(items) {\n \treturn items.filter(x => x !== \"\");\n },\n peg$c1 = \"[\",\n peg$c2 = peg$literalExpectation(\"[\", false),\n peg$c3 = \"]\",\n peg$c4 = peg$literalExpectation(\"]\", false),\n peg$c5 = \"(\",\n peg$c6 = peg$literalExpectation(\"(\", false),\n peg$c7 = \")\",\n peg$c8 = peg$literalExpectation(\")\", false),\n peg$c9 = function(text, src) {\n return {\n \ttype: \"link\",\n text: text,\n src: src,\n }\n },\n peg$c10 = /^[^ \\]\\t\\n\\r]/,\n peg$c11 = peg$classExpectation([\" \", \"]\", \"\\t\", \"\\n\", \"\\r\"], true, false),\n peg$c12 = function(w) { return w.join(\"\") },\n peg$c13 = function(items) {\n return items.filter(x => x !== \"\");\n },\n peg$c14 = /^[^)]/,\n peg$c15 = peg$classExpectation([\")\"], true, false),\n peg$c16 = function(w) {\n \treturn w.join(\"\").trim()\n },\n peg$c17 = /^[\\n]/,\n peg$c18 = peg$classExpectation([\"\\n\"], false, false),\n peg$c19 = /^[ \\t\\n\\r]/,\n peg$c20 = peg$classExpectation([\" \", \"\\t\", \"\\n\", \"\\r\"], false, false),\n peg$c21 = function() {\n \treturn \"\\n\"\n },\n peg$c22 = /^[^ \\t\\n\\r]/,\n peg$c23 = peg$classExpectation([\" \", \"\\t\", \"\\n\", \"\\r\"], true, false),\n peg$c24 = function(w) {\n \treturn w.join(\"\");\n },\n peg$c25 = function() {\n \treturn \"\";\n },\n\n peg$currPos = 0,\n peg$savedPos = 0,\n peg$posDetailsCache = [{ line: 1, column: 1 }],\n peg$maxFailPos = 0,\n peg$maxFailExpected = [],\n peg$silentFails = 0,\n\n peg$result;\n\n if (\"startRule\" in options) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text: text, ignoreCase: ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase) {\n return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description: description };\n }\n\n function peg$computePosDetails(pos) {\n var details = peg$posDetailsCache[pos], p;\n\n if (details) {\n return details;\n } else {\n p = pos - 1;\n while (!peg$posDetailsCache[p]) {\n p--;\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos) {\n var startPosDetails = peg$computePosDetails(startPos),\n endPosDetails = peg$computePosDetails(endPos);\n\n return {\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column\n }\n };\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parseText() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseLink();\n if (s2 === peg$FAILED) {\n s2 = peg$parseWord();\n if (s2 === peg$FAILED) {\n s2 = peg$parseNewLine();\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n }\n }\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseLink();\n if (s2 === peg$FAILED) {\n s2 = peg$parseWord();\n if (s2 === peg$FAILED) {\n s2 = peg$parseNewLine();\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseLink() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c2); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseLinkText();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s3 = peg$c3;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s3 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 40) {\n s4 = peg$c5;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c6); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseLinkSrc();\n if (s5 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s6 = peg$c7;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c8); }\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c9(s2, s5);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseLinkText() {\n var s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$currPos;\n s3 = [];\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s2;\n s3 = peg$c12(s3);\n }\n s2 = s3;\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$currPos;\n s3 = [];\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s2;\n s3 = peg$c12(s3);\n }\n s2 = s3;\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c13(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseLinkSrc() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n if (peg$c14.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c15); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (peg$c14.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c15); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c16(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseNewLine() {\n var s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s1 !== peg$FAILED) {\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c21();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseWord() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n if (peg$c22.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (peg$c22.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c24(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parse_() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$currPos;\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = peg$currPos;\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = void 0;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n if (s4 !== peg$FAILED) {\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$currPos;\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = peg$currPos;\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = void 0;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n if (s4 !== peg$FAILED) {\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c25();\n }\n s0 = s1;\n\n return s0;\n }\n\n peg$result = peg$startRuleFunction();\n\n if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n return peg$result;\n } else {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n }\n\n return {\n SyntaxError: peg$SyntaxError,\n parse: peg$parse\n };\n})()";
61309
-
61310
- /***/ }),
61311
-
61312
- /***/ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts":
61313
- /*!****************************************************************!*\
61314
- !*** ./Generator/src/common/KCLang/KCLangDescriptionParser.ts ***!
61315
- \****************************************************************/
61316
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
61317
-
61318
- "use strict";
61319
- __webpack_require__.r(__webpack_exports__);
61320
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
61321
- /* harmony export */ KCLangDescriptionParser: () => (/* binding */ KCLangDescriptionParser)
61322
- /* harmony export */ });
61323
- /* harmony import */ var _KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KCLangDescriptionGrammar */ "./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts");
61324
- /* harmony import */ var _KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0__);
61325
- // @ts-ignore
61326
-
61327
-
61328
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
61329
- const evalParse = eval((_KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0___default())).parse;
61330
- class KCLangDescriptionParser {
61331
- static getOrCreateParser() {
61332
- return evalParse;
61333
- }
61334
- static parse(code) {
61335
- const parser = this.getOrCreateParser();
61336
- return parser(code);
61337
- }
61338
- }
61339
-
61340
- /***/ }),
61341
-
61342
61305
  /***/ "./Generator/src/common/KCLang/KCLangNodes.ts":
61343
61306
  /*!****************************************************!*\
61344
61307
  !*** ./Generator/src/common/KCLang/KCLangNodes.ts ***!
@@ -61719,10 +61682,8 @@ __webpack_require__.r(__webpack_exports__);
61719
61682
  /* harmony import */ var _StringUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../StringUtils */ "./Generator/src/common/StringUtils.ts");
61720
61683
  /* harmony import */ var _generators_AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader.ts");
61721
61684
  /* harmony import */ var _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./IKCLangExpressionVisitor */ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts");
61722
- /* harmony import */ var _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./KCLangDescriptionParser */ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts");
61723
- /* harmony import */ var _KCLangNodes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./KCLangNodes */ "./Generator/src/common/KCLang/KCLangNodes.ts");
61724
- /* harmony import */ var _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Antlr/KCLangAntlrParser */ "./Generator/src/common/KCLang/Antlr/KCLangAntlrParser.ts");
61725
-
61685
+ /* harmony import */ var _KCLangNodes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./KCLangNodes */ "./Generator/src/common/KCLang/KCLangNodes.ts");
61686
+ /* harmony import */ var _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Antlr/KCLangAntlrParser */ "./Generator/src/common/KCLang/Antlr/KCLangAntlrParser.ts");
61726
61687
 
61727
61688
 
61728
61689
 
@@ -61874,13 +61835,7 @@ function isCondition(contextBlock) {
61874
61835
  return contextBlock.type === "Condition";
61875
61836
  }
61876
61837
  function formatDescribeStatement(describe) {
61877
- return _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_6__.KCLangDescriptionParser.parse(describe.text).map(item => {
61878
- if (typeof item === "string") {
61879
- return item;
61880
- } else {
61881
- return `{{link ref=${item.src}}}${item.text.join(" ")}{{/link}}`;
61882
- }
61883
- }).join(" ");
61838
+ return describe.text;
61884
61839
  }
61885
61840
  function generateKCXmlFormula(ast, parents, describe) {
61886
61841
  if (parents.some(isCondition)) {
@@ -61915,20 +61870,20 @@ function generateBlockKCXmlFormulas(block, parents) {
61915
61870
  const result = [];
61916
61871
  let lastDescribeStatement;
61917
61872
  for (const statement of block.statements) {
61918
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isFormulaStatement)(statement)) {
61873
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isFormulaStatement)(statement)) {
61919
61874
  result.push(generateKCXmlFormula(statement, nextParents, lastDescribeStatement));
61920
61875
  lastDescribeStatement = undefined;
61921
61876
  }
61922
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isEnsureStatement)(statement)) {
61877
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(statement)) {
61923
61878
  lastDescribeStatement = undefined;
61924
61879
  }
61925
61880
  if (lastDescribeStatement != undefined) {
61926
61881
  throw new Error("Describe should be placed before assign of ensure statements");
61927
61882
  }
61928
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isDescribeStatement)(statement)) {
61883
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(statement)) {
61929
61884
  lastDescribeStatement = statement;
61930
61885
  }
61931
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isBlockStatement)(statement)) {
61886
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(statement)) {
61932
61887
  result.push(generateBlockKCXmlFormulas(statement, nextParents));
61933
61888
  }
61934
61889
  }
@@ -62104,23 +62059,23 @@ function generateBlockKCXmlConditions(block, parentContexts) {
62104
62059
  const result = [];
62105
62060
  let lastDescribeStatement;
62106
62061
  for (const statement of block.statements) {
62107
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isFormulaStatement)(statement)) {
62062
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isFormulaStatement)(statement)) {
62108
62063
  lastDescribeStatement = undefined;
62109
62064
  }
62110
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isEnsureStatement)(statement)) {
62065
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(statement)) {
62111
62066
  result.push(generateKCXmlCondition(statement, nextParents, lastDescribeStatement));
62112
62067
  lastDescribeStatement = undefined;
62113
62068
  }
62114
62069
  if (lastDescribeStatement != undefined) {
62115
62070
  throw new Error("Describe should be placed before assign of ensure statements");
62116
62071
  }
62117
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isDescribeStatement)(statement)) {
62072
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(statement)) {
62118
62073
  lastDescribeStatement = statement;
62119
62074
  }
62120
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isConditionalStatement)(statement)) {
62075
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isConditionalStatement)(statement)) {
62121
62076
  result.push(generateConditionalConditions(statement, nextParents));
62122
62077
  }
62123
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isBlockStatement)(statement)) {
62078
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(statement)) {
62124
62079
  result.push(generateBlockKCXmlConditions(statement, nextParents));
62125
62080
  }
62126
62081
  }
@@ -62134,20 +62089,20 @@ function generateConditionalConditions(conditionalStatement, parentContexts) {
62134
62089
  expression: conditionalStatement.condition
62135
62090
  }];
62136
62091
  for (const x of conditionalStatement.statements) {
62137
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isEnsureStatement)(x)) {
62092
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(x)) {
62138
62093
  result.push(generateKCXmlCondition(x, thenChildrenContexts, lastDescribeStatement));
62139
62094
  lastDescribeStatement = undefined;
62140
62095
  }
62141
62096
  if (lastDescribeStatement != undefined) {
62142
62097
  throw new Error("Describe should be placed before assign of ensure statements");
62143
62098
  }
62144
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isDescribeStatement)(x)) {
62099
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(x)) {
62145
62100
  lastDescribeStatement = x;
62146
62101
  }
62147
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isConditionalStatement)(x)) {
62102
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isConditionalStatement)(x)) {
62148
62103
  result.push(generateConditionalConditions(x, thenChildrenContexts));
62149
62104
  }
62150
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isBlockStatement)(x)) {
62105
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(x)) {
62151
62106
  result.push(generateBlockKCXmlConditions(x, thenChildrenContexts));
62152
62107
  }
62153
62108
  }
@@ -62161,20 +62116,20 @@ function generateConditionalConditions(conditionalStatement, parentContexts) {
62161
62116
  }
62162
62117
  }];
62163
62118
  for (const x of conditionalStatement.elseStatements) {
62164
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isEnsureStatement)(x)) {
62119
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(x)) {
62165
62120
  result.push(generateKCXmlCondition(x, elseChildrenContexts, lastDescribeStatement2));
62166
62121
  lastDescribeStatement2 = undefined;
62167
62122
  }
62168
62123
  if (lastDescribeStatement2 != undefined) {
62169
62124
  throw new Error("Describe should be placed before assign of ensure statements");
62170
62125
  }
62171
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isDescribeStatement)(x)) {
62126
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(x)) {
62172
62127
  lastDescribeStatement2 = x;
62173
62128
  }
62174
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isConditionalStatement)(x)) {
62129
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isConditionalStatement)(x)) {
62175
62130
  result.push(generateConditionalConditions(x, elseChildrenContexts));
62176
62131
  }
62177
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isBlockStatement)(x)) {
62132
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(x)) {
62178
62133
  result.push(generateBlockKCXmlConditions(x, elseChildrenContexts));
62179
62134
  }
62180
62135
  }
@@ -62202,7 +62157,7 @@ function generateKCXml(blocks) {
62202
62157
  }
62203
62158
  class KCLangToXmlTranspiler {
62204
62159
  static transpile(kcLang, customParser) {
62205
- const parser = customParser !== null && customParser !== void 0 ? customParser : _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_8__.KCLangAntlrParser.parse;
62160
+ const parser = customParser !== null && customParser !== void 0 ? customParser : _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_7__.KCLangAntlrParser.parse;
62206
62161
  const kcxml = generateKCXml(parser(kcLang).blocks);
62207
62162
  return kcxml;
62208
62163
  }
@@ -67860,7 +67815,7 @@ class FormulaProcessor {
67860
67815
  resultExpression: _babel_types__WEBPACK_IMPORTED_MODULE_0__.identifier(this.getNameByPath(path)),
67861
67816
  target: new _DataPath__WEBPACK_IMPORTED_MODULE_3__.DataPath(removeLastStar(absoluteResolvedPath.toString()).split("/"))
67862
67817
  });
67863
- this.additionalAutocalculations.push(new _FormulaAutoCalculation__WEBPACK_IMPORTED_MODULE_4__.FormulaAutoCalculation(this.getNameByPath(removeLastStar(`${this.formula.match}/${relativePath.toString()}`)) + "_count", matchPath, [{
67818
+ this.additionalAutocalculations.push(new _FormulaAutoCalculation__WEBPACK_IMPORTED_MODULE_4__.FormulaAutoCalculation(this.getNameByPath(removeLastStar(`${this.formula.match}/${relativePath.toString()}`)) + "_count_generated", matchPath, [{
67864
67819
  absoluteResolvedPath: new _DataPath__WEBPACK_IMPORTED_MODULE_3__.DataPath(removeLastStar(absoluteResolvedPath.toString()).split("/")),
67865
67820
  localVariableName: undefined,
67866
67821
  variableType: variableType,
@@ -67886,7 +67841,7 @@ class FormulaProcessor {
67886
67841
  }],
67887
67842
  // В целом эти дичь: брать дефолтное значение для count-а из
67888
67843
  // DataDeclaration, но такое поведение было всегда
67889
- this.dataDeclarationHelper.getDefaultValue(absoluteResolvedPath.toString())), new _FormulaAutoCalculation__WEBPACK_IMPORTED_MODULE_4__.FormulaAutoCalculation(this.getNameByPath(removeLastStar(`${this.formula.match}/${relativePath.toString()}`)) + "_sum", matchPath, [{
67844
+ this.dataDeclarationHelper.getDefaultValue(absoluteResolvedPath.toString())), new _FormulaAutoCalculation__WEBPACK_IMPORTED_MODULE_4__.FormulaAutoCalculation(this.getNameByPath(removeLastStar(`${this.formula.match}/${relativePath.toString()}`)) + "_sum_generated", matchPath, [{
67890
67845
  absoluteResolvedPath: new _DataPath__WEBPACK_IMPORTED_MODULE_3__.DataPath(removeLastStar(absoluteResolvedPath.toString()).split("/")),
67891
67846
  localVariableName: undefined,
67892
67847
  variableType: variableType,
@@ -72645,8 +72600,8 @@ __webpack_require__.r(__webpack_exports__);
72645
72600
  /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_3__);
72646
72601
  /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! chalk */ "./node_modules/chalk/source/index.js");
72647
72602
  /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_4__);
72648
- /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
72649
- /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_11__);
72603
+ /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
72604
+ /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_12__);
72650
72605
  /* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! md5 */ "./node_modules/md5/md5.js");
72651
72606
  /* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_5__);
72652
72607
  /* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! recursive-readdir */ "./node_modules/recursive-readdir/index.js");
@@ -72654,7 +72609,9 @@ __webpack_require__.r(__webpack_exports__);
72654
72609
  /* harmony import */ var _common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/ExtractSugarReferences */ "./Generator/src/common/ExtractSugarReferences.ts");
72655
72610
  /* harmony import */ var _Common_GetRngSchemaFileExtension__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../Common/GetRngSchemaFileExtension */ "./Common/GetRngSchemaFileExtension.ts");
72656
72611
  /* harmony import */ var _Common_FormPathUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../Common/FormPathUtils */ "./Common/FormPathUtils.ts");
72657
- /* harmony import */ var _FsUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./FsUtils */ "./Generator/src/generators/FsUtils.ts");
72612
+ /* harmony import */ var _Common_WellKnownDirectories__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../Common/WellKnownDirectories */ "./Common/WellKnownDirectories.ts");
72613
+ /* harmony import */ var _FsUtils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./FsUtils */ "./Generator/src/generators/FsUtils.ts");
72614
+
72658
72615
 
72659
72616
 
72660
72617
 
@@ -72680,7 +72637,7 @@ async function readFormSources(formSourcesPath, farmDirectory) {
72680
72637
  if (sugarReferences.fetchFunctionFiles.length === 0) {
72681
72638
  // eslint-disable-next-line no-console
72682
72639
  console.warn(chalk__WEBPACK_IMPORTED_MODULE_4___default().yellow(`[WARN] Форма не содержит ссылок на fetch-функции. Будут автоматически подключены функции из каталога legacyfetchfuctions\n` + `[WARN] В будущем необходимо явно прописывать ссылки на используемые fetch-функции`));
72683
- const legacyfetchfunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_11__.pathExists)(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions"))) ? path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions") : path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "candy.farm", "legacyfetchfunctions");
72640
+ const legacyfetchfunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions"))) ? path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions") : path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "candy.farm", "legacyfetchfunctions");
72684
72641
  sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
72685
72642
  }
72686
72643
  const result = {
@@ -72745,7 +72702,7 @@ async function extractReferences(formSugarDirectoryPath) {
72745
72702
  return (0,_common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_7__.extractSugarReferences)(indexContent, filePath => readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, filePath), "utf-8"));
72746
72703
  }
72747
72704
  async function getAllFilePathsInDirectory(directoryPath, _filelist) {
72748
- if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_11__.pathExists)(directoryPath))) {
72705
+ if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(directoryPath))) {
72749
72706
  return [];
72750
72707
  }
72751
72708
  const files = await readdirAsync(directoryPath);
@@ -72760,7 +72717,7 @@ async function getAllFilePathsInDirectory(directoryPath, _filelist) {
72760
72717
  return filelist;
72761
72718
  }
72762
72719
  async function checkFileExists(filePath) {
72763
- if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_11__.pathExists)(filePath))) {
72720
+ if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(filePath))) {
72764
72721
  return [];
72765
72722
  }
72766
72723
  return [filePath];
@@ -72769,10 +72726,10 @@ async function getAllDependencies(formSourcesPath, farmDirectory) {
72769
72726
  const formSugarDirectoryPath = path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "sugar");
72770
72727
  const sugarReferences = await extractReferences(formSugarDirectoryPath);
72771
72728
  if (sugarReferences.fetchFunctionFiles.length === 0) {
72772
- const legacyfetchfunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_11__.pathExists)(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions"))) ? path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions") : path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "candy.farm", "legacyfetchfunctions");
72729
+ const legacyfetchfunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions"))) ? path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions") : path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "candy.farm", "legacyfetchfunctions");
72773
72730
  sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
72774
72731
  }
72775
- return [path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), ...sugarReferences.fetchFunctionFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...sugarReferences.sugarFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x + ".sugar.xml")), ...sugarReferences.resourceFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "settings.json"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "hooks.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "converters"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "mergers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "jsHelpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "xsltTemplates"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "tour", "tour.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "localization")))];
72732
+ return [path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, _Common_WellKnownDirectories__WEBPACK_IMPORTED_MODULE_10__.WellKnownDirectories.FormJsonFileName), path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), ...sugarReferences.fetchFunctionFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...sugarReferences.sugarFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x + ".sugar.xml")), ...sugarReferences.resourceFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "settings.json"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "hooks.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "converters"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "mergers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "jsHelpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "xsltTemplates"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "tour", "tour.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "localization"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "normalizers")))];
72776
72733
  }
72777
72734
  async function getAllDependenciesHash(formSourcesPath, farmDirectory) {
72778
72735
  const allDeps = await getAllDependencies(formSourcesPath, farmDirectory);
@@ -72800,7 +72757,7 @@ async function readSugarFiles(formSugarDirectoryPath, references) {
72800
72757
  return result;
72801
72758
  }
72802
72759
  async function readCustomControlsFiles(formSugarDirectoryPath) {
72803
- if (!(await (0,_FsUtils__WEBPACK_IMPORTED_MODULE_10__.isDirectoryExists)(formSugarDirectoryPath))) {
72760
+ if (!(await (0,_FsUtils__WEBPACK_IMPORTED_MODULE_11__.isDirectoryExists)(formSugarDirectoryPath))) {
72804
72761
  return {};
72805
72762
  }
72806
72763
  const fileNames = await recursive_readdir__WEBPACK_IMPORTED_MODULE_6___default()(formSugarDirectoryPath);
@@ -76937,7 +76894,7 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
76937
76894
  generateValidationText(current, next) {
76938
76895
  const validationText = next.message.reduce((acc, item) => {
76939
76896
  if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression) {
76940
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_6__.castOperandToStringIfNeed)(item));
76897
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(JSON.stringify(item.stringValue).replace(/^"|"$/g, "")));
76941
76898
  }
76942
76899
  const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_6__.extractValueReferenceFromCast)(item);
76943
76900
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.JoinExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DeserializeEnumerationExpression([valueReference], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BoolLiteralExpression(true)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(", ")));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "5.97.0-optimize-engine.0",
3
+ "version": "5.97.0",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,