@abaplint/transpiler-cli 2.2.12 → 2.2.13
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 +2 -2
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -13502,7 +13502,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13502
13502
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13503
13503
|
|
|
13504
13504
|
"use strict";
|
|
13505
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallBodyTranspiler = void 0;\r\nconst core_1 = __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 MethodCallBodyTranspiler {\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof core_1.Nodes.TokenNode) {\r\n // PARAMETER-TABLE\r\n continue;\r\n }\r\n else {\r\n ret.appendChunk(traversal.traverse(c));\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.MethodCallBodyTranspiler = MethodCallBodyTranspiler;\r\n//# sourceMappingURL=method_call_body.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/method_call_body.js?");
|
|
13505
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodCallBodyTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst core_1 = __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 method_call_param_1 = __webpack_require__(/*! ./method_call_param */ \"./node_modules/@abaplint/transpiler/build/src/expressions/method_call_param.js\");\r\nclass MethodCallBodyTranspiler {\r\n constructor(m) {\r\n this.m = m;\r\n }\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof core_1.Nodes.TokenNode) {\r\n // PARAMETER-TABLE\r\n continue;\r\n }\r\n else if (c.get() instanceof abaplint.Expressions.MethodCallParam) {\r\n ret.appendChunk(new method_call_param_1.MethodCallParamTranspiler(this.m).transpile(c, traversal));\r\n }\r\n else {\r\n ret.appendChunk(traversal.traverse(c));\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.MethodCallBodyTranspiler = MethodCallBodyTranspiler;\r\n//# sourceMappingURL=method_call_body.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/method_call_body.js?");
|
|
13506
13506
|
|
|
13507
13507
|
/***/ }),
|
|
13508
13508
|
|
|
@@ -13920,7 +13920,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13920
13920
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13921
13921
|
|
|
13922
13922
|
"use strict";
|
|
13923
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallTranspiler = 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\nclass CallTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b, _c, _d;\r\n const chain = node.findDirectExpression(abaplint.Expressions.MethodCallChain);\r\n if (chain) {\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_b = (_a = chain.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.ParameterT)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(abaplint.Expressions.Target);\r\n if (receiving) {\r\n pre = traversal.traverse(receiving).getCode() + \".set(\";\r\n post = \")\";\r\n }\r\n const exceptions = node.findFirstExpression(abaplint.Expressions.ParameterListExceptions);\r\n if (exceptions) {\r\n pre = \"try {\\n\" + pre;\r\n }\r\n post += \";\";\r\n if (exceptions) {\r\n post += `\\nabap.builtin.sy.get().subrc.set(0);\r\n} catch (e) {\r\nif (e.classic) {\r\n switch (e.classic.toUpperCase()) {\\n`;\r\n for (const e of exceptions.findAllExpressions(abaplint.Expressions.ParameterException)) {\r\n const name = e.getFirstToken().getStr().toUpperCase();\r\n const value = (_c = e.findFirstExpression(abaplint.Expressions.SimpleName)) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStr().toUpperCase();\r\n if (value === undefined) {\r\n continue;\r\n }\r\n if (name === \"OTHERS\") {\r\n post += `default: abap.builtin.sy.get().subrc.set(${value}); break;\\n`;\r\n }\r\n else {\r\n post += `case \"${name}\": abap.builtin.sy.get().subrc.set(${value}); break;\\n`;\r\n }\r\n }\r\n post += ` }\r\n} else {\r\n throw e;\r\n}\r\n}`;\r\n }\r\n const chainChunk = traversal.traverse(chain);\r\n let chainCode = chainChunk.getCode();\r\n if (chainCode.startsWith(\"await super.constructor(\")) {\r\n // semantics of constructors in JS vs ABAP is different, so the \"constructor_\" has been introduced,\r\n chainCode = chainCode.replace(\"await super.constructor(\", \"await super.constructor_(\");\r\n }\r\n return new chunk_1.Chunk()\r\n .appendString(pre)\r\n .appendString(chainCode)\r\n .append(post, node.getLastToken(), traversal);\r\n }\r\n const methodSource = node.findDirectExpression(abaplint.Expressions.MethodSource);\r\n if (methodSource) {\r\n let body = \"\";\r\n const methodCallBody = node.findDirectExpression(abaplint.Expressions.MethodCallBody);\r\n if (methodCallBody) {\r\n body =
|
|
13923
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallTranspiler = 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\nclass CallTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b, _c, _d, _e;\r\n const chain = node.findDirectExpression(abaplint.Expressions.MethodCallChain);\r\n if (chain) {\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_b = (_a = chain.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.ParameterT)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(abaplint.Expressions.Target);\r\n if (receiving) {\r\n pre = traversal.traverse(receiving).getCode() + \".set(\";\r\n post = \")\";\r\n }\r\n const exceptions = node.findFirstExpression(abaplint.Expressions.ParameterListExceptions);\r\n if (exceptions) {\r\n pre = \"try {\\n\" + pre;\r\n }\r\n post += \";\";\r\n if (exceptions) {\r\n post += `\\nabap.builtin.sy.get().subrc.set(0);\r\n} catch (e) {\r\nif (e.classic) {\r\n switch (e.classic.toUpperCase()) {\\n`;\r\n for (const e of exceptions.findAllExpressions(abaplint.Expressions.ParameterException)) {\r\n const name = e.getFirstToken().getStr().toUpperCase();\r\n const value = (_c = e.findFirstExpression(abaplint.Expressions.SimpleName)) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStr().toUpperCase();\r\n if (value === undefined) {\r\n continue;\r\n }\r\n if (name === \"OTHERS\") {\r\n post += `default: abap.builtin.sy.get().subrc.set(${value}); break;\\n`;\r\n }\r\n else {\r\n post += `case \"${name}\": abap.builtin.sy.get().subrc.set(${value}); break;\\n`;\r\n }\r\n }\r\n post += ` }\r\n} else {\r\n throw e;\r\n}\r\n}`;\r\n }\r\n const chainChunk = traversal.traverse(chain);\r\n let chainCode = chainChunk.getCode();\r\n if (chainCode.startsWith(\"await super.constructor(\")) {\r\n // semantics of constructors in JS vs ABAP is different, so the \"constructor_\" has been introduced,\r\n chainCode = chainCode.replace(\"await super.constructor(\", \"await super.constructor_(\");\r\n }\r\n return new chunk_1.Chunk()\r\n .appendString(pre)\r\n .appendString(chainCode)\r\n .append(post, node.getLastToken(), traversal);\r\n }\r\n const methodSource = node.findDirectExpression(abaplint.Expressions.MethodSource);\r\n if (methodSource) {\r\n let body = \"\";\r\n const nameToken = (_d = methodSource.getLastChild()) === null || _d === void 0 ? void 0 : _d.getFirstToken();\r\n const m = nameToken ? traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken)) : undefined;\r\n const methodCallBody = node.findDirectExpression(abaplint.Expressions.MethodCallBody);\r\n if (methodCallBody) {\r\n body = new expressions_1.MethodCallBodyTranspiler(m === null || m === void 0 ? void 0 : m.def).transpile(methodCallBody, traversal).getCode();\r\n }\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_e = node.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _e === void 0 ? void 0 : _e.findExpressionAfterToken(\"RECEIVING\");\r\n if (receiving) {\r\n const target = traversal.traverse(receiving.findDirectExpression(abaplint.Expressions.Target));\r\n pre = target.getCode() + \".set(\";\r\n post = \")\";\r\n }\r\n let ms = new expressions_1.MethodSourceTranspiler(pre).transpile(methodSource, traversal).getCode();\r\n if (ms === \"await super.get().constructor\") {\r\n // semantics of constructors in JS vs ABAP is different, so the \"constructor_\" has been introduced,\r\n ms = \"await super.constructor_\";\r\n }\r\n return new chunk_1.Chunk().appendString(ms).appendString(\"(\" + body + \")\" + post + \";\");\r\n }\r\n throw new Error(\"CallTranspiler, todo\");\r\n }\r\n}\r\nexports.CallTranspiler = CallTranspiler;\r\n//# sourceMappingURL=call.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/call.js?");
|
|
13924
13924
|
|
|
13925
13925
|
/***/ }),
|
|
13926
13926
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.13",
|
|
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.2.
|
|
28
|
+
"@abaplint/transpiler": "^2.2.13",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|