@abaplint/transpiler-cli 1.8.34 → 1.8.37
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/README.md +12 -12
- package/abap_transpile +1 -1
- package/build/bundle.js +13 -13
- package/package.json +37 -37
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# @abaplint/transpiler-cli
|
|
2
|
-
|
|
3
|
-
Transpiler CLI
|
|
4
|
-
|
|
5
|
-
Input = `src` directory
|
|
6
|
-
|
|
7
|
-
Output = `output` directory
|
|
8
|
-
|
|
9
|
-
## Examples
|
|
10
|
-
|
|
11
|
-
Call `abap_transpile` on the command line, see example in
|
|
12
|
-
|
|
1
|
+
# @abaplint/transpiler-cli
|
|
2
|
+
|
|
3
|
+
Transpiler CLI
|
|
4
|
+
|
|
5
|
+
Input = `src` directory
|
|
6
|
+
|
|
7
|
+
Output = `output` directory
|
|
8
|
+
|
|
9
|
+
## Examples
|
|
10
|
+
|
|
11
|
+
Call `abap_transpile` on the command line, see example in
|
|
12
|
+
|
|
13
13
|
https://github.com/larshp/abap-advent-2020/blob/main/package.json#L8
|
package/abap_transpile
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
require("./build/bundle");
|
|
2
|
+
require("./build/bundle");
|
package/build/bundle.js
CHANGED
|
@@ -13370,7 +13370,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13370
13370
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13371
13371
|
|
|
13372
13372
|
"use strict";
|
|
13373
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleDataElement = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ./chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ./transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nclass HandleDataElement {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n let fixedValues = undefined;\r\n if (obj.getDomainName()) {\r\n const doma = reg.getObject(\"DOMA\", obj.getDomainName());\r\n if (doma) {\r\n fixedValues = doma.getFixedValues();\r\n }\r\n }\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\
|
|
13373
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleDataElement = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ./chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ./transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nclass HandleDataElement {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n let fixedValues = undefined;\r\n if (obj.getDomainName()) {\r\n const doma = reg.getObject(\"DOMA\", obj.getDomainName());\r\n if (doma) {\r\n fixedValues = doma.getFixedValues();\r\n }\r\n }\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\n \"objectType\": \"DTEL\",\n \"type\": ${new transpile_types_1.TranspileTypes().toType(type)},\n \"domain\": ${JSON.stringify(obj.getDomainName())},\n \"fixedValues\": ${JSON.stringify(fixedValues)},\n};`);\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: [],\r\n exports: [],\r\n };\r\n return [output];\r\n }\r\n}\r\nexports.HandleDataElement = HandleDataElement;\r\n//# sourceMappingURL=handle_data_element.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handle_data_element.js?");
|
|
13374
13374
|
|
|
13375
13375
|
/***/ }),
|
|
13376
13376
|
|
|
@@ -13381,7 +13381,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13381
13381
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13382
13382
|
|
|
13383
13383
|
"use strict";
|
|
13384
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleTable = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ./chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ./transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\n// tables or structures\r\nclass HandleTable {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\
|
|
13384
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleTable = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ./chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ./transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\n// tables or structures\r\nclass HandleTable {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\n \"objectType\": \"TABL\",\n \"type\": ${new transpile_types_1.TranspileTypes().toType(type)},\n \"keyFields\": ${JSON.stringify(obj.listKeys())},\n};`);\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: [],\r\n exports: [],\r\n };\r\n return [output];\r\n }\r\n}\r\nexports.HandleTable = HandleTable;\r\n//# sourceMappingURL=handle_table.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handle_table.js?");
|
|
13385
13385
|
|
|
13386
13386
|
/***/ }),
|
|
13387
13387
|
|
|
@@ -13392,7 +13392,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13392
13392
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13393
13393
|
|
|
13394
13394
|
"use strict";
|
|
13395
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleTableType = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ./chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ./transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nclass HandleTableType {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\
|
|
13395
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.HandleTableType = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ./chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ./transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nclass HandleTableType {\r\n runObject(obj, reg) {\r\n var _a;\r\n const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(\".xml\", \".mjs\").toLowerCase();\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n const type = obj.parseType(reg);\r\n const chunk = new chunk_1.Chunk().appendString(`abap.DDIC[\"${obj.getName().toUpperCase()}\"] = {\n \"objectType\": \"TTYP\",\n \"type\": ${new transpile_types_1.TranspileTypes().toType(type)},\n};`);\r\n const output = {\r\n object: {\r\n name: obj.getName(),\r\n type: obj.getType(),\r\n },\r\n filename: filename,\r\n chunk: chunk,\r\n requires: [],\r\n exports: [],\r\n };\r\n return [output];\r\n }\r\n}\r\nexports.HandleTableType = HandleTableType;\r\n//# sourceMappingURL=handle_table_type.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/handle_table_type.js?");
|
|
13396
13396
|
|
|
13397
13397
|
/***/ }),
|
|
13398
13398
|
|
|
@@ -13480,7 +13480,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13480
13480
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13481
13481
|
|
|
13482
13482
|
"use strict";
|
|
13483
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AssignTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass AssignTranspiler {\r\n transpile(node, traversal) {\r\n const sources = node.findDirectExpressions(abaplint.Expressions.Source).map(e => new expressions_1.SourceTranspiler(false).transpile(e, traversal).getCode());\r\n const fs = new expressions_1.FieldSymbolTranspiler().transpile(node.findDirectExpression(abaplint.Expressions.FSTarget), traversal).getCode();\r\n const options = [];\r\n const concat = node.concatTokens();\r\n if (concat.startsWith(\"ASSIGN COMPONENT \")) {\r\n options.push(\"component: \" + sources.shift());\r\n }\r\n options.push(\"target: \" + fs);\r\n options.push(\"source: \" + sources.pop());\r\n if (concat.endsWith(\" CASTING.\")) {\r\n options.push(\"casting: true\");\r\n }\r\n return new chunk_1.Chunk().append(\"abap.statements.assign({\", node, traversal)\r\n .appendString(options.join(\", \"))\r\n .append(\"});\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.AssignTranspiler = AssignTranspiler;\r\n//# sourceMappingURL=assign.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/assign.js?");
|
|
13483
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AssignTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass AssignTranspiler {\r\n transpile(node, traversal) {\r\n const sources = node.findDirectExpressions(abaplint.Expressions.Source).map(e => new expressions_1.SourceTranspiler(false).transpile(e, traversal).getCode());\r\n const fs = new expressions_1.FieldSymbolTranspiler().transpile(node.findDirectExpression(abaplint.Expressions.FSTarget), traversal).getCode();\r\n const options = [];\r\n const concat = node.concatTokens().toUpperCase();\r\n if (concat.startsWith(\"ASSIGN COMPONENT \")) {\r\n options.push(\"component: \" + sources.shift());\r\n }\r\n options.push(\"target: \" + fs);\r\n options.push(\"source: \" + sources.pop());\r\n if (concat.endsWith(\" CASTING.\")) {\r\n options.push(\"casting: true\");\r\n }\r\n return new chunk_1.Chunk().append(\"abap.statements.assign({\", node, traversal)\r\n .appendString(options.join(\", \"))\r\n .append(\"});\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.AssignTranspiler = AssignTranspiler;\r\n//# sourceMappingURL=assign.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/assign.js?");
|
|
13484
13484
|
|
|
13485
13485
|
/***/ }),
|
|
13486
13486
|
|
|
@@ -13524,7 +13524,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13524
13524
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13525
13525
|
|
|
13526
13526
|
"use strict";
|
|
13527
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallFunctionTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass CallFunctionTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const fmname = (_a = node.findDirectExpression(abaplint.Expressions.FunctionName)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (fmname === undefined) {\r\n throw \"CallFunctionTranspilerNameNotFound\";\r\n }\r\n let param = \"\";\r\n const fmp = node.findDirectExpression(abaplint.Expressions.FunctionParameters);\r\n if (fmp) {\r\n param = traversal.traverse(fmp).getCode();\r\n }\r\n const ret = new chunk_1.Chunk();\r\n const dest = (_b = node.findDirectExpression(abaplint.Expressions.Destination)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(abaplint.Expressions.Source);\r\n if (dest) {\r\n param = param.replace(\"{\", \",\").replace(/}$/, \"\");\r\n ret.appendString(`await abap.statements.callFunction({name:${fmname},destination:${dest.concatTokens()}${param}});`);\r\n }\r\n else {\r\n ret.appendString(`await abap.FunctionModules[${fmname}](${param});`);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.CallFunctionTranspiler = CallFunctionTranspiler;\r\n//# sourceMappingURL=call_function.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/call_function.js?");
|
|
13527
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallFunctionTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass CallFunctionTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const fmname = (_a = node.findDirectExpression(abaplint.Expressions.FunctionName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (fmname === undefined) {\r\n throw \"CallFunctionTranspilerNameNotFound\";\r\n }\r\n let param = \"\";\r\n const fmp = node.findDirectExpression(abaplint.Expressions.FunctionParameters);\r\n if (fmp) {\r\n param = traversal.traverse(fmp).getCode();\r\n }\r\n const ret = new chunk_1.Chunk();\r\n const dest = (_b = node.findDirectExpression(abaplint.Expressions.Destination)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(abaplint.Expressions.Source);\r\n if (dest) {\r\n param = param.replace(\"{\", \",\").replace(/}$/, \"\");\r\n ret.appendString(`await abap.statements.callFunction({name:${fmname},destination:${dest.concatTokens()}${param}});`);\r\n }\r\n else {\r\n ret.appendString(`await abap.FunctionModules[${fmname}](${param});`);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.CallFunctionTranspiler = CallFunctionTranspiler;\r\n//# sourceMappingURL=call_function.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/call_function.js?");
|
|
13528
13528
|
|
|
13529
13529
|
/***/ }),
|
|
13530
13530
|
|
|
@@ -13634,7 +13634,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13634
13634
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13635
13635
|
|
|
13636
13636
|
"use strict";
|
|
13637
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConcatenateTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ConcatenateTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const concat = node.concatTokens();\r\n const slist = [];\r\n for (const s of node.findDirectExpressions(abaplint.Expressions.Source)) {\r\n slist.push(traversal.traverse(s));\r\n }\r\n let extra = \"\";\r\n if (node.findExpressionAfterToken(\"BY\")) {\r\n extra = `, separatedBy: ${(_a = slist.pop()) === null || _a === void 0 ? void 0 : _a.getCode()}`;\r\n }\r\n if (concat.startsWith(\"CONCATENATE LINES OF \")) {\r\n extra += \", lines: true\";\r\n }\r\n const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target));\r\n return new chunk_1.Chunk()\r\n .append(\"abap.statements.concatenate({source: [\", node, traversal)\r\n .join(slist)\r\n .appendString(\"], target: \")\r\n .appendChunk(target)\r\n .append(extra + \"});\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.ConcatenateTranspiler = ConcatenateTranspiler;\r\n//# sourceMappingURL=concatenate.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/concatenate.js?");
|
|
13637
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConcatenateTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ConcatenateTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n const concat = node.concatTokens().toUpperCase();\r\n const slist = [];\r\n for (const s of node.findDirectExpressions(abaplint.Expressions.Source)) {\r\n slist.push(traversal.traverse(s));\r\n }\r\n let extra = \"\";\r\n if (node.findExpressionAfterToken(\"BY\")) {\r\n extra = `, separatedBy: ${(_a = slist.pop()) === null || _a === void 0 ? void 0 : _a.getCode()}`;\r\n }\r\n if (concat.startsWith(\"CONCATENATE LINES OF \")) {\r\n extra += \", lines: true\";\r\n }\r\n const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target));\r\n return new chunk_1.Chunk()\r\n .append(\"abap.statements.concatenate({source: [\", node, traversal)\r\n .join(slist)\r\n .appendString(\"], target: \")\r\n .appendChunk(target)\r\n .append(extra + \"});\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.ConcatenateTranspiler = ConcatenateTranspiler;\r\n//# sourceMappingURL=concatenate.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/concatenate.js?");
|
|
13638
13638
|
|
|
13639
13639
|
/***/ }),
|
|
13640
13640
|
|
|
@@ -13645,7 +13645,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13645
13645
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13646
13646
|
|
|
13647
13647
|
"use strict";
|
|
13648
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CondenseTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass CondenseTranspiler {\r\n transpile(node, traversal) {\r\n const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target));\r\n const noGaps = node.concatTokens().includes(\" NO-GAPS\");\r\n const ret = new chunk_1.Chunk();\r\n ret.append(\"abap.statements.condense(\", node, traversal);\r\n ret.appendChunk(target);\r\n ret.append(\", {nogaps: \" + noGaps + \"});\", node.getLastToken(), traversal);\r\n return ret;\r\n }\r\n}\r\nexports.CondenseTranspiler = CondenseTranspiler;\r\n//# sourceMappingURL=condense.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/condense.js?");
|
|
13648
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CondenseTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass CondenseTranspiler {\r\n transpile(node, traversal) {\r\n const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target));\r\n const noGaps = node.concatTokens().toUpperCase().includes(\" NO-GAPS\");\r\n const ret = new chunk_1.Chunk();\r\n ret.append(\"abap.statements.condense(\", node, traversal);\r\n ret.appendChunk(target);\r\n ret.append(\", {nogaps: \" + noGaps + \"});\", node.getLastToken(), traversal);\r\n return ret;\r\n }\r\n}\r\nexports.CondenseTranspiler = CondenseTranspiler;\r\n//# sourceMappingURL=condense.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/condense.js?");
|
|
13649
13649
|
|
|
13650
13650
|
/***/ }),
|
|
13651
13651
|
|
|
@@ -13689,7 +13689,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13689
13689
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13690
13690
|
|
|
13691
13691
|
"use strict";
|
|
13692
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CreateDataTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nclass CreateDataTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b, _c;\r\n const targetNode = node.findDirectExpression(abaplint.Expressions.Target);\r\n const target = traversal.traverse(targetNode);\r\n const concat = node.concatTokens();\r\n const options = [];\r\n let dynamic = (_a = node.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(abaplint.Expressions.ConstantString);\r\n if (dynamic) {\r\n options.push(`\"name\": ` + dynamic.getFirstToken().getStr());\r\n }\r\n else {\r\n dynamic = (_b = node.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _b === void 0 ? void 0 : _b.findFirstExpression(abaplint.Expressions.FieldChain);\r\n if (dynamic) {\r\n options.push(`\"name\": ` + new expressions_1.FieldChainTranspiler(true).transpile(dynamic, traversal).getCode());\r\n }\r\n }\r\n const typeNameNode = node.findDirectExpression(abaplint.Expressions.TypeName);\r\n if (typeNameNode) {\r\n const id = (_c = traversal.findCurrentScopeByToken(typeNameNode.getFirstToken())) === null || _c === void 0 ? void 0 : _c.findType(typeNameNode.concatTokens());\r\n if (id) {\r\n options.push(`\"type\": ` + new transpile_types_1.TranspileTypes().toType(id.getType()));\r\n }\r\n }\r\n if (node.findDirectTokenByText(\"TABLE\")) {\r\n options.push(`\"table\": true`);\r\n }\r\n if (concat.includes(\" LIKE LINE OF \")) {\r\n const so = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));\r\n options.push(`\"likeLineOf\": ` + so.getCode());\r\n }\r\n let add = \"\";\r\n if (options.length > 0) {\r\n add = \",{\" + options.join(\",\") + \"}\";\r\n }\r\n return new chunk_1.Chunk(\"abap.statements.createData(\" + target.getCode() + add + \");\");\r\n }\r\n}\r\nexports.CreateDataTranspiler = CreateDataTranspiler;\r\n//# sourceMappingURL=create_data.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/create_data.js?");
|
|
13692
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CreateDataTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nclass CreateDataTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b, _c;\r\n const targetNode = node.findDirectExpression(abaplint.Expressions.Target);\r\n const target = traversal.traverse(targetNode);\r\n const concat = node.concatTokens().toUpperCase();\r\n const options = [];\r\n let dynamic = (_a = node.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(abaplint.Expressions.ConstantString);\r\n if (dynamic) {\r\n options.push(`\"name\": ` + dynamic.getFirstToken().getStr());\r\n }\r\n else {\r\n dynamic = (_b = node.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _b === void 0 ? void 0 : _b.findFirstExpression(abaplint.Expressions.FieldChain);\r\n if (dynamic) {\r\n options.push(`\"name\": ` + new expressions_1.FieldChainTranspiler(true).transpile(dynamic, traversal).getCode());\r\n }\r\n }\r\n const typeNameNode = node.findDirectExpression(abaplint.Expressions.TypeName);\r\n if (typeNameNode) {\r\n const id = (_c = traversal.findCurrentScopeByToken(typeNameNode.getFirstToken())) === null || _c === void 0 ? void 0 : _c.findType(typeNameNode.concatTokens());\r\n if (id) {\r\n options.push(`\"type\": ` + new transpile_types_1.TranspileTypes().toType(id.getType()));\r\n }\r\n }\r\n if (node.findDirectTokenByText(\"TABLE\")) {\r\n options.push(`\"table\": true`);\r\n }\r\n if (concat.includes(\" LIKE LINE OF \")) {\r\n const so = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));\r\n options.push(`\"likeLineOf\": ` + so.getCode());\r\n }\r\n let add = \"\";\r\n if (options.length > 0) {\r\n add = \",{\" + options.join(\",\") + \"}\";\r\n }\r\n return new chunk_1.Chunk(\"abap.statements.createData(\" + target.getCode() + add + \");\");\r\n }\r\n}\r\nexports.CreateDataTranspiler = CreateDataTranspiler;\r\n//# sourceMappingURL=create_data.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/create_data.js?");
|
|
13693
13693
|
|
|
13694
13694
|
/***/ }),
|
|
13695
13695
|
|
|
@@ -13744,7 +13744,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13744
13744
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13745
13745
|
|
|
13746
13746
|
"use strict";
|
|
13747
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DescribeTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass DescribeTranspiler {\r\n transpile(node, traversal) {\r\n const options = [];\r\n const concat = node.concatTokens().toUpperCase();\r\n const field = node.findExpressionAfterToken(\"FIELD\");\r\n if (field) {\r\n options.push(\"field: \" + traversal.traverse(field).getCode());\r\n }\r\n const type = node.findExpressionAfterToken(\"TYPE\");\r\n if (type) {\r\n options.push(\"type: \" + traversal.traverse(type).getCode());\r\n }\r\n const length = node.findExpressionAfterToken(\"LENGTH\");\r\n if (length) {\r\n options.push(\"length: \" + traversal.traverse(length).getCode());\r\n }\r\n if (concat.includes(\"IN CHARACTER MODE\")) {\r\n options.push(\"mode: 'CHARACTER'\");\r\n }\r\n if (concat.includes(\"IN BYTE MODE\")) {\r\n options.push(\"mode: 'BYTE'\");\r\n }\r\n return new chunk_1.Chunk()\r\n .append(\"abap.statements.describe({\", node, traversal)\r\n .appendString(options.join(\", \"))\r\n .append(\"});\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.DescribeTranspiler = DescribeTranspiler;\r\n//# sourceMappingURL=describe.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/describe.js?");
|
|
13747
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DescribeTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass DescribeTranspiler {\r\n transpile(node, traversal) {\r\n const options = [];\r\n const concat = node.concatTokens().toUpperCase();\r\n const field = node.findExpressionAfterToken(\"FIELD\");\r\n if (field) {\r\n options.push(\"field: \" + traversal.traverse(field).getCode());\r\n }\r\n const type = node.findExpressionAfterToken(\"TYPE\");\r\n if (type) {\r\n options.push(\"type: \" + traversal.traverse(type).getCode());\r\n }\r\n const length = node.findExpressionAfterToken(\"LENGTH\");\r\n if (length) {\r\n options.push(\"length: \" + traversal.traverse(length).getCode());\r\n }\r\n const lines = node.findExpressionAfterToken(\"LINES\");\r\n if (lines) {\r\n options.push(\"lines: \" + traversal.traverse(lines).getCode());\r\n }\r\n const table = node.findExpressionAfterToken(\"TABLE\");\r\n if (table) {\r\n options.push(\"table: \" + traversal.traverse(table).getCode());\r\n }\r\n if (concat.includes(\"IN CHARACTER MODE\")) {\r\n options.push(\"mode: 'CHARACTER'\");\r\n }\r\n if (concat.includes(\"IN BYTE MODE\")) {\r\n options.push(\"mode: 'BYTE'\");\r\n }\r\n return new chunk_1.Chunk()\r\n .append(\"abap.statements.describe({\", node, traversal)\r\n .appendString(options.join(\", \"))\r\n .append(\"});\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.DescribeTranspiler = DescribeTranspiler;\r\n//# sourceMappingURL=describe.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/describe.js?");
|
|
13748
13748
|
|
|
13749
13749
|
/***/ }),
|
|
13750
13750
|
|
|
@@ -13755,7 +13755,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13755
13755
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13756
13756
|
|
|
13757
13757
|
"use strict";
|
|
13758
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DoTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass DoTranspiler {\r\n transpile(node, traversal) {\r\n const found = node.findFirstExpression(abaplint.Expressions.Source);\r\n if (found) {\r\n const source = new expressions_1.SourceTranspiler(true).transpile(found, traversal).getCode();\r\n const idSource = unique_identifier_1.UniqueIdentifier.get();\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${idSource} = ${source};\
|
|
13758
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DoTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass DoTranspiler {\r\n transpile(node, traversal) {\r\n const found = node.findFirstExpression(abaplint.Expressions.Source);\r\n if (found) {\r\n const source = new expressions_1.SourceTranspiler(true).transpile(found, traversal).getCode();\r\n const idSource = unique_identifier_1.UniqueIdentifier.get();\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${idSource} = ${source};\nfor (let ${id} = 0; ${id} < ${idSource}; ${id}++) {\nabap.builtin.sy.get().index.set(${id} + 1);`);\r\n }\r\n else {\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`let ${unique} = 1;\nwhile (true) {\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n }\r\n}\r\nexports.DoTranspiler = DoTranspiler;\r\n//# sourceMappingURL=do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/do.js?");
|
|
13759
13759
|
|
|
13760
13760
|
/***/ }),
|
|
13761
13761
|
|
|
@@ -14019,7 +14019,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14019
14019
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14020
14020
|
|
|
14021
14021
|
"use strict";
|
|
14022
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.GetTimeTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass GetTimeTranspiler {\r\n transpile(node, traversal) {\r\n const concat = node.concatTokens();\r\n let options = \"\";\r\n if (concat.startsWith(\"GET TIME FIELD\")) {\r\n options = \"{field: \" + traversal.traverse(node.findFirstExpression(abaplint.Expressions.Target)).getCode() + \"}\";\r\n }\r\n else if (concat.startsWith(\"GET TIME STAMP FIELD\")) {\r\n options = \"{stamp: \" + traversal.traverse(node.findFirstExpression(abaplint.Expressions.Target)).getCode() + \"}\";\r\n }\r\n return new chunk_1.Chunk()\r\n .append(\"abap.statements.getTime(\", node, traversal)\r\n .appendString(options)\r\n .append(\");\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.GetTimeTranspiler = GetTimeTranspiler;\r\n//# sourceMappingURL=get_time.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/get_time.js?");
|
|
14022
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.GetTimeTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass GetTimeTranspiler {\r\n transpile(node, traversal) {\r\n const concat = node.concatTokens().toUpperCase();\r\n let options = \"\";\r\n if (concat.startsWith(\"GET TIME FIELD\")) {\r\n options = \"{field: \" + traversal.traverse(node.findFirstExpression(abaplint.Expressions.Target)).getCode() + \"}\";\r\n }\r\n else if (concat.startsWith(\"GET TIME STAMP FIELD\")) {\r\n options = \"{stamp: \" + traversal.traverse(node.findFirstExpression(abaplint.Expressions.Target)).getCode() + \"}\";\r\n }\r\n return new chunk_1.Chunk()\r\n .append(\"abap.statements.getTime(\", node, traversal)\r\n .appendString(options)\r\n .append(\");\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.GetTimeTranspiler = GetTimeTranspiler;\r\n//# sourceMappingURL=get_time.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/get_time.js?");
|
|
14023
14023
|
|
|
14024
14024
|
/***/ }),
|
|
14025
14025
|
|
|
@@ -14470,7 +14470,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14470
14470
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14471
14471
|
|
|
14472
14472
|
"use strict";
|
|
14473
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WaitTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass WaitTranspiler {\r\n transpile(node, traversal) {\r\n const concat = node.concatTokens();\r\n if (concat.includes(\" FOR PUSH CHANNELS \") === false) {\r\n return new chunk_1.Chunk().appendString(\"WAIT_TODO\");\r\n }\r\n const lookup = traversal.lookupClassOrInterface(\"KERNEL_PUSH_CHANNELS\", node.getFirstToken());\r\n const options = [];\r\n const cond = node.findFirstExpression(abaplint.Expressions.Cond);\r\n if (cond) {\r\n options.push(\"cond: \" + traversal.traverse(cond).getCode());\r\n }\r\n const seconds = node.findExpressionAfterToken(\"TO\");\r\n if (seconds) {\r\n options.push(\"seconds: \" + traversal.traverse(seconds).getCode());\r\n }\r\n const call = `await ${lookup}.wait({${options.join(\",\")}});`;\r\n return new chunk_1.Chunk().append(`if (${lookup} === undefined) throw new Error(\"Wait, kernel class missing\");\\n${call}`, node, traversal);\r\n }\r\n}\r\nexports.WaitTranspiler = WaitTranspiler;\r\n//# sourceMappingURL=wait.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/wait.js?");
|
|
14473
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WaitTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass WaitTranspiler {\r\n transpile(node, traversal) {\r\n const concat = node.concatTokens().toUpperCase();\r\n if (concat.includes(\" FOR PUSH CHANNELS \") === false) {\r\n return new chunk_1.Chunk().appendString(\"WAIT_TODO\");\r\n }\r\n const lookup = traversal.lookupClassOrInterface(\"KERNEL_PUSH_CHANNELS\", node.getFirstToken());\r\n const options = [];\r\n const cond = node.findFirstExpression(abaplint.Expressions.Cond);\r\n if (cond) {\r\n options.push(\"cond: \" + traversal.traverse(cond).getCode());\r\n }\r\n const seconds = node.findExpressionAfterToken(\"TO\");\r\n if (seconds) {\r\n options.push(\"seconds: \" + traversal.traverse(seconds).getCode());\r\n }\r\n const call = `await ${lookup}.wait({${options.join(\",\")}});`;\r\n return new chunk_1.Chunk().append(`if (${lookup} === undefined) throw new Error(\"Wait, kernel class missing\");\\n${call}`, node, traversal);\r\n }\r\n}\r\nexports.WaitTranspiler = WaitTranspiler;\r\n//# sourceMappingURL=wait.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/wait.js?");
|
|
14474
14474
|
|
|
14475
14475
|
/***/ }),
|
|
14476
14476
|
|
|
@@ -14668,7 +14668,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14668
14668
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14669
14669
|
|
|
14670
14670
|
"use strict";
|
|
14671
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnitTest = void 0;\r\n/* eslint-disable max-len */\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass UnitTest {\r\n // todo, move this somewhere else, its much more than just unit test relevant\r\n initializationScript(reg, dbSetup, extraSetup) {\r\n let ret = `/* eslint-disable import/newline-after-import */\
|
|
14671
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnitTest = void 0;\r\n/* eslint-disable max-len */\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass UnitTest {\r\n // todo, move this somewhere else, its much more than just unit test relevant\r\n initializationScript(reg, dbSetup, extraSetup) {\r\n let ret = `/* eslint-disable import/newline-after-import */\nimport runtime from \"@abaplint/runtime\";\nglobal.abap = new runtime.ABAP();\n${this.buildImports(reg)}\nexport async function initializeABAP() {\\n`;\r\n if (dbSetup === \"\") {\r\n ret += `// no database artifacts, skip DB initialization\\n`;\r\n }\r\n else {\r\n ret += ` await global.abap.initDB(\\`${dbSetup}\\`);\\n`;\r\n }\r\n if (extraSetup === undefined) {\r\n ret += `// no extra setup\\n`;\r\n }\r\n else {\r\n ret += ` await import(\"../test/extra.mjs\");\\n`;\r\n }\r\n ret += `}`;\r\n return ret;\r\n }\r\n unitTestScriptOpen(reg, _skip, _only) {\r\n let ret = `/* eslint-disable curly */\nimport fs from \"fs\";\nimport path from \"path\";\nimport {fileURLToPath} from \"url\";\nimport {initializeABAP} from \"./init.mjs\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nasync function run() {\n await initializeABAP();\n let lt_input = new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30})}), {\"withHeader\":false,\"type\":\"STANDARD\",\"isUnique\":false,\"keyFields\":[]});\n let ls_input = new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30})});\n let ls_result = new abap.types.Structure({list: new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30}), expected: new abap.types.String(), actual: new abap.types.String(), status: new abap.types.String(), runtime: new abap.types.Integer(), message: new abap.types.String(), js_location: new abap.types.String()}), {\"withHeader\":false,\"type\":\"STANDARD\",\"isUnique\":false,\"keyFields\":[]}), json: new abap.types.String()});\n`;\r\n for (const obj of reg.getObjects()) {\r\n if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {\r\n continue;\r\n }\r\n const hasTestFile = obj.getFiles().some(f => { return f.getFilename().includes(\".testclasses.\"); });\r\n if (hasTestFile === true) {\r\n ret += ` await import(\"./${obj.getName().toLowerCase()}.${obj.getType().toLowerCase()}.testclasses.mjs\");\\n`;\r\n }\r\n for (const file of obj.getABAPFiles()) {\r\n for (const def of file.getInfo().listClassDefinitions()) {\r\n if (def.isForTesting === false || def.isGlobal === true || def.methods.length === 0) {\r\n // todo, fix, there might be global test methods\r\n continue;\r\n }\r\n for (const m of def.methods) {\r\n if (m.isForTesting === false) {\r\n continue;\r\n }\r\n ret += ` ls_input.get().class_name.set(\"${obj.getName()}\");\n ls_input.get().testclass_name.set(\"${def.name.toUpperCase()}\");\n ls_input.get().method_name.set(\"${m.name.toUpperCase()}\");\n abap.statements.append({source: ls_input, target: lt_input});`;\r\n }\r\n }\r\n }\r\n }\r\n ret += `\n\n ls_result.set(await abap.Classes[\"KERNEL_UNIT_RUNNER\"].run({it_input: lt_input}));\n fs.writeFileSync(__dirname + path.sep + \"output.json\", ls_result.get().json.get());\n}\n\nrun().then(() => {\n process.exit(0);\n}).catch((err) => {\n console.log(err);\n process.exit(1);\n});`;\r\n return ret;\r\n }\r\n unitTestScript(reg, skip, _only) {\r\n let ret = `/* eslint-disable curly */\nimport fs from \"fs\";\nimport path from \"path\";\nimport {fileURLToPath} from \"url\";\nimport {initializeABAP} from \"./init.mjs\";\nimport runtime from \"@abaplint/runtime\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nasync function run() {\n await initializeABAP();\n const unit = new runtime.UnitTestResult();\n let clas;\n let locl;\n let meth;\n try {\\n`;\r\n for (const obj of reg.getObjects()) {\r\n if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {\r\n continue;\r\n }\r\n ret += `// --------------------------------------------\\n`;\r\n ret += ` clas = unit.addObject(\"${obj.getName()}\");\\n`;\r\n for (const file of obj.getABAPFiles()) {\r\n for (const def of file.getInfo().listClassDefinitions()) {\r\n if (def.isForTesting === false || def.isGlobal === true || def.methods.length === 0) {\r\n // todo, fix, there might be global test methods\r\n continue;\r\n }\r\n ret += ` {\n const {${def.name}} = await import(\"./${obj.getName().toLowerCase()}.${obj.getType().toLowerCase()}.testclasses.mjs\");\n locl = clas.addTestClass(\"${def.name}\");\n if (${def.name}.class_setup) await ${def.name}.class_setup();\\n`;\r\n for (const m of def.methods) {\r\n if (m.isForTesting === false) {\r\n continue;\r\n }\r\n const skipThis = (skip || []).some(a => a.object === obj.getName() && a.class === def.name && a.method === m.name);\r\n if (skipThis) {\r\n ret += ` console.log('${obj.getName()}: running ${def.name}->${m.name}, skipped');\\n`;\r\n ret += ` meth = locl.addMethod(\"${m.name}\");\\n`;\r\n ret += ` meth.skip();\\n`;\r\n continue;\r\n }\r\n ret += ` {\\n const test = await (new ${def.name}()).constructor_();\\n`;\r\n ret += ` if (test.setup) await test.setup();\\n`;\r\n ret += ` console.log(\"${obj.getName()}: running ${def.name}->${m.name}\");\\n`;\r\n ret += ` meth = locl.addMethod(\"${m.name}\");\\n`;\r\n ret += ` await test.${m.name}();\\n`;\r\n ret += ` meth.pass();\\n`;\r\n ret += ` if (test.teardown) await test.teardown();\\n`;\r\n ret += ` }\\n`;\r\n }\r\n ret += ` if (${def.name}.class_teardown) await ${def.name}.class_teardown();\\n`;\r\n ret += ` }\\n`;\r\n }\r\n }\r\n }\r\n ret += `// -------------------END-------------------\n console.log(abap.console.get());\n fs.writeFileSync(__dirname + path.sep + \"output.xml\", unit.xUnitXML());\n } catch (e) {\n if (meth) {\n meth.fail();\n }\n console.log(abap.console.get());\n fs.writeFileSync(__dirname + path.sep + \"output.xml\", unit.xUnitXML());\n throw e;\n }\n}\n\nrun().then(() => {\n process.exit(0);\n}).catch((err) => {\n console.log(err);\n process.exit(1);\n});`;\r\n return ret;\r\n }\r\n buildImports(reg) {\r\n // note: ES modules are hoised, so use the dynamic import()\r\n // todo, some sorting might be required? eg. a class constructor using constant from interface?\r\n // temporary sorting: by filename\r\n const list = [];\r\n for (const obj of reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.Table) {\r\n list.push(`await import(\"./${obj.getName().toLowerCase()}.tabl.mjs\");`);\r\n }\r\n else if (obj instanceof abaplint.Objects.DataElement) {\r\n list.push(`await import(\"./${obj.getName().toLowerCase()}.dtel.mjs\");`);\r\n }\r\n else if (obj instanceof abaplint.Objects.TableType) {\r\n list.push(`await import(\"./${obj.getName().toLowerCase()}.ttyp.mjs\");`);\r\n }\r\n }\r\n for (const obj of reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.FunctionGroup) {\r\n for (const m of obj.getModules()) {\r\n list.push(`await import(\"./${obj.getName().toLowerCase()}.fugr.${m.getName().toLowerCase()}.mjs\");`);\r\n }\r\n }\r\n else if (obj instanceof abaplint.Objects.Class) {\r\n list.push(`await import(\"./${obj.getName().toLowerCase()}.clas.mjs\");`);\r\n }\r\n else if (obj instanceof abaplint.Objects.Interface) {\r\n list.push(`await import(\"./${obj.getName().toLowerCase()}.intf.mjs\");`);\r\n }\r\n }\r\n list.sort();\r\n return list.join(\"\\n\") + \"\\n\";\r\n }\r\n}\r\nexports.UnitTest = UnitTest;\r\n//# sourceMappingURL=unit_test.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/unit_test.js?");
|
|
14672
14672
|
|
|
14673
14673
|
/***/ }),
|
|
14674
14674
|
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "1.8.
|
|
4
|
-
"description": "Transpiler - Command Line Interface",
|
|
5
|
-
"bin": {
|
|
6
|
-
"abap_transpile": "./abap_transpile"
|
|
7
|
-
},
|
|
8
|
-
"types": "./build/types.d.ts",
|
|
9
|
-
"keywords": [
|
|
10
|
-
"ABAP",
|
|
11
|
-
"abaplint"
|
|
12
|
-
],
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/abaplint/transpiler.git"
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"test": "tsc && npm run webpack",
|
|
19
|
-
"publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
20
|
-
"publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
21
|
-
"compile": "npm test",
|
|
22
|
-
"webpack": "webpack --progress"
|
|
23
|
-
},
|
|
24
|
-
"author": "abaplint",
|
|
25
|
-
"license": "MIT",
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@abaplint/transpiler": "^1.8.
|
|
28
|
-
"@types/glob": "^7.2.0",
|
|
29
|
-
"glob": "^7.2.0",
|
|
30
|
-
"@types/progress": "^2.0.5",
|
|
31
|
-
"@abaplint/core": "^2.86.6",
|
|
32
|
-
"progress": "^2.0.3",
|
|
33
|
-
"webpack": "^5.71.0",
|
|
34
|
-
"webpack-cli": "^4.9.2",
|
|
35
|
-
"typescript": "^4.6.3"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@abaplint/transpiler-cli",
|
|
3
|
+
"version": "1.8.37",
|
|
4
|
+
"description": "Transpiler - Command Line Interface",
|
|
5
|
+
"bin": {
|
|
6
|
+
"abap_transpile": "./abap_transpile"
|
|
7
|
+
},
|
|
8
|
+
"types": "./build/types.d.ts",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"ABAP",
|
|
11
|
+
"abaplint"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/abaplint/transpiler.git"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "tsc && npm run webpack",
|
|
19
|
+
"publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
20
|
+
"publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
21
|
+
"compile": "npm test",
|
|
22
|
+
"webpack": "webpack --progress"
|
|
23
|
+
},
|
|
24
|
+
"author": "abaplint",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@abaplint/transpiler": "^1.8.37",
|
|
28
|
+
"@types/glob": "^7.2.0",
|
|
29
|
+
"glob": "^7.2.0",
|
|
30
|
+
"@types/progress": "^2.0.5",
|
|
31
|
+
"@abaplint/core": "^2.86.6",
|
|
32
|
+
"progress": "^2.0.3",
|
|
33
|
+
"webpack": "^5.71.0",
|
|
34
|
+
"webpack-cli": "^4.9.2",
|
|
35
|
+
"typescript": "^4.6.3"
|
|
36
|
+
}
|
|
37
|
+
}
|