@abaplint/transpiler-cli 2.1.55 → 2.1.58
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 +3 -3
- 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
|
|
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
|
|
|
@@ -14052,7 +14052,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
14052
14052
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
14053
14053
|
|
|
14054
14054
|
"use strict";
|
|
14055
|
-
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 else if (concat.includes(\" LIKE \")) {\r\n const so = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));\r\n options.push(`\"like\": ` + so.getCode());\r\n }\r\n const handle = node.findExpressionAfterToken(\"HANDLE\");\r\n if (handle) {\r\n const so = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));\r\n
|
|
14055
|
+
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 else if (concat.includes(\" LIKE \")) {\r\n const so = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));\r\n options.push(`\"like\": ` + so.getCode());\r\n }\r\n const handle = node.findExpressionAfterToken(\"HANDLE\");\r\n if (handle) {\r\n const so = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));\r\n const lookup = traversal.lookupClassOrInterface(\"KERNEL_CREATE_DATA_HANDLE\", node.getFirstToken());\r\n const call = `await ${lookup}.call({handle: ${so.getCode()}, dref: ${target.getCode()}});`;\r\n return new chunk_1.Chunk().append(`if (${lookup} === undefined) throw new Error(\"CreateData, kernel class missing\");\\n${call}`, node, traversal);\r\n }\r\n const length = node.findExpressionAfterToken(\"LENGTH\");\r\n if (length) {\r\n const so = traversal.traverse(length);\r\n options.push(`\"length\": ` + 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?");
|
|
14056
14056
|
|
|
14057
14057
|
/***/ }),
|
|
14058
14058
|
|
|
@@ -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
|
|
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.
|
|
3
|
+
"version": "2.1.58",
|
|
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.
|
|
28
|
+
"@abaplint/transpiler": "^2.1.58",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|