@abaplint/transpiler-cli 2.3.26 → 2.3.28

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 +29 -7
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -14217,7 +14217,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14217
14217
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14218
14218
 
14219
14219
  "use strict";
14220
- 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 else {\r\n options.push(`\"typeName\": \"${typeNameNode.concatTokens().toUpperCase()}\"`);\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?");
14220
+ 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 else {\r\n options.push(`\"typeName\": \"${typeNameNode.concatTokens().toUpperCase()}\"`);\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 const decimals = node.findExpressionAfterToken(\"DECIMALS\");\r\n if (decimals) {\r\n const so = traversal.traverse(decimals);\r\n options.push(`\"decimals\": ` + 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?");
14221
14221
 
14222
14222
  /***/ }),
14223
14223
 
@@ -14305,7 +14305,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14305
14305
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14306
14306
 
14307
14307
  "use strict";
14308
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DoTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass DoTranspiler {\r\n transpile(node, traversal) {\r\n const found = node.findFirstExpression(abaplint.Expressions.Source);\r\n if (found) {\r\n const source = new expressions_1.SourceTranspiler(true).transpile(found, traversal).getCode();\r\n const idSource = unique_identifier_1.UniqueIdentifier.get();\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${idSource} = ${source};\r\nfor (let ${id} = 0; ${id} < ${idSource}; ${id}++) {\r\nabap.builtin.sy.get().index.set(${id} + 1);`);\r\n }\r\n else {\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`let ${unique} = 1;\r\nwhile (true) {\r\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n }\r\n}\r\nexports.DoTranspiler = DoTranspiler;\r\n//# sourceMappingURL=do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/do.js?");
14308
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DoTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass DoTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n const found = node.findFirstExpression(abaplint.Expressions.Source);\r\n if (found) {\r\n const source = new expressions_1.SourceTranspiler(true).transpile(found, traversal).getCode();\r\n const idSource = unique_identifier_1.UniqueIdentifier.get();\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\r\nconst ${idSource} = ${source};\r\nfor (let ${id} = 0; ${id} < ${idSource}; ${id}++) {\r\nabap.builtin.sy.get().index.set(${id} + 1);`);\r\n }\r\n else {\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\r\nlet ${unique} = 1;\r\nwhile (true) {\r\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n }\r\n}\r\nexports.DoTranspiler = DoTranspiler;\r\n//# sourceMappingURL=do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/do.js?");
14309
14309
 
14310
14310
  /***/ }),
14311
14311
 
@@ -14371,7 +14371,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14371
14371
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14372
14372
 
14373
14373
  "use strict";
14374
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndDoTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndDoTranspiler {\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(\"}\", node, traversal);\r\n }\r\n}\r\nexports.EndDoTranspiler = EndDoTranspiler;\r\n//# sourceMappingURL=end_do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/end_do.js?");
14374
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndDoTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndDoTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(`}\r\nabap.builtin.sy.get().index.set(${this.syIndexBackup});`, node, traversal);\r\n }\r\n}\r\nexports.EndDoTranspiler = EndDoTranspiler;\r\n//# sourceMappingURL=end_do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/end_do.js?");
14375
14375
 
14376
14376
  /***/ }),
14377
14377
 
@@ -14448,7 +14448,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14448
14448
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14449
14449
 
14450
14450
  "use strict";
14451
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndWhileTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndWhileTranspiler {\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(\"}\", node, traversal);\r\n }\r\n}\r\nexports.EndWhileTranspiler = EndWhileTranspiler;\r\n//# sourceMappingURL=end_while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/end_while.js?");
14451
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.EndWhileTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass EndWhileTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n return new chunk_1.Chunk().append(`}\r\nabap.builtin.sy.get().index.set(${this.syIndexBackup});`, node, traversal);\r\n }\r\n}\r\nexports.EndWhileTranspiler = EndWhileTranspiler;\r\n//# sourceMappingURL=end_while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/end_while.js?");
14452
14452
 
14453
14453
  /***/ }),
14454
14454
 
@@ -15284,7 +15284,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15284
15284
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15285
15285
 
15286
15286
  "use strict";
15287
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhileTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass WhileTranspiler {\r\n transpile(node, traversal) {\r\n const cond = new expressions_1.CondTranspiler().transpile(node.findFirstExpression(abaplint.Expressions.Cond), traversal);\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk()\r\n .append(`let ${unique} = 1;\r\nwhile (`, node, traversal)\r\n .appendChunk(cond)\r\n .appendString(`) {\r\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n}\r\nexports.WhileTranspiler = WhileTranspiler;\r\n//# sourceMappingURL=while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/while.js?");
15287
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhileTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass WhileTranspiler {\r\n constructor(syIndexBackup) {\r\n this.syIndexBackup = syIndexBackup;\r\n }\r\n transpile(node, traversal) {\r\n const cond = new expressions_1.CondTranspiler().transpile(node.findFirstExpression(abaplint.Expressions.Cond), traversal);\r\n const unique = unique_identifier_1.UniqueIdentifier.get();\r\n return new chunk_1.Chunk()\r\n .append(`const ${this.syIndexBackup} = abap.builtin.sy.get().index.get();\r\nlet ${unique} = 1;\r\nwhile (`, node, traversal)\r\n .appendChunk(cond)\r\n .appendString(`) {\r\nabap.builtin.sy.get().index.set(${unique}++);`);\r\n }\r\n}\r\nexports.WhileTranspiler = WhileTranspiler;\r\n//# sourceMappingURL=while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/while.js?");
15288
15288
 
15289
15289
  /***/ }),
15290
15290
 
@@ -15365,6 +15365,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15365
15365
 
15366
15366
  /***/ }),
