@kontur.candy/generator 4.245.0 → 4.247.0-diadoc.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 +163 -756
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -112944,7 +112944,8 @@ class ModelPathBuilder {
|
|
|
112944
112944
|
__webpack_require__.r(__webpack_exports__);
|
|
112945
112945
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
112946
112946
|
/* harmony export */ "Map2": () => (/* binding */ Map2),
|
|
112947
|
-
/* harmony export */ "ModelPathMap": () => (/* binding */ ModelPathMap)
|
|
112947
|
+
/* harmony export */ "ModelPathMap": () => (/* binding */ ModelPathMap),
|
|
112948
|
+
/* harmony export */ "AbsoluteModelPathMap": () => (/* binding */ AbsoluteModelPathMap)
|
|
112948
112949
|
/* harmony export */ });
|
|
112949
112950
|
/* harmony import */ var _TypingUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../TypingUtils */ "./Common/TypingUtils.ts");
|
|
112950
112951
|
/* harmony import */ var _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
|
|
@@ -112972,6 +112973,10 @@ class Map2 {
|
|
|
112972
112973
|
has(key) {
|
|
112973
112974
|
return this.getEntryOrUndefined(key) != undefined;
|
|
112974
112975
|
}
|
|
112976
|
+
|
|
112977
|
+
get isEmpty() {
|
|
112978
|
+
return this.hashMap.size === 0;
|
|
112979
|
+
}
|
|
112975
112980
|
/**
|
|
112976
112981
|
* Обновляет значение в словаре по ключю, если значения нет -- устнавит новое
|
|
112977
112982
|
* @param key ключ словаря для робновления
|
|
@@ -113052,6 +113057,22 @@ class ModelPathMap extends Map2 {
|
|
|
113052
113057
|
return key.getHash(this.eachCurrentCollision);
|
|
113053
113058
|
}
|
|
113054
113059
|
|
|
113060
|
+
}
|
|
113061
|
+
class AbsoluteModelPathMap extends Map2 {
|
|
113062
|
+
constructor(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_1__.EachCurrentCollision.AreSame) {
|
|
113063
|
+
super();
|
|
113064
|
+
this.eachCurrentCollision = void 0;
|
|
113065
|
+
this.eachCurrentCollision = eachCurrentCollision;
|
|
113066
|
+
}
|
|
113067
|
+
|
|
113068
|
+
areKeyEqual(left, right) {
|
|
113069
|
+
return left.isEquals(right, this.eachCurrentCollision);
|
|
113070
|
+
}
|
|
113071
|
+
|
|
113072
|
+
getKeyHash(key) {
|
|
113073
|
+
return key.getHash(this.eachCurrentCollision);
|
|
113074
|
+
}
|
|
113075
|
+
|
|
113055
113076
|
}
|
|
113056
113077
|
|
|
113057
113078
|
/***/ }),
|
|
@@ -113312,7 +113333,11 @@ function ensureNotNullOrUndefined(input) {
|
|
|
113312
113333
|
function noop() {// noop
|
|
113313
113334
|
}
|
|
113314
113335
|
function reject(message) {
|
|
113315
|
-
|
|
113336
|
+
if (typeof message === "string" || message == undefined) {
|
|
113337
|
+
throw new Error(message !== null && message !== void 0 ? message : "Undefined is not allowed");
|
|
113338
|
+
} else {
|
|
113339
|
+
throw message;
|
|
113340
|
+
}
|
|
113316
113341
|
}
|
|
113317
113342
|
function isLengthGreaterThenOrEqual(items, minLength) {
|
|
113318
113343
|
return items.length >= minLength;
|
|
@@ -120490,293 +120515,6 @@ class CompositionOperandContext extends antlr4ts_ParserRuleContext__WEBPACK_IMPO
|
|
|
120490
120515
|
|
|
120491
120516
|
/***/ }),
|
|
120492
120517
|
|
|
120493
|
-
/***/ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts":
|
|
120494
|
-
/*!*****************************************************************!*\
|
|
120495
|
-
!*** ./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts ***!
|
|
120496
|
-
\*****************************************************************/
|
|
120497
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
120498
|
-
|
|
120499
|
-
"use strict";
|
|
120500
|
-
__webpack_require__.r(__webpack_exports__);
|
|
120501
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
120502
|
-
/* harmony export */ "traverseKCLangExpression": () => (/* binding */ traverseKCLangExpression),
|
|
120503
|
-
/* harmony export */ "DefaultKCLangExpressionVisitor": () => (/* binding */ DefaultKCLangExpressionVisitor)
|
|
120504
|
-
/* harmony export */ });
|
|
120505
|
-
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
120506
|
-
|
|
120507
|
-
// tslint:disable-next-line:cyclomatic-complexity
|
|
120508
|
-
function traverseKCLangExpression(node, visitor) {
|
|
120509
|
-
switch (node.type) {
|
|
120510
|
-
case "cast":
|
|
120511
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120512
|
-
visitor.visitCastExpressionKCLangNode(node);
|
|
120513
|
-
break;
|
|
120514
|
-
|
|
120515
|
-
case "oneof":
|
|
120516
|
-
traverseKCLangExpression(node.testExpression, visitor);
|
|
120517
|
-
visitor.visitOneOfExpressionKCLangNode(node);
|
|
120518
|
-
break;
|
|
120519
|
-
|
|
120520
|
-
case "abs":
|
|
120521
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120522
|
-
visitor.visitAbsKCLangNode(node);
|
|
120523
|
-
break;
|
|
120524
|
-
|
|
120525
|
-
case "xabs":
|
|
120526
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120527
|
-
visitor.visitXAbsKCLangNode(node);
|
|
120528
|
-
break;
|
|
120529
|
-
|
|
120530
|
-
case "exists":
|
|
120531
|
-
visitor.visitExistsKCLangNode(node);
|
|
120532
|
-
break;
|
|
120533
|
-
|
|
120534
|
-
case "length":
|
|
120535
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120536
|
-
visitor.visitLengthKCLangNode(node);
|
|
120537
|
-
break;
|
|
120538
|
-
|
|
120539
|
-
case "and":
|
|
120540
|
-
for (const expression of node.expressions) {
|
|
120541
|
-
traverseKCLangExpression(expression, visitor);
|
|
120542
|
-
}
|
|
120543
|
-
|
|
120544
|
-
visitor.visitAndKCLangNode(node);
|
|
120545
|
-
break;
|
|
120546
|
-
|
|
120547
|
-
case "sum":
|
|
120548
|
-
visitor.visitSumKCLangNode(node);
|
|
120549
|
-
break;
|
|
120550
|
-
|
|
120551
|
-
case "gt":
|
|
120552
|
-
case "ge":
|
|
120553
|
-
case "lt":
|
|
120554
|
-
case "le":
|
|
120555
|
-
case "eq":
|
|
120556
|
-
case "noteq":
|
|
120557
|
-
for (const expression of node.expressions) {
|
|
120558
|
-
traverseKCLangExpression(expression, visitor);
|
|
120559
|
-
}
|
|
120560
|
-
|
|
120561
|
-
visitor.visitComparisonKCLangNode(node);
|
|
120562
|
-
break;
|
|
120563
|
-
|
|
120564
|
-
case "division":
|
|
120565
|
-
case "multiply":
|
|
120566
|
-
for (const expression of node.expressions) {
|
|
120567
|
-
traverseKCLangExpression(expression, visitor);
|
|
120568
|
-
}
|
|
120569
|
-
|
|
120570
|
-
visitor.visitMultiplyKCLangNode(node);
|
|
120571
|
-
break;
|
|
120572
|
-
|
|
120573
|
-
case "minus":
|
|
120574
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120575
|
-
visitor.visitMinusKCLangNode(node);
|
|
120576
|
-
break;
|
|
120577
|
-
|
|
120578
|
-
case "not":
|
|
120579
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120580
|
-
visitor.visitNotKCLangNode(node);
|
|
120581
|
-
break;
|
|
120582
|
-
|
|
120583
|
-
case "round":
|
|
120584
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120585
|
-
visitor.visitRoundKCLangNode(node);
|
|
120586
|
-
break;
|
|
120587
|
-
|
|
120588
|
-
case "choose":
|
|
120589
|
-
traverseKCLangExpression(node.if, visitor);
|
|
120590
|
-
traverseKCLangExpression(node.else, visitor);
|
|
120591
|
-
traverseKCLangExpression(node.then, visitor);
|
|
120592
|
-
visitor.visitChooseKCLangNode(node);
|
|
120593
|
-
break;
|
|
120594
|
-
|
|
120595
|
-
case "const":
|
|
120596
|
-
visitor.visitConstKCLangNode(node);
|
|
120597
|
-
break;
|
|
120598
|
-
|
|
120599
|
-
case "argument":
|
|
120600
|
-
visitor.visitArgumentKCLangNode(node);
|
|
120601
|
-
break;
|
|
120602
|
-
|
|
120603
|
-
case "or":
|
|
120604
|
-
for (const expression of node.expressions) {
|
|
120605
|
-
traverseKCLangExpression(expression, visitor);
|
|
120606
|
-
}
|
|
120607
|
-
|
|
120608
|
-
visitor.visitOrKCLangNode(node);
|
|
120609
|
-
break;
|
|
120610
|
-
|
|
120611
|
-
case "multySum":
|
|
120612
|
-
visitor.visitMultySumKCLangNode(node);
|
|
120613
|
-
break;
|
|
120614
|
-
|
|
120615
|
-
case "substring":
|
|
120616
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120617
|
-
visitor.visitSubstringKCLangNode(node);
|
|
120618
|
-
break;
|
|
120619
|
-
|
|
120620
|
-
case "regexMatch":
|
|
120621
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120622
|
-
visitor.visitRegexMatchKCLangNode(node);
|
|
120623
|
-
break;
|
|
120624
|
-
|
|
120625
|
-
default:
|
|
120626
|
-
(0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(node);
|
|
120627
|
-
break;
|
|
120628
|
-
}
|
|
120629
|
-
}
|
|
120630
|
-
class DefaultKCLangExpressionVisitor {
|
|
120631
|
-
visitAbsKCLangNode(node) {// default empty implementation
|
|
120632
|
-
}
|
|
120633
|
-
|
|
120634
|
-
visitAndKCLangNode(node) {// default empty implementation
|
|
120635
|
-
}
|
|
120636
|
-
|
|
120637
|
-
visitArgumentKCLangNode(node) {// default empty implementation
|
|
120638
|
-
}
|
|
120639
|
-
|
|
120640
|
-
visitCastExpressionKCLangNode(node) {// default empty implementation
|
|
120641
|
-
}
|
|
120642
|
-
|
|
120643
|
-
visitChooseKCLangNode(node) {// default empty implementation
|
|
120644
|
-
}
|
|
120645
|
-
|
|
120646
|
-
visitComparisonKCLangNode(node) {// default empty implementation
|
|
120647
|
-
}
|
|
120648
|
-
|
|
120649
|
-
visitConstKCLangNode(node) {// default empty implementation
|
|
120650
|
-
}
|
|
120651
|
-
|
|
120652
|
-
visitExistsKCLangNode(node) {// default empty implementation
|
|
120653
|
-
}
|
|
120654
|
-
|
|
120655
|
-
visitLengthKCLangNode(node) {// default empty implementation
|
|
120656
|
-
}
|
|
120657
|
-
|
|
120658
|
-
visitMinusKCLangNode(node) {// default empty implementation
|
|
120659
|
-
}
|
|
120660
|
-
|
|
120661
|
-
visitMultiplyKCLangNode(node) {// default empty implementation
|
|
120662
|
-
}
|
|
120663
|
-
|
|
120664
|
-
visitMultySumKCLangNode(node) {// default empty implementation
|
|
120665
|
-
}
|
|
120666
|
-
|
|
120667
|
-
visitNotKCLangNode(node) {// default empty implementation
|
|
120668
|
-
}
|
|
120669
|
-
|
|
120670
|
-
visitOneOfExpressionKCLangNode(node) {// default empty implementation
|
|
120671
|
-
}
|
|
120672
|
-
|
|
120673
|
-
visitOrKCLangNode(node) {// default empty implementation
|
|
120674
|
-
}
|
|
120675
|
-
|
|
120676
|
-
visitRegexMatchKCLangNode(node) {// default empty implementation
|
|
120677
|
-
}
|
|
120678
|
-
|
|
120679
|
-
visitRoundKCLangNode(node) {// default empty implementation
|
|
120680
|
-
}
|
|
120681
|
-
|
|
120682
|
-
visitSubstringKCLangNode(node) {// default empty implementation
|
|
120683
|
-
}
|
|
120684
|
-
|
|
120685
|
-
visitSumKCLangNode(node) {// default empty implementation
|
|
120686
|
-
}
|
|
120687
|
-
|
|
120688
|
-
visitXAbsKCLangNode(node) {// default empty implementation
|
|
120689
|
-
}
|
|
120690
|
-
|
|
120691
|
-
}
|
|
120692
|
-
|
|
120693
|
-
/***/ }),
|
|
120694
|
-
|
|
120695
|
-
/***/ "./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts":
|
|
120696
|
-
/*!*****************************************************************!*\
|
|
120697
|
-
!*** ./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts ***!
|
|
120698
|
-
\*****************************************************************/
|
|
120699
|
-
/***/ ((module) => {
|
|
120700
|
-
|
|
120701
|
-
// this file was prevaled
|
|
120702
|
-
|
|
120703
|
-
/* eslint-disable */
|
|
120704
|
-
// @ts-ignore
|
|
120705
|
-
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) {\r\n \treturn items.filter(x => x !== \"\");\r\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) {\r\n return {\r\n \ttype: \"link\",\r\n text: text,\r\n src: src,\r\n }\r\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) {\r\n return items.filter(x => x !== \"\");\r\n },\n peg$c14 = /^[^)]/,\n peg$c15 = peg$classExpectation([\")\"], true, false),\n peg$c16 = function(w) {\r\n \treturn w.join(\"\").trim()\r\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() {\r\n \treturn \"\\n\"\r\n },\n peg$c22 = /^[^ \\t\\n\\r]/,\n peg$c23 = peg$classExpectation([\" \", \"\\t\", \"\\n\", \"\\r\"], true, false),\n peg$c24 = function(w) {\r\n \treturn w.join(\"\");\r\n },\n peg$c25 = function() {\r\n \treturn \"\";\r\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})()";
|
|
120706
|
-
|
|
120707
|
-
/***/ }),
|
|
120708
|
-
|
|
120709
|
-
/***/ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts":
|
|
120710
|
-
/*!****************************************************************!*\
|
|
120711
|
-
!*** ./Generator/src/common/KCLang/KCLangDescriptionParser.ts ***!
|
|
120712
|
-
\****************************************************************/
|
|
120713
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
120714
|
-
|
|
120715
|
-
"use strict";
|
|
120716
|
-
__webpack_require__.r(__webpack_exports__);
|
|
120717
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
120718
|
-
/* harmony export */ "KCLangDescriptionParser": () => (/* binding */ KCLangDescriptionParser)
|
|
120719
|
-
/* harmony export */ });
|
|
120720
|
-
/* harmony import */ var _KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KCLangDescriptionGrammar */ "./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts");
|
|
120721
|
-
/* harmony import */ var _KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0__);
|
|
120722
|
-
// @ts-ignore
|
|
120723
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
120724
|
-
|
|
120725
|
-
const evalParse = eval((_KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0___default())).parse;
|
|
120726
|
-
class KCLangDescriptionParser {
|
|
120727
|
-
static getOrCreateParser() {
|
|
120728
|
-
return evalParse;
|
|
120729
|
-
}
|
|
120730
|
-
|
|
120731
|
-
static parse(code) {
|
|
120732
|
-
const parser = this.getOrCreateParser();
|
|
120733
|
-
return parser(code);
|
|
120734
|
-
}
|
|
120735
|
-
|
|
120736
|
-
}
|
|
120737
|
-
|
|
120738
|
-
/***/ }),
|
|
120739
|
-
|
|
120740
|
-
/***/ "./Generator/src/common/KCLang/KCLangNodes.ts":
|
|
120741
|
-
/*!****************************************************!*\
|
|
120742
|
-
!*** ./Generator/src/common/KCLang/KCLangNodes.ts ***!
|
|
120743
|
-
\****************************************************/
|
|
120744
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
120745
|
-
|
|
120746
|
-
"use strict";
|
|
120747
|
-
__webpack_require__.r(__webpack_exports__);
|
|
120748
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
120749
|
-
/* harmony export */ "isFormulaStatement": () => (/* binding */ isFormulaStatement),
|
|
120750
|
-
/* harmony export */ "isBlockStatement": () => (/* binding */ isBlockStatement),
|
|
120751
|
-
/* harmony export */ "isEnsureStatement": () => (/* binding */ isEnsureStatement),
|
|
120752
|
-
/* harmony export */ "isConditionalStatement": () => (/* binding */ isConditionalStatement),
|
|
120753
|
-
/* harmony export */ "isDescribeStatement": () => (/* binding */ isDescribeStatement),
|
|
120754
|
-
/* harmony export */ "andKCLangNode": () => (/* binding */ andKCLangNode)
|
|
120755
|
-
/* harmony export */ });
|
|
120756
|
-
function isFormulaStatement(node) {
|
|
120757
|
-
return node.type === "formula";
|
|
120758
|
-
}
|
|
120759
|
-
function isBlockStatement(node) {
|
|
120760
|
-
return node.type === "block";
|
|
120761
|
-
}
|
|
120762
|
-
function isEnsureStatement(node) {
|
|
120763
|
-
return node.type === "ensure";
|
|
120764
|
-
}
|
|
120765
|
-
function isConditionalStatement(node) {
|
|
120766
|
-
return node.type === "if";
|
|
120767
|
-
}
|
|
120768
|
-
function isDescribeStatement(node) {
|
|
120769
|
-
return node.type === "describe";
|
|
120770
|
-
}
|
|
120771
|
-
function andKCLangNode(...expressions) {
|
|
120772
|
-
return {
|
|
120773
|
-
type: "and",
|
|
120774
|
-
expressions: expressions
|
|
120775
|
-
};
|
|
120776
|
-
}
|
|
120777
|
-
|
|
120778
|
-
/***/ }),
|
|
120779
|
-
|
|
120780
120518
|
/***/ "./Generator/src/common/KCLang/KCLangToJsTranspiler.ts":
|
|
120781
120519
|
/*!*************************************************************!*\
|
|
120782
120520
|
!*** ./Generator/src/common/KCLang/KCLangToJsTranspiler.ts ***!
|
|
@@ -121074,345 +120812,6 @@ class KCLangToJsTranspiler {
|
|
|
121074
120812
|
|
|
121075
120813
|
/***/ }),
|
|
121076
120814
|
|
|
121077
|
-
/***/ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts":
|
|
121078
|
-
/*!**************************************************************!*\
|
|
121079
|
-
!*** ./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts ***!
|
|
121080
|
-
\**************************************************************/
|
|
121081
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
121082
|
-
|
|
121083
|
-
"use strict";
|
|
121084
|
-
__webpack_require__.r(__webpack_exports__);
|
|
121085
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
121086
|
-
/* harmony export */ "KCLangToXmlTranspiler": () => (/* binding */ KCLangToXmlTranspiler),
|
|
121087
|
-
/* harmony export */ "kclang": () => (/* binding */ kclang)
|
|
121088
|
-
/* harmony export */ });
|
|
121089
|
-
/* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
|
|
121090
|
-
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
121091
|
-
/* harmony import */ var _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IKCLangExpressionVisitor */ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts");
|
|
121092
|
-
/* harmony import */ var _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./KCLangDescriptionParser */ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts");
|
|
121093
|
-
/* harmony import */ var _KCLangNodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./KCLangNodes */ "./Generator/src/common/KCLang/KCLangNodes.ts");
|
|
121094
|
-
/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Utils */ "./Generator/src/common/KCLang/Utils.ts");
|
|
121095
|
-
/* harmony import */ var _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Antlr/KCLangAntlrParser */ "./Generator/src/common/KCLang/Antlr/KCLangAntlrParser.ts");
|
|
121096
|
-
|
|
121097
|
-
|
|
121098
|
-
|
|
121099
|
-
|
|
121100
|
-
|
|
121101
|
-
|
|
121102
|
-
// tslint:disable-next-line:cyclomatic-complexity
|
|
121103
|
-
|
|
121104
|
-
function generateKCXmlExpression(expression) {
|
|
121105
|
-
switch (expression.type) {
|
|
121106
|
-
case "abs":
|
|
121107
|
-
case "xabs":
|
|
121108
|
-
case "length":
|
|
121109
|
-
return [`<m:${expression.type}>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:${expression.type}>`].join("\n");
|
|
121110
|
-
|
|
121111
|
-
case "exists":
|
|
121112
|
-
case "multySum":
|
|
121113
|
-
return `<m:${expression.type} select="${expression.select}" />`;
|
|
121114
|
-
|
|
121115
|
-
case "cast":
|
|
121116
|
-
if (expression.expression.type === "argument") {
|
|
121117
|
-
return `<m:argument select="${expression.expression.select}" type="${expression.targetType}" />`;
|
|
121118
|
-
}
|
|
121119
|
-
|
|
121120
|
-
throw new Error("Cast supports only for argument");
|
|
121121
|
-
|
|
121122
|
-
case "and":
|
|
121123
|
-
case "or":
|
|
121124
|
-
return [`<m:${expression.type}>`, ...expression.expressions.map(generateKCXmlExpression).map(x => (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(x, 1)), `</m:${expression.type}>`].join("\n");
|
|
121125
|
-
|
|
121126
|
-
case "sum":
|
|
121127
|
-
return [`<m:sum>`, ...expression.operands.map(operand => {
|
|
121128
|
-
if (operand.operator === "+") {
|
|
121129
|
-
return generateKCXmlExpression(operand.expression);
|
|
121130
|
-
}
|
|
121131
|
-
|
|
121132
|
-
return [`<m:minus>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(operand.expression), 1), `</m:minus>`].join("\n");
|
|
121133
|
-
}).map(x => (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(x, 1)), `</m:sum>`].join("\n");
|
|
121134
|
-
|
|
121135
|
-
case "gt":
|
|
121136
|
-
case "ge":
|
|
121137
|
-
case "lt":
|
|
121138
|
-
case "le":
|
|
121139
|
-
case "eq":
|
|
121140
|
-
case "multiply":
|
|
121141
|
-
case "division":
|
|
121142
|
-
return [`<m:${expression.type}>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[0]), 1), (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[1]), 1), `</m:${expression.type}>`].join("\n");
|
|
121143
|
-
|
|
121144
|
-
case "noteq":
|
|
121145
|
-
return [`<m:not>`, ` <m:eq>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[0]), 2), (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[1]), 2), ` </m:eq>`, `</m:not>`].join("\n");
|
|
121146
|
-
|
|
121147
|
-
case "minus":
|
|
121148
|
-
case "not":
|
|
121149
|
-
return [`<m:${expression.type}>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:${expression.type}>`].join("\n");
|
|
121150
|
-
break;
|
|
121151
|
-
break;
|
|
121152
|
-
|
|
121153
|
-
case "round":
|
|
121154
|
-
return [expression.fractionalDigits != undefined ? `<m:round fractionalDigits="${expression.fractionalDigits}">` : `<m:round>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:round>`].join("\n");
|
|
121155
|
-
|
|
121156
|
-
case "substring":
|
|
121157
|
-
return [expression.length != undefined ? `<m:substring start="${expression.start}" length="${expression.length}">` : `<m:substring start="${expression.start}">`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:substring>`].join("\n");
|
|
121158
|
-
|
|
121159
|
-
case "regexMatch":
|
|
121160
|
-
return [`<m:regexMatch pattern="${expression.pattern}">`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:regexMatch>`].join("\n");
|
|
121161
|
-
|
|
121162
|
-
case "choose":
|
|
121163
|
-
return [`<m:choose>`, ` <m:if>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.if), 2), ` </m:if>`, ` <m:then>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.then), 2), ` </m:then>`, ` <m:else>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.else), 2), ` </m:else>`, `</m:choose>`].join("\n");
|
|
121164
|
-
break;
|
|
121165
|
-
|
|
121166
|
-
case "const":
|
|
121167
|
-
if (expression.value.type === "decimal") {
|
|
121168
|
-
return `<m:const value="${expression.value.value}" type="decimal" />`;
|
|
121169
|
-
}
|
|
121170
|
-
|
|
121171
|
-
if (expression.value.type === "string") {
|
|
121172
|
-
return `<m:const value="${expression.value.value}" type="string" />`;
|
|
121173
|
-
}
|
|
121174
|
-
|
|
121175
|
-
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_0__.NotImplementedError();
|
|
121176
|
-
|
|
121177
|
-
case "argument":
|
|
121178
|
-
return `<m:argument select="${expression.select}" />`;
|
|
121179
|
-
|
|
121180
|
-
case "oneof":
|
|
121181
|
-
{
|
|
121182
|
-
const testExpr = generateKCXmlExpression(expression.testExpression);
|
|
121183
|
-
return [`<m:or>`, ...expression.expressions.items.map(x => [`<m:eq>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(testExpr, 1), (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(x), 1), `</m:eq>`]).flat().map(x => (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(x, 1)), `</m:or>`].join("\n");
|
|
121184
|
-
}
|
|
121185
|
-
|
|
121186
|
-
default:
|
|
121187
|
-
// @ts-ignore
|
|
121188
|
-
throw new Error(`Expression of type '${expression.type}' is not supported`);
|
|
121189
|
-
}
|
|
121190
|
-
}
|
|
121191
|
-
|
|
121192
|
-
function formatDescribeStatement(ast, matchPath, describe) {
|
|
121193
|
-
return _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_3__.KCLangDescriptionParser.parse(describe.text).map(item => {
|
|
121194
|
-
if (typeof item === "string") {
|
|
121195
|
-
return item;
|
|
121196
|
-
} else {
|
|
121197
|
-
return `{{link ref=${item.src}}}${item.text.join(" ")}{{/link}}`;
|
|
121198
|
-
}
|
|
121199
|
-
}).join(" ");
|
|
121200
|
-
}
|
|
121201
|
-
|
|
121202
|
-
function generateKCXmlFormula(ast, matchPath, describe) {
|
|
121203
|
-
const descriptionAttr = describe != undefined ? ` description="${formatDescribeStatement(ast, matchPath, describe)}"` : "";
|
|
121204
|
-
return `<m:formula match="${matchPath}" target="${ast.target}"${descriptionAttr}>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(ast.expression), 1) + "\n" + `</m:formula>`;
|
|
121205
|
-
}
|
|
121206
|
-
|
|
121207
|
-
function removeTrailingSlash(inputStr) {
|
|
121208
|
-
if (inputStr.endsWith("/")) {
|
|
121209
|
-
return inputStr.substring(0, inputStr.length - 1);
|
|
121210
|
-
}
|
|
121211
|
-
|
|
121212
|
-
return inputStr;
|
|
121213
|
-
}
|
|
121214
|
-
|
|
121215
|
-
function joinPaths(paths) {
|
|
121216
|
-
return paths.map(removeTrailingSlash).join("/");
|
|
121217
|
-
}
|
|
121218
|
-
|
|
121219
|
-
function generateBlockKCXmlFormulas(block, parents) {
|
|
121220
|
-
const matchPath = joinPaths([...(parents !== null && parents !== void 0 ? parents : []).map(x => x.path), block.path]);
|
|
121221
|
-
const result = [];
|
|
121222
|
-
let lastDescribeStatement;
|
|
121223
|
-
|
|
121224
|
-
for (const statement of block.statements) {
|
|
121225
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isFormulaStatement)(statement)) {
|
|
121226
|
-
result.push(generateKCXmlFormula(statement, matchPath, lastDescribeStatement));
|
|
121227
|
-
lastDescribeStatement = undefined;
|
|
121228
|
-
}
|
|
121229
|
-
|
|
121230
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isEnsureStatement)(statement)) {
|
|
121231
|
-
lastDescribeStatement = undefined;
|
|
121232
|
-
}
|
|
121233
|
-
|
|
121234
|
-
if (lastDescribeStatement != undefined) {
|
|
121235
|
-
throw new Error("Describe should be placed before assign of ensure statements");
|
|
121236
|
-
}
|
|
121237
|
-
|
|
121238
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isDescribeStatement)(statement)) {
|
|
121239
|
-
lastDescribeStatement = statement;
|
|
121240
|
-
}
|
|
121241
|
-
|
|
121242
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isBlockStatement)(statement)) {
|
|
121243
|
-
result.push(generateBlockKCXmlFormulas(statement, [...(parents !== null && parents !== void 0 ? parents : []), block]));
|
|
121244
|
-
}
|
|
121245
|
-
}
|
|
121246
|
-
|
|
121247
|
-
return result.join("\n");
|
|
121248
|
-
}
|
|
121249
|
-
|
|
121250
|
-
function guessConditionTarget(condition) {
|
|
121251
|
-
let result;
|
|
121252
|
-
|
|
121253
|
-
class GuessConditionTargetVisitor extends _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_2__.DefaultKCLangExpressionVisitor {
|
|
121254
|
-
visitExistsKCLangNode(node) {
|
|
121255
|
-
if (result == undefined) {
|
|
121256
|
-
result = node.select;
|
|
121257
|
-
}
|
|
121258
|
-
}
|
|
121259
|
-
|
|
121260
|
-
visitArgumentKCLangNode(node) {
|
|
121261
|
-
if (result == undefined) {
|
|
121262
|
-
result = node.select;
|
|
121263
|
-
}
|
|
121264
|
-
}
|
|
121265
|
-
|
|
121266
|
-
}
|
|
121267
|
-
|
|
121268
|
-
(0,_IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_2__.traverseKCLangExpression)(condition.expression, new GuessConditionTargetVisitor());
|
|
121269
|
-
return result;
|
|
121270
|
-
}
|
|
121271
|
-
|
|
121272
|
-
function generateKCXmlCondition(ast, matchPath, parentConditions, describe) {
|
|
121273
|
-
const levelAttr = ast.level === "error" ? ` errorLevel="Error"` : "";
|
|
121274
|
-
const descriptionAttr = describe != undefined ? ` description="${formatDescribeStatement(ast, matchPath, describe)}"` : "";
|
|
121275
|
-
const guessedTarget = guessConditionTarget(ast);
|
|
121276
|
-
const targetAttr = guessedTarget != undefined ? ` target="${guessedTarget}"` : "";
|
|
121277
|
-
|
|
121278
|
-
if (parentConditions != undefined && (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.arrayIsNotEmpty)(parentConditions)) {
|
|
121279
|
-
var _parentConditions$map;
|
|
121280
|
-
|
|
121281
|
-
const condition = parentConditions.length === 1 ? parentConditions[0].condition : (0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.andKCLangNode)(...((_parentConditions$map = parentConditions === null || parentConditions === void 0 ? void 0 : parentConditions.map(z => z.condition)) !== null && _parentConditions$map !== void 0 ? _parentConditions$map : []));
|
|
121282
|
-
return `<m:condition match="${matchPath}"${descriptionAttr}${levelAttr}${targetAttr}>\n` + ` <m:when>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(condition), 2) + "\n" + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(ast.expression), 2) + "\n" + ` </m:when>\n` + `</m:condition>`;
|
|
121283
|
-
}
|
|
121284
|
-
|
|
121285
|
-
return `<m:condition match="${matchPath}"${descriptionAttr}${levelAttr}${targetAttr}>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(ast.expression), 1) + "\n" + `</m:condition>`;
|
|
121286
|
-
}
|
|
121287
|
-
|
|
121288
|
-
function generateBlockKCXmlConditions(block, parents, parentConditions) {
|
|
121289
|
-
const matchPath = joinPaths([...(parents !== null && parents !== void 0 ? parents : []).map(x => x.path), block.path]);
|
|
121290
|
-
const result = [];
|
|
121291
|
-
let lastDescribeStatement;
|
|
121292
|
-
|
|
121293
|
-
for (const statement of block.statements) {
|
|
121294
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isFormulaStatement)(statement)) {
|
|
121295
|
-
lastDescribeStatement = undefined;
|
|
121296
|
-
}
|
|
121297
|
-
|
|
121298
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isEnsureStatement)(statement)) {
|
|
121299
|
-
result.push(generateKCXmlCondition(statement, matchPath, parentConditions, lastDescribeStatement));
|
|
121300
|
-
lastDescribeStatement = undefined;
|
|
121301
|
-
}
|
|
121302
|
-
|
|
121303
|
-
if (lastDescribeStatement != undefined) {
|
|
121304
|
-
throw new Error("Describe should be placed before assign of ensure statements");
|
|
121305
|
-
}
|
|
121306
|
-
|
|
121307
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isDescribeStatement)(statement)) {
|
|
121308
|
-
lastDescribeStatement = statement;
|
|
121309
|
-
}
|
|
121310
|
-
|
|
121311
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isConditionalStatement)(statement)) {
|
|
121312
|
-
result.push(generateConditionalConditions(statement, [...(parents !== null && parents !== void 0 ? parents : []), block], parentConditions));
|
|
121313
|
-
}
|
|
121314
|
-
|
|
121315
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isBlockStatement)(statement)) {
|
|
121316
|
-
result.push(generateBlockKCXmlConditions(statement, [...(parents !== null && parents !== void 0 ? parents : []), block], parentConditions));
|
|
121317
|
-
}
|
|
121318
|
-
}
|
|
121319
|
-
|
|
121320
|
-
return result.join("\n");
|
|
121321
|
-
}
|
|
121322
|
-
|
|
121323
|
-
function generateConditionalConditions(conditionalStatement, parents, parentConditions) {
|
|
121324
|
-
const matchPath = joinPaths([...(parents !== null && parents !== void 0 ? parents : []).map(x => x.path)]);
|
|
121325
|
-
const result = [];
|
|
121326
|
-
let lastDescribeStatement;
|
|
121327
|
-
|
|
121328
|
-
for (const x of conditionalStatement.statements) {
|
|
121329
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isEnsureStatement)(x)) {
|
|
121330
|
-
result.push(generateKCXmlCondition(x, matchPath, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement], lastDescribeStatement));
|
|
121331
|
-
lastDescribeStatement = undefined;
|
|
121332
|
-
}
|
|
121333
|
-
|
|
121334
|
-
if (lastDescribeStatement != undefined) {
|
|
121335
|
-
throw new Error("Describe should be placed before assign of ensure statements");
|
|
121336
|
-
}
|
|
121337
|
-
|
|
121338
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isDescribeStatement)(x)) {
|
|
121339
|
-
lastDescribeStatement = x;
|
|
121340
|
-
}
|
|
121341
|
-
|
|
121342
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isConditionalStatement)(x)) {
|
|
121343
|
-
result.push(generateConditionalConditions(x, parents, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement]));
|
|
121344
|
-
}
|
|
121345
|
-
|
|
121346
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isBlockStatement)(x)) {
|
|
121347
|
-
result.push(generateBlockKCXmlConditions(x, parents, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement]));
|
|
121348
|
-
}
|
|
121349
|
-
}
|
|
121350
|
-
|
|
121351
|
-
return result.join("\n");
|
|
121352
|
-
}
|
|
121353
|
-
|
|
121354
|
-
function generateKCXmlFormulas(blocks) {
|
|
121355
|
-
const formulas = Iterator.from(blocks).map(generateBlockKCXmlFormulas).toArray();
|
|
121356
|
-
|
|
121357
|
-
if (formulas.filter(x => x !== "").length > 0) {
|
|
121358
|
-
return `<m:formulas>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(formulas.join("\n"), 1) + "\n" + `</m:formulas>\n`;
|
|
121359
|
-
} else {
|
|
121360
|
-
return "";
|
|
121361
|
-
}
|
|
121362
|
-
}
|
|
121363
|
-
|
|
121364
|
-
function generateKCXmlConditions(blocks) {
|
|
121365
|
-
const conditions = Iterator.from(blocks).map(generateBlockKCXmlConditions).toArray();
|
|
121366
|
-
|
|
121367
|
-
if (conditions.filter(x => x !== "").length > 0) {
|
|
121368
|
-
return `<m:conditions>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(conditions.join("\n"), 1) + "\n" + `</m:conditions>\n`;
|
|
121369
|
-
} else {
|
|
121370
|
-
return "";
|
|
121371
|
-
}
|
|
121372
|
-
}
|
|
121373
|
-
|
|
121374
|
-
function generateKCXml(blocks) {
|
|
121375
|
-
return `<?xml version="1.0" encoding="utf-8"?>\n` + `<m:math xmlns:m="http://www.kontur-extern.ru/ФНС 4.0/math.xsd">\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlFormulas(blocks), 1) + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlConditions(blocks), 1) + `</m:math>`;
|
|
121376
|
-
}
|
|
121377
|
-
|
|
121378
|
-
class KCLangToXmlTranspiler {
|
|
121379
|
-
static transpile(kcLang, customParser) {
|
|
121380
|
-
const parser = customParser !== null && customParser !== void 0 ? customParser : _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_6__.KCLangAntlrParser.parse;
|
|
121381
|
-
const kcxml = generateKCXml(parser(kcLang).blocks);
|
|
121382
|
-
return kcxml;
|
|
121383
|
-
}
|
|
121384
|
-
|
|
121385
|
-
}
|
|
121386
|
-
function kclang(str) {
|
|
121387
|
-
return KCLangToXmlTranspiler.transpile(str.join(""));
|
|
121388
|
-
}
|
|
121389
|
-
|
|
121390
|
-
/***/ }),
|
|
121391
|
-
|
|
121392
|
-
/***/ "./Generator/src/common/KCLang/Utils.ts":
|
|
121393
|
-
/*!**********************************************!*\
|
|
121394
|
-
!*** ./Generator/src/common/KCLang/Utils.ts ***!
|
|
121395
|
-
\**********************************************/
|
|
121396
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
121397
|
-
|
|
121398
|
-
"use strict";
|
|
121399
|
-
__webpack_require__.r(__webpack_exports__);
|
|
121400
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
121401
|
-
/* harmony export */ "indent": () => (/* binding */ indent)
|
|
121402
|
-
/* harmony export */ });
|
|
121403
|
-
function indent(str, count) {
|
|
121404
|
-
const indentStr = new Array(count * 2).fill(" ").join("");
|
|
121405
|
-
return str.split("\n").map(x => {
|
|
121406
|
-
if (x === "") {
|
|
121407
|
-
return x;
|
|
121408
|
-
}
|
|
121409
|
-
|
|
121410
|
-
return indentStr + x;
|
|
121411
|
-
}).join("\n");
|
|
121412
|
-
}
|
|
121413
|
-
|
|
121414
|
-
/***/ }),
|
|
121415
|
-
|
|
121416
120815
|
/***/ "./Generator/src/common/RequireContext/LoadDocumentationFileFormContext.ts":
|
|
121417
120816
|
/*!*********************************************************************************!*\
|
|
121418
120817
|
!*** ./Generator/src/common/RequireContext/LoadDocumentationFileFormContext.ts ***!
|
|
@@ -124949,6 +124348,7 @@ function normalizeToArray(value) {
|
|
|
124949
124348
|
"use strict";
|
|
124950
124349
|
__webpack_require__.r(__webpack_exports__);
|
|
124951
124350
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
124351
|
+
/* harmony export */ "getNodeSource": () => (/* binding */ getNodeSource),
|
|
124952
124352
|
/* harmony export */ "XmlNode": () => (/* binding */ XmlNode),
|
|
124953
124353
|
/* harmony export */ "ASTNode": () => (/* binding */ ASTNode),
|
|
124954
124354
|
/* harmony export */ "SugarReadingError": () => (/* binding */ SugarReadingError),
|
|
@@ -124961,6 +124361,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
124961
124361
|
|
|
124962
124362
|
|
|
124963
124363
|
|
|
124364
|
+
function getNodeSource(node) {
|
|
124365
|
+
if (node.source == undefined) {
|
|
124366
|
+
return "N/A";
|
|
124367
|
+
}
|
|
124368
|
+
|
|
124369
|
+
try {
|
|
124370
|
+
const sourceLines = node.source.sourceText.split("\n");
|
|
124371
|
+
return sourceLines.slice(node.source.location.start.line - 1, node.source.location.end.line).join("\n");
|
|
124372
|
+
} catch {
|
|
124373
|
+
return "N/A";
|
|
124374
|
+
}
|
|
124375
|
+
}
|
|
124964
124376
|
class XmlNode {
|
|
124965
124377
|
constructor(createParams) {
|
|
124966
124378
|
var _createParams$parent, _createParams$attribu, _createParams$childre;
|
|
@@ -126806,7 +126218,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
126806
126218
|
|
|
126807
126219
|
|
|
126808
126220
|
class FormulasAutoCalculationsGenerator {
|
|
126809
|
-
generate(
|
|
126221
|
+
generate(formulaContainer, schemaRng, dataDeclarationHelper) {
|
|
126222
|
+
const formulas = formulaContainer.formulas == undefined || formulaContainer.formulas.items == undefined ? [] : formulaContainer.formulas.items;
|
|
126810
126223
|
const formulaAutoCalculations = formulas.map(formula => this.buildFormulaAutoCalculation(formula, schemaRng, dataDeclarationHelper)).flat();
|
|
126811
126224
|
return this.mergeFormulaAutoCalculations(formulaAutoCalculations);
|
|
126812
126225
|
}
|
|
@@ -127536,73 +126949,35 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
127536
126949
|
/* harmony export */ });
|
|
127537
126950
|
/* harmony import */ var _common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../common/XmlParser/XmlParser */ "./Generator/src/common/XmlParser/XmlParser.ts");
|
|
127538
126951
|
/* harmony import */ var _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../markupGenerator/Serializer/SugarSerializer */ "./Generator/src/generators/markupGenerator/Serializer/SugarSerializer.ts");
|
|
127539
|
-
/* harmony import */ var
|
|
127540
|
-
/* harmony import */ var _Formula__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
|
|
127541
|
-
|
|
126952
|
+
/* harmony import */ var _Formula__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
|
|
127542
126953
|
|
|
127543
126954
|
|
|
127544
126955
|
|
|
127545
126956
|
class FormulaReader {
|
|
127546
|
-
readFormulas(
|
|
126957
|
+
readFormulas(kcxmlSource) {
|
|
127547
126958
|
const serializer = this.createFormulaSerializer();
|
|
127548
|
-
const result =
|
|
127549
|
-
|
|
127550
|
-
for (const kcxmlSource of kcxmlSources) {
|
|
127551
|
-
const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(kcxmlSource));
|
|
126959
|
+
const result = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(kcxmlSource));
|
|
127552
126960
|
|
|
127553
|
-
|
|
127554
|
-
|
|
127555
|
-
|
|
127556
|
-
result.push(...((_rootNode$formulas$it = (_rootNode$formulas = rootNode.formulas) === null || _rootNode$formulas === void 0 ? void 0 : _rootNode$formulas.items) !== null && _rootNode$formulas$it !== void 0 ? _rootNode$formulas$it : []));
|
|
127557
|
-
}
|
|
127558
|
-
}
|
|
127559
|
-
|
|
127560
|
-
for (const kclangSource of kclangSources) {
|
|
127561
|
-
const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(_common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_2__.KCLangToXmlTranspiler.transpile(kclangSource)));
|
|
127562
|
-
|
|
127563
|
-
if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
|
|
127564
|
-
var _rootNode$formulas$it2, _rootNode$formulas2;
|
|
127565
|
-
|
|
127566
|
-
result.push(...((_rootNode$formulas$it2 = (_rootNode$formulas2 = rootNode.formulas) === null || _rootNode$formulas2 === void 0 ? void 0 : _rootNode$formulas2.items) !== null && _rootNode$formulas$it2 !== void 0 ? _rootNode$formulas$it2 : []));
|
|
127567
|
-
}
|
|
126961
|
+
if (result instanceof _Formula__WEBPACK_IMPORTED_MODULE_2__.DummyContent) {
|
|
126962
|
+
return this.createEmptyMathContainer();
|
|
127568
126963
|
}
|
|
127569
126964
|
|
|
127570
126965
|
return result;
|
|
127571
126966
|
}
|
|
127572
126967
|
|
|
127573
|
-
|
|
127574
|
-
const
|
|
127575
|
-
|
|
127576
|
-
|
|
127577
|
-
|
|
127578
|
-
const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(kcxmlSource));
|
|
127579
|
-
|
|
127580
|
-
if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
|
|
127581
|
-
var _rootNode$conditions$, _rootNode$conditions;
|
|
127582
|
-
|
|
127583
|
-
result.push(...((_rootNode$conditions$ = (_rootNode$conditions = rootNode.conditions) === null || _rootNode$conditions === void 0 ? void 0 : _rootNode$conditions.items) !== null && _rootNode$conditions$ !== void 0 ? _rootNode$conditions$ : []));
|
|
127584
|
-
}
|
|
127585
|
-
}
|
|
127586
|
-
|
|
127587
|
-
for (const kclangSource of kclangSources) {
|
|
127588
|
-
const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(_common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_2__.KCLangToXmlTranspiler.transpile(kclangSource)));
|
|
127589
|
-
|
|
127590
|
-
if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
|
|
127591
|
-
var _rootNode$conditions$2, _rootNode$conditions2;
|
|
127592
|
-
|
|
127593
|
-
result.push(...((_rootNode$conditions$2 = (_rootNode$conditions2 = rootNode.conditions) === null || _rootNode$conditions2 === void 0 ? void 0 : _rootNode$conditions2.items) !== null && _rootNode$conditions$2 !== void 0 ? _rootNode$conditions$2 : []));
|
|
127594
|
-
}
|
|
127595
|
-
}
|
|
127596
|
-
|
|
127597
|
-
return result;
|
|
126968
|
+
createEmptyMathContainer() {
|
|
126969
|
+
const mathContainer = new _Formula__WEBPACK_IMPORTED_MODULE_2__.MathContainer();
|
|
126970
|
+
mathContainer.formulas = new _Formula__WEBPACK_IMPORTED_MODULE_2__.Formulas();
|
|
126971
|
+
mathContainer.formulas.items = [];
|
|
126972
|
+
return mathContainer;
|
|
127598
126973
|
}
|
|
127599
126974
|
|
|
127600
126975
|
createFormulaSerializer() {
|
|
127601
126976
|
const result = new _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_1__.SugarSerializer();
|
|
127602
|
-
result.registerNode(
|
|
127603
|
-
result.registerNode(
|
|
126977
|
+
result.registerNode(_Formula__WEBPACK_IMPORTED_MODULE_2__.DummyContent);
|
|
126978
|
+
result.registerNode(_Formula__WEBPACK_IMPORTED_MODULE_2__.MathContainer);
|
|
127604
126979
|
|
|
127605
|
-
for (const formulaExpression of
|
|
126980
|
+
for (const formulaExpression of _Formula__WEBPACK_IMPORTED_MODULE_2__.formulaExpressions) {
|
|
127606
126981
|
result.registerNode(formulaExpression);
|
|
127607
126982
|
}
|
|
127608
126983
|
|
|
@@ -129043,26 +128418,47 @@ const gfv = '${gfv}'
|
|
|
129043
128418
|
const resourcesHash = ${JSON.stringify(resourcesHash)}
|
|
129044
128419
|
|
|
129045
128420
|
window.CF.entryPoint = window.CF.entryPoint || {};
|
|
129046
|
-
window.CF.entryPoint[gfv]
|
|
129047
|
-
const
|
|
129048
|
-
|
|
129049
|
-
|
|
129050
|
-
|
|
129051
|
-
|
|
129052
|
-
|
|
129053
|
-
|
|
129054
|
-
|
|
129055
|
-
|
|
129056
|
-
settings: {
|
|
129057
|
-
...defaultSettings,
|
|
129058
|
-
...settings,
|
|
129059
|
-
isDisabledCleanForm: defaultSettings.isDisabledCleanForm || settings.isDisabledCleanForm,
|
|
129060
|
-
isDisabledCloseButton: defaultSettings.isDisabledCloseButton || settings.isDisabledCloseButton,
|
|
129061
|
-
isDisabledCloseAndSaveButton: defaultSettings.isDisabledCloseAndSaveButton || settings.isDisabledCloseAndSaveButton,
|
|
129062
|
-
}
|
|
128421
|
+
if (window.CF.entryPoint[gfv]) {
|
|
128422
|
+
for (const instance of window.CF.entryPoint[gfv].instances) {
|
|
128423
|
+
const resources = {
|
|
128424
|
+
dataDeclaration: dataDeclaration,
|
|
128425
|
+
calculationFunctions: calculationFunctions,
|
|
128426
|
+
validationFunctions: validationFunctions,
|
|
128427
|
+
requisiteList: requisiteList,
|
|
128428
|
+
autocalculationConfigurators: [...autocalculationConfigurators, kcXmlValidationConfigurator, rngSchemaValidationConfigurator],
|
|
128429
|
+
}
|
|
128430
|
+
instance.updateFormResources(Form, resources);
|
|
129063
128431
|
}
|
|
129064
|
-
|
|
129065
|
-
}
|
|
128432
|
+
} else {
|
|
128433
|
+
window.CF.entryPoint[gfv] = async function(container, { renderForm, ...settings }) {
|
|
128434
|
+
const resources = {
|
|
128435
|
+
dataDeclaration: dataDeclaration,
|
|
128436
|
+
calculationFunctions: calculationFunctions,
|
|
128437
|
+
validationFunctions: validationFunctions,
|
|
128438
|
+
requisiteList: requisiteList,
|
|
128439
|
+
resourcesHash: resourcesHash,
|
|
128440
|
+
localizationDictionary: localizationDictionary,
|
|
128441
|
+
hooks: hooks,
|
|
128442
|
+
autocalculationConfigurators: [...autocalculationConfigurators, kcXmlValidationConfigurator, rngSchemaValidationConfigurator],
|
|
128443
|
+
settings: {
|
|
128444
|
+
...defaultSettings,
|
|
128445
|
+
...settings,
|
|
128446
|
+
isDisabledCleanForm: defaultSettings.isDisabledCleanForm || settings.isDisabledCleanForm,
|
|
128447
|
+
isDisabledCloseButton: defaultSettings.isDisabledCloseButton || settings.isDisabledCloseButton,
|
|
128448
|
+
isDisabledCloseAndSaveButton: defaultSettings.isDisabledCloseAndSaveButton || settings.isDisabledCloseAndSaveButton,
|
|
128449
|
+
}
|
|
128450
|
+
}
|
|
128451
|
+
const formInstance = await renderForm(Form, resources, container)
|
|
128452
|
+
window.CF.entryPoint[gfv].instances = window.CF.entryPoint[gfv].instances ?? [];
|
|
128453
|
+
window.CF.entryPoint[gfv].instances.push(formInstance)
|
|
128454
|
+
return formInstance;
|
|
128455
|
+
}
|
|
128456
|
+
}
|
|
128457
|
+
|
|
128458
|
+
if (module.hot) {
|
|
128459
|
+
module.hot.accept();
|
|
128460
|
+
}
|
|
128461
|
+
`;
|
|
129066
128462
|
}
|
|
129067
128463
|
|
|
129068
128464
|
/***/ }),
|
|
@@ -129212,6 +128608,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
129212
128608
|
/* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
|
|
129213
128609
|
/* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader.ts");
|
|
129214
128610
|
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
128611
|
+
/* harmony import */ var _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/XmlParser/XmlNode */ "./Generator/src/common/XmlParser/XmlNode.ts");
|
|
128612
|
+
|
|
129215
128613
|
|
|
129216
128614
|
|
|
129217
128615
|
|
|
@@ -129230,9 +128628,11 @@ class KCXmlValidationGenerator {
|
|
|
129230
128628
|
const conditionReader = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_2__.FormulaReader();
|
|
129231
128629
|
|
|
129232
128630
|
for (const file of importedKcXmlValidations) {
|
|
129233
|
-
const
|
|
128631
|
+
const math = conditionReader.readFormulas(file);
|
|
128632
|
+
|
|
128633
|
+
for (const condition of (_math$conditions$item = math === null || math === void 0 ? void 0 : (_math$conditions = math.conditions) === null || _math$conditions === void 0 ? void 0 : _math$conditions.items) !== null && _math$conditions$item !== void 0 ? _math$conditions$item : []) {
|
|
128634
|
+
var _math$conditions$item, _math$conditions;
|
|
129234
128635
|
|
|
129235
|
-
for (const condition of conditions) {
|
|
129236
128636
|
compiledConditions.push(this.compileCondition(condition));
|
|
129237
128637
|
}
|
|
129238
128638
|
}
|
|
@@ -129256,7 +128656,7 @@ class KCXmlValidationGenerator {
|
|
|
129256
128656
|
const target = prefix.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.ModelPath.createFromMask(condition.target, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each));
|
|
129257
128657
|
const deps = [];
|
|
129258
128658
|
const compiledExpression = this.compileExpression(prefix, condition.expression, deps);
|
|
129259
|
-
return `new ValidationFunction` + `(` + this.modelPathInstance(target) + `,` + `[${deps.map(x => x.toCurrentIteration()).map(x => this.modelPathInstance(x)).join(", ")}]` + `, ` + `context => KCCondition.execute(context, expression => ${compiledExpression}` + `, ` + `() => "${(_condition$descriptio = condition.description) !== null && _condition$descriptio !== void 0 ? _condition$descriptio : "Error Message"}"` + `, ` + `"${(_condition$errorLevel = condition.errorLevel) !== null && _condition$errorLevel !== void 0 ? _condition$errorLevel : "Error"}" )` + `)`;
|
|
128659
|
+
return `new ValidationFunction` + `(` + this.modelPathInstance(target) + `,` + `[${deps.map(x => x.toCurrentIteration()).map(x => this.modelPathInstance(x)).join(", ")}]` + `, ` + `context => KCCondition.execute(context, expression => ${compiledExpression}` + `, ` + `() => "${(_condition$descriptio = condition.description) !== null && _condition$descriptio !== void 0 ? _condition$descriptio : "Error Message"}"` + `, ` + `"${(_condition$errorLevel = condition.errorLevel) !== null && _condition$errorLevel !== void 0 ? _condition$errorLevel : "Error"}" )` + `, ` + JSON.stringify((0,_common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_4__.getNodeSource)(condition.sourceXmlNode)) + `)`;
|
|
129260
128660
|
}
|
|
129261
128661
|
|
|
129262
128662
|
compileExpression(prefix, expression, deps) {
|
|
@@ -129417,7 +128817,7 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
129417
128817
|
const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
|
|
129418
128818
|
const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_12__.createDefaultSugarSerializer)();
|
|
129419
128819
|
const sugarRoot = (0,_markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_13__.strictCastNode)(serializer.deserializeFromSugarXmlNode(sugarAst), _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_10__.FormNode);
|
|
129420
|
-
const formulas = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_16__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent
|
|
128820
|
+
const formulas = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_16__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent);
|
|
129421
128821
|
const schemaRng = (0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_5__.parseXml)(additionalContent.schemaRngContent);
|
|
129422
128822
|
const formSchemaRng = _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_3__.FormSchemaRng.createFromSchemaRng(additionalContent.schemaRngContent);
|
|
129423
128823
|
const typeRegistry = (0,_validationGenerator_TypesRegistry__WEBPACK_IMPORTED_MODULE_14__.buildTypesRegistry)(sugarRoot);
|
|
@@ -129547,17 +128947,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
129547
128947
|
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
|
129548
128948
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ "path");
|
|
129549
128949
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
|
129550
|
-
/* harmony import */ var
|
|
129551
|
-
/* harmony import */ var
|
|
129552
|
-
/* harmony import */ var
|
|
129553
|
-
/* harmony import */ var
|
|
129554
|
-
/* harmony import */ var
|
|
129555
|
-
/* harmony import */ var
|
|
129556
|
-
/* harmony import */ var
|
|
129557
|
-
/* harmony import */ var
|
|
129558
|
-
/* harmony import */ var
|
|
129559
|
-
/* harmony import */ var
|
|
129560
|
-
/* harmony import */ var
|
|
128950
|
+
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! util */ "util");
|
|
128951
|
+
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__);
|
|
128952
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! chalk */ "./node_modules/chalk/source/index.js");
|
|
128953
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_3__);
|
|
128954
|
+
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
|
|
128955
|
+
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_4__);
|
|
128956
|
+
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! md5 */ "./node_modules/md5/md5.js");
|
|
128957
|
+
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_5__);
|
|
128958
|
+
/* harmony import */ var md5_file__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5-file */ "./node_modules/md5-file/index.js");
|
|
128959
|
+
/* harmony import */ var md5_file__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5_file__WEBPACK_IMPORTED_MODULE_6__);
|
|
128960
|
+
/* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! recursive-readdir */ "./node_modules/recursive-readdir/index.js");
|
|
128961
|
+
/* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(recursive_readdir__WEBPACK_IMPORTED_MODULE_7__);
|
|
128962
|
+
/* harmony import */ var _common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/ExtractSugarReferences */ "./Generator/src/common/ExtractSugarReferences.ts");
|
|
129561
128963
|
|
|
129562
128964
|
|
|
129563
128965
|
|
|
@@ -129566,6 +128968,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
129566
128968
|
|
|
129567
128969
|
|
|
129568
128970
|
|
|
128971
|
+
|
|
128972
|
+
const statAsync = (0,util__WEBPACK_IMPORTED_MODULE_2__.promisify)(fs__WEBPACK_IMPORTED_MODULE_0__.stat);
|
|
128973
|
+
const readFileAsync = (0,util__WEBPACK_IMPORTED_MODULE_2__.promisify)(fs__WEBPACK_IMPORTED_MODULE_0__.readFile);
|
|
128974
|
+
const readdirAsync = (0,util__WEBPACK_IMPORTED_MODULE_2__.promisify)(fs__WEBPACK_IMPORTED_MODULE_0__.readdir);
|
|
129569
128975
|
async function readFormSources(formSourcesPath, farmDirectory) {
|
|
129570
128976
|
var _JSON$parse$settings;
|
|
129571
128977
|
|
|
@@ -129577,9 +128983,9 @@ async function readFormSources(formSourcesPath, farmDirectory) {
|
|
|
129577
128983
|
|
|
129578
128984
|
if (sugarReferences.fetchFunctionFiles.length === 0) {
|
|
129579
128985
|
// eslint-disable-next-line no-console
|
|
129580
|
-
console.warn(
|
|
128986
|
+
console.warn(chalk__WEBPACK_IMPORTED_MODULE_3___default().yellow(`[WARN] Форма не содержит ссылок на fetch-функции. Будут автоматически подключены функции из каталога legacyfetchfuctions\n` + `[WARN] В будущем необходимо явно прописывать ссылки на используемые fetch-функции`));
|
|
129581
128987
|
const legacyfetchfunctionsDirectory = path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions");
|
|
129582
|
-
sugarReferences.fetchFunctionFiles = (await (
|
|
128988
|
+
sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
|
|
129583
128989
|
}
|
|
129584
128990
|
|
|
129585
128991
|
const result = {
|
|
@@ -129589,12 +128995,11 @@ async function readFormSources(formSourcesPath, farmDirectory) {
|
|
|
129589
128995
|
formSourcesPath: formSourcesPath,
|
|
129590
128996
|
formJsonSettings: (_JSON$parse$settings = JSON.parse(await readFileSource(formSourcesPath, "form.json", "{}"))["settings"]) !== null && _JSON$parse$settings !== void 0 ? _JSON$parse$settings : {},
|
|
129591
128997
|
additionalSettings: await readFileSource(formSourcesPath, "settings.json", "{}"),
|
|
129592
|
-
autocalcsContent: await
|
|
128998
|
+
autocalcsContent: await readAutoCalcFiles(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc")),
|
|
129593
128999
|
helpersContent: await readJavaScriptFilesWithNames(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers")),
|
|
129594
129000
|
validationsContent: await readJavaScriptFilesWithNames(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations")),
|
|
129595
129001
|
schemaRngContent: await readSchemaRngFile(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"), formName),
|
|
129596
|
-
kcJsXmlContent: await
|
|
129597
|
-
kclangAutocaclulationsContent: await readFilesFromDir(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"), /\.kclang$/),
|
|
129002
|
+
kcJsXmlContent: (await readFileSource(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"), `${formName}.КС.candy.js.xml`, "<dummy/>")) || "",
|
|
129598
129003
|
tourSteps: await readFileSource(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "tour"), "tour.js", "{}"),
|
|
129599
129004
|
hooksContent: await readHooksFile(formSourcesPath),
|
|
129600
129005
|
customControlsContent: await readCustomControlsFiles(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls")),
|
|
@@ -129638,7 +129043,7 @@ function evalModule(moduleCode) {
|
|
|
129638
129043
|
|
|
129639
129044
|
async function isDirectoryExists(directoryPath) {
|
|
129640
129045
|
try {
|
|
129641
|
-
const dirStat = await (
|
|
129046
|
+
const dirStat = await statAsync(directoryPath);
|
|
129642
129047
|
return dirStat.isDirectory();
|
|
129643
129048
|
} catch (ignoreError) {
|
|
129644
129049
|
return false;
|
|
@@ -129649,27 +129054,27 @@ async function readFiles(filePaths) {
|
|
|
129649
129054
|
const result = [];
|
|
129650
129055
|
|
|
129651
129056
|
for (const filePath of filePaths) {
|
|
129652
|
-
result.push(await (
|
|
129057
|
+
result.push(await readFileAsync(filePath, "utf-8"));
|
|
129653
129058
|
}
|
|
129654
129059
|
|
|
129655
129060
|
return result;
|
|
129656
129061
|
}
|
|
129657
129062
|
|
|
129658
129063
|
async function extractReferences(formSugarDirectoryPath) {
|
|
129659
|
-
const indexContent = await (
|
|
129660
|
-
return (0,
|
|
129064
|
+
const indexContent = await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), "utf-8");
|
|
129065
|
+
return (0,_common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_8__.extractSugarReferences)(indexContent, filePath => readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, filePath), "utf-8"));
|
|
129661
129066
|
}
|
|
129662
129067
|
|
|
129663
129068
|
async function getAllFilePathsInDirectory(directoryPath, _filelist) {
|
|
129664
|
-
if (!(await (0,
|
|
129069
|
+
if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_4__.pathExists)(directoryPath))) {
|
|
129665
129070
|
return [];
|
|
129666
129071
|
}
|
|
129667
129072
|
|
|
129668
|
-
const files = await (
|
|
129073
|
+
const files = await readdirAsync(directoryPath);
|
|
129669
129074
|
let filelist = _filelist || [];
|
|
129670
129075
|
|
|
129671
129076
|
for (const file of files) {
|
|
129672
|
-
if ((await (
|
|
129077
|
+
if ((await statAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, file))).isDirectory()) {
|
|
129673
129078
|
filelist = await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, file), filelist);
|
|
129674
129079
|
} else {
|
|
129675
129080
|
filelist.push(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, file));
|
|
@@ -129680,7 +129085,7 @@ async function getAllFilePathsInDirectory(directoryPath, _filelist) {
|
|
|
129680
129085
|
}
|
|
129681
129086
|
|
|
129682
129087
|
async function checkFileExists(filePath) {
|
|
129683
|
-
if (!(await (0,
|
|
129088
|
+
if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_4__.pathExists)(filePath))) {
|
|
129684
129089
|
return [];
|
|
129685
129090
|
}
|
|
129686
129091
|
|
|
@@ -129693,7 +129098,7 @@ async function getAllDependencies(formSourcesPath, farmDirectory) {
|
|
|
129693
129098
|
|
|
129694
129099
|
if (sugarReferences.fetchFunctionFiles.length === 0) {
|
|
129695
129100
|
const legacyfetchfunctionsDirectory = path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions");
|
|
129696
|
-
sugarReferences.fetchFunctionFiles = (await (
|
|
129101
|
+
sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
|
|
129697
129102
|
}
|
|
129698
129103
|
|
|
129699
129104
|
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, "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")))];
|
|
@@ -129706,23 +129111,23 @@ function normalizeLineEndings(content) {
|
|
|
129706
129111
|
async function getAllDependenciesHash(formSourcesPath, farmDirectory) {
|
|
129707
129112
|
const allDeps = await getAllDependencies(formSourcesPath, farmDirectory);
|
|
129708
129113
|
const hashes = await Promise.all(allDeps.map(async depFilePath => {
|
|
129709
|
-
if ([".js", ".
|
|
129710
|
-
let content = await (
|
|
129114
|
+
if ([".js", ".xml", ".xslt", ".json"].some(ext => depFilePath.endsWith(ext))) {
|
|
129115
|
+
let content = await readFileAsync(depFilePath, "utf-8");
|
|
129711
129116
|
content = normalizeLineEndings(content);
|
|
129712
|
-
return
|
|
129117
|
+
return md5__WEBPACK_IMPORTED_MODULE_5___default()(content);
|
|
129713
129118
|
}
|
|
129714
129119
|
|
|
129715
|
-
return
|
|
129120
|
+
return md5_file__WEBPACK_IMPORTED_MODULE_6___default()(depFilePath);
|
|
129716
129121
|
}));
|
|
129717
|
-
return
|
|
129122
|
+
return md5__WEBPACK_IMPORTED_MODULE_5___default()(hashes.join(""));
|
|
129718
129123
|
}
|
|
129719
129124
|
async function readSugarFiles(formSugarDirectoryPath, references) {
|
|
129720
129125
|
const result = {
|
|
129721
|
-
"./index": await (
|
|
129126
|
+
"./index": await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), "utf-8")
|
|
129722
129127
|
};
|
|
129723
129128
|
|
|
129724
129129
|
for (const sugarPath of references.sugarFiles) {
|
|
129725
|
-
const sugarModuleContent = await (
|
|
129130
|
+
const sugarModuleContent = await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, sugarPath + ".sugar.xml"), "utf-8");
|
|
129726
129131
|
result[sugarPath] = sugarModuleContent;
|
|
129727
129132
|
}
|
|
129728
129133
|
|
|
@@ -129734,11 +129139,11 @@ async function readCustomControlsFiles(formSugarDirectoryPath) {
|
|
|
129734
129139
|
return {};
|
|
129735
129140
|
}
|
|
129736
129141
|
|
|
129737
|
-
const fileNames = await
|
|
129142
|
+
const fileNames = await recursive_readdir__WEBPACK_IMPORTED_MODULE_7___default()(formSugarDirectoryPath);
|
|
129738
129143
|
const result = {};
|
|
129739
129144
|
|
|
129740
129145
|
for (const fileName of fileNames) {
|
|
129741
|
-
const sugarModuleContent = await (
|
|
129146
|
+
const sugarModuleContent = await readFileAsync(fileName, "utf-8");
|
|
129742
129147
|
const relativeFileName = ("controls\\" + fileName.replace(formSugarDirectoryPath + "\\", "")).replace(/\\/g, "/");
|
|
129743
129148
|
result[relativeFileName] = sugarModuleContent;
|
|
129744
129149
|
}
|
|
@@ -129746,23 +129151,23 @@ async function readCustomControlsFiles(formSugarDirectoryPath) {
|
|
|
129746
129151
|
return result;
|
|
129747
129152
|
}
|
|
129748
129153
|
|
|
129749
|
-
async function
|
|
129750
|
-
|
|
129154
|
+
async function readAutoCalcFiles(formAutoCalcPath) {
|
|
129155
|
+
try {
|
|
129156
|
+
const files = await readdirAsync(formAutoCalcPath);
|
|
129157
|
+
const jsFiles = files.filter(filename => /\.js$/.test(filename));
|
|
129158
|
+
return Promise.all(jsFiles.map(filename => readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formAutoCalcPath, filename), "utf-8")));
|
|
129159
|
+
} catch (ignoreError) {
|
|
129751
129160
|
return [];
|
|
129752
129161
|
}
|
|
129753
|
-
|
|
129754
|
-
const files = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readdir)(directoryPath);
|
|
129755
|
-
const jsFiles = files.filter(filename => fileNameTest.test(filename));
|
|
129756
|
-
return Promise.all(jsFiles.map(filename => (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, filename), "utf-8")));
|
|
129757
129162
|
}
|
|
129758
129163
|
|
|
129759
129164
|
async function readImportedFiles(rootPath) {
|
|
129760
129165
|
try {
|
|
129761
129166
|
const result = {};
|
|
129762
|
-
const files = await (
|
|
129167
|
+
const files = await readdirAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "validations"));
|
|
129763
129168
|
|
|
129764
129169
|
for (const fileName of files) {
|
|
129765
|
-
result["../validations/" + fileName] = await (
|
|
129170
|
+
result["../validations/" + fileName] = await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "validations", fileName), "utf-8");
|
|
129766
129171
|
}
|
|
129767
129172
|
|
|
129768
129173
|
return result;
|
|
@@ -129773,11 +129178,11 @@ async function readImportedFiles(rootPath) {
|
|
|
129773
129178
|
|
|
129774
129179
|
async function readJavaScriptFilesWithNames(formJavaScriptFilesPath) {
|
|
129775
129180
|
try {
|
|
129776
|
-
const files = await (
|
|
129181
|
+
const files = await readdirAsync(formJavaScriptFilesPath);
|
|
129777
129182
|
const jsFiles = files.filter(filename => /\.js$/.test(filename));
|
|
129778
129183
|
return Promise.all(jsFiles.map(async filename => ({
|
|
129779
129184
|
filename: path__WEBPACK_IMPORTED_MODULE_1___default().parse(filename).name,
|
|
129780
|
-
content: await (
|
|
129185
|
+
content: await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formJavaScriptFilesPath, filename), "utf-8")
|
|
129781
129186
|
})));
|
|
129782
129187
|
} catch (ignoreError) {
|
|
129783
129188
|
return [];
|
|
@@ -129788,7 +129193,7 @@ async function connectJSFilesWithNames(formJavaScriptFilesPath) {
|
|
|
129788
129193
|
let jsFiles;
|
|
129789
129194
|
|
|
129790
129195
|
try {
|
|
129791
|
-
const files = await (
|
|
129196
|
+
const files = await readdirAsync(formJavaScriptFilesPath);
|
|
129792
129197
|
jsFiles = files.filter(filename => /\.js$/.test(filename));
|
|
129793
129198
|
const result = [];
|
|
129794
129199
|
|
|
@@ -129796,7 +129201,7 @@ async function connectJSFilesWithNames(formJavaScriptFilesPath) {
|
|
|
129796
129201
|
result.push({
|
|
129797
129202
|
filename: path__WEBPACK_IMPORTED_MODULE_1___default().parse(filename).name,
|
|
129798
129203
|
// tslint:disable-next-line no-unsafe-any
|
|
129799
|
-
content: evalModule(await (
|
|
129204
|
+
content: evalModule(await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formJavaScriptFilesPath, filename), "utf-8"))
|
|
129800
129205
|
});
|
|
129801
129206
|
}
|
|
129802
129207
|
|
|
@@ -129807,16 +129212,16 @@ async function connectJSFilesWithNames(formJavaScriptFilesPath) {
|
|
|
129807
129212
|
}
|
|
129808
129213
|
|
|
129809
129214
|
function readSchemaRngFile(formSchemasPath, gfv) {
|
|
129810
|
-
return (
|
|
129215
|
+
return readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSchemasPath, `${gfv}.rng.xml`), "utf-8");
|
|
129811
129216
|
}
|
|
129812
129217
|
|
|
129813
129218
|
function readHooksFile(formDirectoryPath) {
|
|
129814
|
-
return (
|
|
129219
|
+
return readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formDirectoryPath, "hooks.js"), "utf-8").catch(() => "");
|
|
129815
129220
|
}
|
|
129816
129221
|
|
|
129817
129222
|
async function readFileSource(filePath, filename, defaultValue) {
|
|
129818
129223
|
try {
|
|
129819
|
-
return await (
|
|
129224
|
+
return await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(filePath, filename), "utf-8");
|
|
129820
129225
|
} catch (ingoreError) {
|
|
129821
129226
|
return defaultValue;
|
|
129822
129227
|
}
|
|
@@ -130376,18 +129781,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
130376
129781
|
|
|
130377
129782
|
|
|
130378
129783
|
class NormalizationRulesGenerator {
|
|
130379
|
-
constructor(sugarRoot, dataDeclarationHelper, formSchemaRng,
|
|
129784
|
+
constructor(sugarRoot, dataDeclarationHelper, formSchemaRng, mathContainer, typesRegistry, useSchemaValidations, controlCustomizationContext) {
|
|
130380
129785
|
this.sugarRoot = void 0;
|
|
130381
129786
|
this.dataDeclarationHelper = void 0;
|
|
130382
129787
|
this.formSchemaRng = void 0;
|
|
130383
|
-
this.
|
|
129788
|
+
this.mathContainer = void 0;
|
|
130384
129789
|
this.typesRegistry = void 0;
|
|
130385
129790
|
this.controlCustomizationContext = void 0;
|
|
130386
129791
|
this.useSchemaValidations = void 0;
|
|
130387
129792
|
this.sugarRoot = sugarRoot;
|
|
130388
129793
|
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
130389
129794
|
this.formSchemaRng = formSchemaRng;
|
|
130390
|
-
this.
|
|
129795
|
+
this.mathContainer = mathContainer;
|
|
130391
129796
|
this.typesRegistry = typesRegistry;
|
|
130392
129797
|
this.useSchemaValidations = useSchemaValidations;
|
|
130393
129798
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
@@ -130417,7 +129822,9 @@ class NormalizationRulesGenerator {
|
|
|
130417
129822
|
}
|
|
130418
129823
|
|
|
130419
129824
|
*buildFormulaFLangRules() {
|
|
130420
|
-
for (const formula of this.formulas) {
|
|
129825
|
+
for (const formula of (_this$mathContainer$f = (_this$mathContainer = this.mathContainer) === null || _this$mathContainer === void 0 ? void 0 : (_this$mathContainer$f2 = _this$mathContainer.formulas) === null || _this$mathContainer$f2 === void 0 ? void 0 : _this$mathContainer$f2.items) !== null && _this$mathContainer$f !== void 0 ? _this$mathContainer$f : []) {
|
|
129826
|
+
var _this$mathContainer$f, _this$mathContainer, _this$mathContainer$f2;
|
|
129827
|
+
|
|
130421
129828
|
yield* this.buildFormulaFlashRule(formula);
|
|
130422
129829
|
}
|
|
130423
129830
|
}
|