@abaplint/transpiler-cli 2.3.16 → 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.
Files changed (2) hide show
  1. package/build/bundle.js +2 -2
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -13227,7 +13227,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
13227
13227
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13228
13228
 
13229
13229
  "use strict";
13230
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ArithOperatorTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ArithOperatorTranspiler {\r\n transpile(node, traversal) {\r\n switch (node.concatTokens().toUpperCase()) {\r\n case \"+\":\r\n return new chunk_1.Chunk().append(\"abap.operators.add\", node, traversal);\r\n case \"-\":\r\n return new chunk_1.Chunk().append(\"abap.operators.minus\", node, traversal);\r\n case \"*\":\r\n return new chunk_1.Chunk().append(\"abap.operators.multiply\", node, traversal);\r\n case \"/\":\r\n return new chunk_1.Chunk().append(\"abap.operators.divide\", node, traversal);\r\n case \"**\":\r\n return new chunk_1.Chunk().append(\"abap.operators.power\", node, traversal);\r\n case \"DIV\":\r\n return new chunk_1.Chunk().append(\"abap.operators.div\", node, traversal);\r\n case \"MOD\":\r\n return new chunk_1.Chunk().append(\"abap.operators.mod\", node, traversal);\r\n case \"BIT-AND\":\r\n return new chunk_1.Chunk().append(\"abap.operators.bitand\", node, traversal);\r\n case \"BIT-OR\":\r\n return new chunk_1.Chunk().append(\"abap.operators.bitor\", node, traversal);\r\n case \"BIT-XOR\":\r\n return new chunk_1.Chunk().append(\"abap.operators.bitxor\", node, traversal);\r\n default:\r\n return new chunk_1.Chunk().append(\".ArithOperatorUnknown\", node, traversal);\r\n }\r\n }\r\n}\r\nexports.ArithOperatorTranspiler = ArithOperatorTranspiler;\r\n//# sourceMappingURL=arith_operator.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/arith_operator.js?");
13230
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ArithOperatorTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ArithOperatorTranspiler {\r\n transpile(node, traversal) {\r\n let search = node.concatTokens().toUpperCase();\r\n // macro workaround,\r\n search = search.replace(/ /g, \"\");\r\n switch (search) {\r\n case \"+\":\r\n return new chunk_1.Chunk().append(\"abap.operators.add\", node, traversal);\r\n case \"-\":\r\n return new chunk_1.Chunk().append(\"abap.operators.minus\", node, traversal);\r\n case \"*\":\r\n return new chunk_1.Chunk().append(\"abap.operators.multiply\", node, traversal);\r\n case \"/\":\r\n return new chunk_1.Chunk().append(\"abap.operators.divide\", node, traversal);\r\n case \"**\":\r\n return new chunk_1.Chunk().append(\"abap.operators.power\", node, traversal);\r\n case \"DIV\":\r\n return new chunk_1.Chunk().append(\"abap.operators.div\", node, traversal);\r\n case \"MOD\":\r\n return new chunk_1.Chunk().append(\"abap.operators.mod\", node, traversal);\r\n case \"BIT-AND\":\r\n return new chunk_1.Chunk().append(\"abap.operators.bitand\", node, traversal);\r\n case \"BIT-OR\":\r\n return new chunk_1.Chunk().append(\"abap.operators.bitor\", node, traversal);\r\n case \"BIT-XOR\":\r\n return new chunk_1.Chunk().append(\"abap.operators.bitxor\", node, traversal);\r\n default:\r\n console.dir(search);\r\n return new chunk_1.Chunk().append(\".ArithOperatorUnknown\", node, traversal);\r\n }\r\n }\r\n}\r\nexports.ArithOperatorTranspiler = ArithOperatorTranspiler;\r\n//# sourceMappingURL=arith_operator.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/arith_operator.js?");
13231
13231
 
13232
13232
  /***/ }),
13233
13233
 
@@ -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}.${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?");
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.16",
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.16",
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",