@abaplint/transpiler-cli 2.1.56 → 2.1.57

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
@@ -13865,7 +13865,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
13865
13865
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13866
13866
 
13867
13867
  "use strict";
13868
- 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;\r\n if (node.concatTokens().toLowerCase().includes(\"super->constructor\")) {\r\n // todo, https://github.com/abaplint/transpiler/issues/133\r\n return new chunk_1.Chunk(\"\");\r\n }\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 return new chunk_1.Chunk()\r\n .appendString(pre)\r\n .appendChunk(traversal.traverse(chain))\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 = traversal.traverse(methodCallBody).getCode();\r\n }\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_c = node.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _c === void 0 ? void 0 : _c.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 const ms = new expressions_1.MethodSourceTranspiler(pre).transpile(methodSource, traversal);\r\n return new chunk_1.Chunk().appendChunk(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?");
13868
+ 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 if (node.concatTokens().toLowerCase().includes(\"super->constructor\")) {\r\n // todo, https://github.com/abaplint/transpiler/issues/133\r\n return new chunk_1.Chunk(\"\");\r\n }\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);\n} catch (e) {\nif (e.classic) {\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 += ` }\n} else {\n throw e;\n}\n}`;\r\n }\r\n return new chunk_1.Chunk()\r\n .appendString(pre)\r\n .appendChunk(traversal.traverse(chain))\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 = traversal.traverse(methodCallBody).getCode();\r\n }\r\n let pre = \"\";\r\n let post = \"\";\r\n const receiving = (_d = node.findFirstExpression(abaplint.Expressions.MethodParameters)) === null || _d === void 0 ? void 0 : _d.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 const ms = new expressions_1.MethodSourceTranspiler(pre).transpile(methodSource, traversal);\r\n return new chunk_1.Chunk().appendChunk(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?");
13869
13869
 
13870
13870
  /***/ }),
13871
13871
 
@@ -14646,7 +14646,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14646
14646
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14647
14647
 
14648
14648
  "use strict";
14649
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RaiseTranspiler = 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 RaiseTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const classNameToken = (_a = node.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n const className = classNameToken === null || classNameToken === void 0 ? void 0 : classNameToken.getStr();\r\n if (className === undefined) {\r\n const s = node.findFirstExpression(abaplint.Expressions.SimpleSource2);\r\n if (s === undefined) {\r\n const name = (_b = node.findFirstExpression(abaplint.Expressions.ExceptionName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toLowerCase();\r\n return new chunk_1.Chunk().append(`throw new Error({classic: \"${name}\"});`, node, traversal);\r\n }\r\n const sCode = new expressions_1.SourceTranspiler(true).transpile(s, traversal).getCode();\r\n return new chunk_1.Chunk().append(`throw ${sCode};`, node, traversal);\r\n }\r\n let p = \"\";\r\n const parameters = node.findFirstExpression(abaplint.Expressions.ParameterListS);\r\n if (parameters) {\r\n p = traversal.traverse(parameters).getCode();\r\n }\r\n const look = traversal.lookupClassOrInterface(classNameToken === null || classNameToken === void 0 ? void 0 : classNameToken.getStr(), classNameToken);\r\n return new chunk_1.Chunk().append(`throw await (new ${look}()).constructor_(${p});`, node, traversal);\r\n }\r\n}\r\nexports.RaiseTranspiler = RaiseTranspiler;\r\n//# sourceMappingURL=raise.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/raise.js?");
14649
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RaiseTranspiler = 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 RaiseTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const classNameToken = (_a = node.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n const className = classNameToken === null || classNameToken === void 0 ? void 0 : classNameToken.getStr();\r\n if (className === undefined) {\r\n const s = node.findFirstExpression(abaplint.Expressions.SimpleSource2);\r\n if (s === undefined) {\r\n const name = (_b = node.findFirstExpression(abaplint.Expressions.ExceptionName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toLowerCase();\r\n return new chunk_1.Chunk().append(`throw new abap.ClassicError({classic: \"${name}\"});`, node, traversal);\r\n }\r\n const sCode = new expressions_1.SourceTranspiler(true).transpile(s, traversal).getCode();\r\n return new chunk_1.Chunk().append(`throw ${sCode};`, node, traversal);\r\n }\r\n let p = \"\";\r\n const parameters = node.findFirstExpression(abaplint.Expressions.ParameterListS);\r\n if (parameters) {\r\n p = traversal.traverse(parameters).getCode();\r\n }\r\n const look = traversal.lookupClassOrInterface(classNameToken === null || classNameToken === void 0 ? void 0 : classNameToken.getStr(), classNameToken);\r\n return new chunk_1.Chunk().append(`throw await (new ${look}()).constructor_(${p});`, node, traversal);\r\n }\r\n}\r\nexports.RaiseTranspiler = RaiseTranspiler;\r\n//# sourceMappingURL=raise.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/raise.js?");
14650
14650
 
14651
14651
  /***/ }),
14652
14652
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.1.56",
3
+ "version": "2.1.57",
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.1.56",
28
+ "@abaplint/transpiler": "^2.1.57",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",