@abaplint/transpiler-cli 2.3.17 → 2.3.18
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/build/bundle.js +1 -1
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -15317,7 +15317,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15317
15317
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15318
15318
|
|
|
15319
15319
|
"use strict";
|
|
15320
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionModuleTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass FunctionModuleTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let r = \"\";\r\n let name = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c.get() instanceof abaplint.Statements.FunctionModule && c instanceof abaplint.Nodes.StatementNode) {\r\n name = (_a = c.findDirectExpression(abaplint.Expressions.Field)) === null || _a === void 0 ? void 0 : _a.concatTokens().toLowerCase();\r\n if (name === undefined) {\r\n name = \"FunctionModuleTranspilerNameNotFound\";\r\n }\r\n r += `async function ${traversal_1.Traversal.escapeClassName(name)}(INPUT) {\\n`;\r\n r += this.findSignature(traversal, name);\r\n }\r\n else if (c.get() instanceof abaplint.Statements.EndFunction) {\r\n r += \"}\\n\";\r\n r += `abap.FunctionModules['${name.toUpperCase()}'] = ${traversal_1.Traversal.escapeClassName(name)};\\n`;\r\n }\r\n else {\r\n r += traversal.traverse(c).getCode();\r\n }\r\n }\r\n return new chunk_1.Chunk(r);\r\n }\r\n //////////////////////\r\n findSignature(traversal, name) {\r\n const group = traversal.getCurrentObject();\r\n if (group === undefined) {\r\n throw \"FunctionModuleTranspilerGroupNotFound\";\r\n }\r\n const module = group.getModule(name);\r\n if (module === undefined) {\r\n throw \"FunctionModuleTranspilerModuleNotFound\";\r\n }\r\n let ret = \"\";\r\n for (const p of module.getParameters()) {\r\n ret += `// ${p.direction} ${p.name} ${p.type}\\n`;\r\n let direction = p.direction;\r\n if (direction === \"importing\") {\r\n direction = \"exporting\";\r\n }\r\n else if (direction === \"exporting\") {\r\n direction = \"importing\";\r\n }\r\n ret += `let ${p.name.toLowerCase()} = INPUT.${direction}
|
|
15320
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionModuleTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass FunctionModuleTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let r = \"\";\r\n let name = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c.get() instanceof abaplint.Statements.FunctionModule && c instanceof abaplint.Nodes.StatementNode) {\r\n name = (_a = c.findDirectExpression(abaplint.Expressions.Field)) === null || _a === void 0 ? void 0 : _a.concatTokens().toLowerCase();\r\n if (name === undefined) {\r\n name = \"FunctionModuleTranspilerNameNotFound\";\r\n }\r\n r += `async function ${traversal_1.Traversal.escapeClassName(name)}(INPUT) {\\n`;\r\n r += this.findSignature(traversal, name);\r\n }\r\n else if (c.get() instanceof abaplint.Statements.EndFunction) {\r\n r += \"}\\n\";\r\n r += `abap.FunctionModules['${name.toUpperCase()}'] = ${traversal_1.Traversal.escapeClassName(name)};\\n`;\r\n }\r\n else {\r\n r += traversal.traverse(c).getCode();\r\n }\r\n }\r\n return new chunk_1.Chunk(r);\r\n }\r\n //////////////////////\r\n findSignature(traversal, name) {\r\n const group = traversal.getCurrentObject();\r\n if (group === undefined) {\r\n throw \"FunctionModuleTranspilerGroupNotFound\";\r\n }\r\n const module = group.getModule(name);\r\n if (module === undefined) {\r\n throw \"FunctionModuleTranspilerModuleNotFound\";\r\n }\r\n let ret = \"\";\r\n for (const p of module.getParameters()) {\r\n ret += `// ${p.direction} ${p.name} ${p.type}\\n`;\r\n let direction = p.direction;\r\n if (direction === \"importing\") {\r\n direction = \"exporting\";\r\n }\r\n else if (direction === \"exporting\") {\r\n direction = \"importing\";\r\n }\r\n // note: all directions are optional\r\n ret += `let ${p.name.toLowerCase()} = INPUT.${direction}?.${p.name.toLowerCase()};\\n`;\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.FunctionModuleTranspiler = FunctionModuleTranspiler;\r\n//# sourceMappingURL=function_module.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/function_module.js?");
|
|
15321
15321
|
|
|
15322
15322
|
/***/ }),
|
|
15323
15323
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.18",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.3.
|
|
28
|
+
"@abaplint/transpiler": "^2.3.18",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|