@kontur.candy/generator 5.97.0-watch-normalizers.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.
- package/dist/index.js +37 -76
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -51390,7 +51390,7 @@ class KCLangAntlrVisitor {
|
|
|
51390
51390
|
return {
|
|
51391
51391
|
type: "withBlock",
|
|
51392
51392
|
name: ctx.NAME().text,
|
|
51393
|
-
value: hasInterpolation ? value.replace(/```/g, "") : value.replace(/^'|^"|'$|"$/g, "")
|
|
51393
|
+
value: hasInterpolation ? this.removeEscapeSimbolsFromDescription(value.replace(/```/g, "")) : value.replace(/^'|^"|'$|"$/g, "")
|
|
51394
51394
|
};
|
|
51395
51395
|
}
|
|
51396
51396
|
visitFormula(ctx) {
|
|
@@ -51658,6 +51658,14 @@ class KCLangAntlrVisitor {
|
|
|
51658
51658
|
if (interpolationResult) {
|
|
51659
51659
|
return interpolationResult.interpolationContent().accept(this);
|
|
51660
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
|
+
}
|
|
51661
51669
|
|
|
51662
51670
|
// текст вокруг
|
|
51663
51671
|
return {
|
|
@@ -51847,6 +51855,10 @@ class KCLangAntlrVisitor {
|
|
|
51847
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);
|
|
51848
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 : "";
|
|
51849
51857
|
}
|
|
51858
|
+
removeEscapeSimbolsFromDescription(text) {
|
|
51859
|
+
const cleanedValue = text.replace("\\[", "[").replace("\\]", "]").replace("\\{", "{").replace("\\}", "}").replace("\\`", "`").replace("\\*", "*");
|
|
51860
|
+
return cleanedValue;
|
|
51861
|
+
}
|
|
51850
51862
|
}
|
|
51851
51863
|
|
|
51852
51864
|
/***/ }),
|
|
@@ -61290,49 +61302,6 @@ class DefaultKCLangExpressionVisitor {
|
|
|
61290
61302
|
|
|
61291
61303
|
/***/ }),
|
|
61292
61304
|
|
|
61293
|
-
/***/ "./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts":
|
|
61294
|
-
/*!*****************************************************************!*\
|
|
61295
|
-
!*** ./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts ***!
|
|
61296
|
-
\*****************************************************************/
|
|
61297
|
-
/***/ ((module) => {
|
|
61298
|
-
|
|
61299
|
-
// this file was prevaled
|
|
61300
|
-
/* eslint-disable */
|
|
61301
|
-
// @ts-ignore
|
|
61302
|
-
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})()";
|
|
61303
|
-
|
|
61304
|
-
/***/ }),
|
|
61305
|
-
|
|
61306
|
-
/***/ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts":
|
|
61307
|
-
/*!****************************************************************!*\
|
|
61308
|
-
!*** ./Generator/src/common/KCLang/KCLangDescriptionParser.ts ***!
|
|
61309
|
-
\****************************************************************/
|
|
61310
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
61311
|
-
|
|
61312
|
-
"use strict";
|
|
61313
|
-
__webpack_require__.r(__webpack_exports__);
|
|
61314
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
61315
|
-
/* harmony export */ KCLangDescriptionParser: () => (/* binding */ KCLangDescriptionParser)
|
|
61316
|
-
/* harmony export */ });
|
|
61317
|
-
/* harmony import */ var _KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KCLangDescriptionGrammar */ "./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts");
|
|
61318
|
-
/* harmony import */ var _KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0__);
|
|
61319
|
-
// @ts-ignore
|
|
61320
|
-
|
|
61321
|
-
|
|
61322
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
61323
|
-
const evalParse = eval((_KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0___default())).parse;
|
|
61324
|
-
class KCLangDescriptionParser {
|
|
61325
|
-
static getOrCreateParser() {
|
|
61326
|
-
return evalParse;
|
|
61327
|
-
}
|
|
61328
|
-
static parse(code) {
|
|
61329
|
-
const parser = this.getOrCreateParser();
|
|
61330
|
-
return parser(code);
|
|
61331
|
-
}
|
|
61332
|
-
}
|
|
61333
|
-
|
|
61334
|
-
/***/ }),
|
|
61335
|
-
|
|
61336
61305
|
/***/ "./Generator/src/common/KCLang/KCLangNodes.ts":
|
|
61337
61306
|
/*!****************************************************!*\
|
|
61338
61307
|
!*** ./Generator/src/common/KCLang/KCLangNodes.ts ***!
|
|
@@ -61713,10 +61682,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
61713
61682
|
/* harmony import */ var _StringUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../StringUtils */ "./Generator/src/common/StringUtils.ts");
|
|
61714
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");
|
|
61715
61684
|
/* harmony import */ var _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./IKCLangExpressionVisitor */ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts");
|
|
61716
|
-
/* harmony import */ var
|
|
61717
|
-
/* harmony import */ var
|
|
61718
|
-
/* harmony import */ var _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Antlr/KCLangAntlrParser */ "./Generator/src/common/KCLang/Antlr/KCLangAntlrParser.ts");
|
|
61719
|
-
|
|
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");
|
|
61720
61687
|
|
|
61721
61688
|
|
|
61722
61689
|
|
|
@@ -61868,13 +61835,7 @@ function isCondition(contextBlock) {
|
|
|
61868
61835
|
return contextBlock.type === "Condition";
|
|
61869
61836
|
}
|
|
61870
61837
|
function formatDescribeStatement(describe) {
|
|
61871
|
-
return
|
|
61872
|
-
if (typeof item === "string") {
|
|
61873
|
-
return item;
|
|
61874
|
-
} else {
|
|
61875
|
-
return `{{link ref=${item.src}}}${item.text.join(" ")}{{/link}}`;
|
|
61876
|
-
}
|
|
61877
|
-
}).join(" ");
|
|
61838
|
+
return describe.text;
|
|
61878
61839
|
}
|
|
61879
61840
|
function generateKCXmlFormula(ast, parents, describe) {
|
|
61880
61841
|
if (parents.some(isCondition)) {
|
|
@@ -61909,20 +61870,20 @@ function generateBlockKCXmlFormulas(block, parents) {
|
|
|
61909
61870
|
const result = [];
|
|
61910
61871
|
let lastDescribeStatement;
|
|
61911
61872
|
for (const statement of block.statements) {
|
|
61912
|
-
if ((0,
|
|
61873
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isFormulaStatement)(statement)) {
|
|
61913
61874
|
result.push(generateKCXmlFormula(statement, nextParents, lastDescribeStatement));
|
|
61914
61875
|
lastDescribeStatement = undefined;
|
|
61915
61876
|
}
|
|
61916
|
-
if ((0,
|
|
61877
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(statement)) {
|
|
61917
61878
|
lastDescribeStatement = undefined;
|
|
61918
61879
|
}
|
|
61919
61880
|
if (lastDescribeStatement != undefined) {
|
|
61920
61881
|
throw new Error("Describe should be placed before assign of ensure statements");
|
|
61921
61882
|
}
|
|
61922
|
-
if ((0,
|
|
61883
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(statement)) {
|
|
61923
61884
|
lastDescribeStatement = statement;
|
|
61924
61885
|
}
|
|
61925
|
-
if ((0,
|
|
61886
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(statement)) {
|
|
61926
61887
|
result.push(generateBlockKCXmlFormulas(statement, nextParents));
|
|
61927
61888
|
}
|
|
61928
61889
|
}
|
|
@@ -62098,23 +62059,23 @@ function generateBlockKCXmlConditions(block, parentContexts) {
|
|
|
62098
62059
|
const result = [];
|
|
62099
62060
|
let lastDescribeStatement;
|
|
62100
62061
|
for (const statement of block.statements) {
|
|
62101
|
-
if ((0,
|
|
62062
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isFormulaStatement)(statement)) {
|
|
62102
62063
|
lastDescribeStatement = undefined;
|
|
62103
62064
|
}
|
|
62104
|
-
if ((0,
|
|
62065
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(statement)) {
|
|
62105
62066
|
result.push(generateKCXmlCondition(statement, nextParents, lastDescribeStatement));
|
|
62106
62067
|
lastDescribeStatement = undefined;
|
|
62107
62068
|
}
|
|
62108
62069
|
if (lastDescribeStatement != undefined) {
|
|
62109
62070
|
throw new Error("Describe should be placed before assign of ensure statements");
|
|
62110
62071
|
}
|
|
62111
|
-
if ((0,
|
|
62072
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(statement)) {
|
|
62112
62073
|
lastDescribeStatement = statement;
|
|
62113
62074
|
}
|
|
62114
|
-
if ((0,
|
|
62075
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isConditionalStatement)(statement)) {
|
|
62115
62076
|
result.push(generateConditionalConditions(statement, nextParents));
|
|
62116
62077
|
}
|
|
62117
|
-
if ((0,
|
|
62078
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(statement)) {
|
|
62118
62079
|
result.push(generateBlockKCXmlConditions(statement, nextParents));
|
|
62119
62080
|
}
|
|
62120
62081
|
}
|
|
@@ -62128,20 +62089,20 @@ function generateConditionalConditions(conditionalStatement, parentContexts) {
|
|
|
62128
62089
|
expression: conditionalStatement.condition
|
|
62129
62090
|
}];
|
|
62130
62091
|
for (const x of conditionalStatement.statements) {
|
|
62131
|
-
if ((0,
|
|
62092
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(x)) {
|
|
62132
62093
|
result.push(generateKCXmlCondition(x, thenChildrenContexts, lastDescribeStatement));
|
|
62133
62094
|
lastDescribeStatement = undefined;
|
|
62134
62095
|
}
|
|
62135
62096
|
if (lastDescribeStatement != undefined) {
|
|
62136
62097
|
throw new Error("Describe should be placed before assign of ensure statements");
|
|
62137
62098
|
}
|
|
62138
|
-
if ((0,
|
|
62099
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(x)) {
|
|
62139
62100
|
lastDescribeStatement = x;
|
|
62140
62101
|
}
|
|
62141
|
-
if ((0,
|
|
62102
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isConditionalStatement)(x)) {
|
|
62142
62103
|
result.push(generateConditionalConditions(x, thenChildrenContexts));
|
|
62143
62104
|
}
|
|
62144
|
-
if ((0,
|
|
62105
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(x)) {
|
|
62145
62106
|
result.push(generateBlockKCXmlConditions(x, thenChildrenContexts));
|
|
62146
62107
|
}
|
|
62147
62108
|
}
|
|
@@ -62155,20 +62116,20 @@ function generateConditionalConditions(conditionalStatement, parentContexts) {
|
|
|
62155
62116
|
}
|
|
62156
62117
|
}];
|
|
62157
62118
|
for (const x of conditionalStatement.elseStatements) {
|
|
62158
|
-
if ((0,
|
|
62119
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(x)) {
|
|
62159
62120
|
result.push(generateKCXmlCondition(x, elseChildrenContexts, lastDescribeStatement2));
|
|
62160
62121
|
lastDescribeStatement2 = undefined;
|
|
62161
62122
|
}
|
|
62162
62123
|
if (lastDescribeStatement2 != undefined) {
|
|
62163
62124
|
throw new Error("Describe should be placed before assign of ensure statements");
|
|
62164
62125
|
}
|
|
62165
|
-
if ((0,
|
|
62126
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(x)) {
|
|
62166
62127
|
lastDescribeStatement2 = x;
|
|
62167
62128
|
}
|
|
62168
|
-
if ((0,
|
|
62129
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isConditionalStatement)(x)) {
|
|
62169
62130
|
result.push(generateConditionalConditions(x, elseChildrenContexts));
|
|
62170
62131
|
}
|
|
62171
|
-
if ((0,
|
|
62132
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(x)) {
|
|
62172
62133
|
result.push(generateBlockKCXmlConditions(x, elseChildrenContexts));
|
|
62173
62134
|
}
|
|
62174
62135
|
}
|
|
@@ -62196,7 +62157,7 @@ function generateKCXml(blocks) {
|
|
|
62196
62157
|
}
|
|
62197
62158
|
class KCLangToXmlTranspiler {
|
|
62198
62159
|
static transpile(kcLang, customParser) {
|
|
62199
|
-
const parser = customParser !== null && customParser !== void 0 ? customParser :
|
|
62160
|
+
const parser = customParser !== null && customParser !== void 0 ? customParser : _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_7__.KCLangAntlrParser.parse;
|
|
62200
62161
|
const kcxml = generateKCXml(parser(kcLang).blocks);
|
|
62201
62162
|
return kcxml;
|
|
62202
62163
|
}
|
|
@@ -67854,7 +67815,7 @@ class FormulaProcessor {
|
|
|
67854
67815
|
resultExpression: _babel_types__WEBPACK_IMPORTED_MODULE_0__.identifier(this.getNameByPath(path)),
|
|
67855
67816
|
target: new _DataPath__WEBPACK_IMPORTED_MODULE_3__.DataPath(removeLastStar(absoluteResolvedPath.toString()).split("/"))
|
|
67856
67817
|
});
|
|
67857
|
-
this.additionalAutocalculations.push(new _FormulaAutoCalculation__WEBPACK_IMPORTED_MODULE_4__.FormulaAutoCalculation(this.getNameByPath(removeLastStar(`${this.formula.match}/${relativePath.toString()}`)) + "
|
|
67818
|
+
this.additionalAutocalculations.push(new _FormulaAutoCalculation__WEBPACK_IMPORTED_MODULE_4__.FormulaAutoCalculation(this.getNameByPath(removeLastStar(`${this.formula.match}/${relativePath.toString()}`)) + "_count_generated", matchPath, [{
|
|
67858
67819
|
absoluteResolvedPath: new _DataPath__WEBPACK_IMPORTED_MODULE_3__.DataPath(removeLastStar(absoluteResolvedPath.toString()).split("/")),
|
|
67859
67820
|
localVariableName: undefined,
|
|
67860
67821
|
variableType: variableType,
|
|
@@ -67880,7 +67841,7 @@ class FormulaProcessor {
|
|
|
67880
67841
|
}],
|
|
67881
67842
|
// В целом эти дичь: брать дефолтное значение для count-а из
|
|
67882
67843
|
// DataDeclaration, но такое поведение было всегда
|
|
67883
|
-
this.dataDeclarationHelper.getDefaultValue(absoluteResolvedPath.toString())), new _FormulaAutoCalculation__WEBPACK_IMPORTED_MODULE_4__.FormulaAutoCalculation(this.getNameByPath(removeLastStar(`${this.formula.match}/${relativePath.toString()}`)) + "
|
|
67844
|
+
this.dataDeclarationHelper.getDefaultValue(absoluteResolvedPath.toString())), new _FormulaAutoCalculation__WEBPACK_IMPORTED_MODULE_4__.FormulaAutoCalculation(this.getNameByPath(removeLastStar(`${this.formula.match}/${relativePath.toString()}`)) + "_sum_generated", matchPath, [{
|
|
67884
67845
|
absoluteResolvedPath: new _DataPath__WEBPACK_IMPORTED_MODULE_3__.DataPath(removeLastStar(absoluteResolvedPath.toString()).split("/")),
|
|
67885
67846
|
localVariableName: undefined,
|
|
67886
67847
|
variableType: variableType,
|
|
@@ -76933,7 +76894,7 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
|
|
|
76933
76894
|
generateValidationText(current, next) {
|
|
76934
76895
|
const validationText = next.message.reduce((acc, item) => {
|
|
76935
76896
|
if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression) {
|
|
76936
|
-
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, (
|
|
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, "")));
|
|
76937
76898
|
}
|
|
76938
76899
|
const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_6__.extractValueReferenceFromCast)(item);
|
|
76939
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(", ")));
|