15367
15367
 
15368
+ /***/ "./node_modules/@abaplint/transpiler/build/src/structures/do.js":
15369
+ /*!**********************************************************************!*\
15370
+ !*** ./node_modules/@abaplint/transpiler/build/src/structures/do.js ***!
15371
+ \**********************************************************************/
15372
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15373
+
15374
+ "use strict";
15375
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DoTranspiler = 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 statements_1 = __webpack_require__(/*! ../statements */ \"./node_modules/@abaplint/transpiler/build/src/statements/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass DoTranspiler {\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n const syIndexBackup = unique_identifier_1.UniqueIdentifier.get();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.Do) {\r\n ret.appendChunk(new statements_1.DoTranspiler(syIndexBackup).transpile(c, traversal));\r\n ret.appendString(\"\\n\");\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndDo) {\r\n ret.appendChunk(new statements_1.EndDoTranspiler(syIndexBackup).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.DoTranspiler = DoTranspiler;\r\n//# sourceMappingURL=do.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/do.js?");
15376
+
15377
+ /***/ }),
15378
+
15368
15379
  /***/ "./node_modules/@abaplint/transpiler/build/src/structures/function_module.js":
15369
15380
  /*!***********************************************************************************!*\
15370
15381
  !*** ./node_modules/@abaplint/transpiler/build/src/structures/function_module.js ***!
@@ -15372,7 +15383,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15372
15383
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15373
15384
 
15374
15385
  "use strict";
15375
- 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?");
15386
+ 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\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.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, c);\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, node) {\r\n var _a;\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 const scope = traversal.findCurrentScopeByToken(node.getLastToken());\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 const name = p.name.toLowerCase();\r\n ret += `let ${name} = INPUT.${direction}?.${name};\\n`;\r\n if (direction === \"exporting\" || direction === \"importing\" || direction === \"changing\") {\r\n const type = (_a = scope === null || scope === void 0 ? void 0 : scope.findVariable(name)) === null || _a === void 0 ? void 0 : _a.getType();\r\n if (type !== undefined) {\r\n // todo, set DEFAULT value\r\n // todo, check for OPTIONALness and raise exceptions and stuff\r\n ret += `if (${name} === undefined) {\r\n ${name} = ${new transpile_types_1.TranspileTypes().toType(type)};\r\n }\\n`;\r\n }\r\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?");
15376
15387
 
15377
15388
  /***/ }),
15378
15389
 
@@ -15383,7 +15394,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15383
15394
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
15384
15395
 
15385
15396
  "use strict";
15386
- eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./case */ \"./node_modules/@abaplint/transpiler/build/src/structures/case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition */ \"./node_modules/@abaplint/transpiler/build/src/structures/class_definition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_implementation */ \"./node_modules/@abaplint/transpiler/build/src/structures/class_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constants */ \"./node_modules/@abaplint/transpiler/build/src/structures/constants.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data */ \"./node_modules/@abaplint/transpiler/build/src/structures/data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module */ \"./node_modules/@abaplint/transpiler/build/src/structures/function_module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface */ \"./node_modules/@abaplint/transpiler/build/src/structures/interface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select */ \"./node_modules/@abaplint/transpiler/build/src/structures/select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try */ \"./node_modules/@abaplint/transpiler/build/src/structures/try.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./define */ \"./node_modules/@abaplint/transpiler/build/src/structures/define.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./types */ \"./node_modules/@abaplint/transpiler/build/src/structures/types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when */ \"./node_modules/@abaplint/transpiler/build/src/structures/when.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/index.js?");
15397
+ eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./case */ \"./node_modules/@abaplint/transpiler/build/src/structures/case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition */ \"./node_modules/@abaplint/transpiler/build/src/structures/class_definition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_implementation */ \"./node_modules/@abaplint/transpiler/build/src/structures/class_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constants */ \"./node_modules/@abaplint/transpiler/build/src/structures/constants.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data */ \"./node_modules/@abaplint/transpiler/build/src/structures/data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./define */ \"./node_modules/@abaplint/transpiler/build/src/structures/define.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./do */ \"./node_modules/@abaplint/transpiler/build/src/structures/do.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module */ \"./node_modules/@abaplint/transpiler/build/src/structures/function_module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface */ \"./node_modules/@abaplint/transpiler/build/src/structures/interface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./while */ \"./node_modules/@abaplint/transpiler/build/src/structures/while.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select */ \"./node_modules/@abaplint/transpiler/build/src/structures/select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try */ \"./node_modules/@abaplint/transpiler/build/src/structures/try.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./types */ \"./node_modules/@abaplint/transpiler/build/src/structures/types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when */ \"./node_modules/@abaplint/transpiler/build/src/structures/when.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/index.js?");
15387
15398
 
15388
15399
  /***/ }),
15389
15400
 
@@ -15442,6 +15453,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15442
15453
 
15443
15454
  /***/ }),
15444
15455
 
15456
+ /***/ "./node_modules/@abaplint/transpiler/build/src/structures/while.js":
15457
+ /*!*************************************************************************!*\
15458
+ !*** ./node_modules/@abaplint/transpiler/build/src/structures/while.js ***!
15459
+ \*************************************************************************/
15460
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15461
+
15462
+ "use strict";
15463
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhileTranspiler = 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 statements_1 = __webpack_require__(/*! ../statements */ \"./node_modules/@abaplint/transpiler/build/src/statements/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nclass WhileTranspiler {\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n const syIndexBackup = unique_identifier_1.UniqueIdentifier.get();\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.While) {\r\n ret.appendChunk(new statements_1.WhileTranspiler(syIndexBackup).transpile(c, traversal));\r\n ret.appendString(\"\\n\");\r\n }\r\n else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndWhile) {\r\n ret.appendChunk(new statements_1.EndWhileTranspiler(syIndexBackup).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.WhileTranspiler = WhileTranspiler;\r\n//# sourceMappingURL=while.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/while.js?");
15464
+
15465
+ /***/ }),
15466
+
15445
15467
  /***/ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js":
15446
15468
  /*!************************************************************************!*\
15447
15469
  !*** ./node_modules/@abaplint/transpiler/build/src/transpile_types.js ***!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.3.26",
3
+ "version": "2.3.28",
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.26",
28
+ "@abaplint/transpiler": "^2.3.28",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",