@abaplint/transpiler-cli 2.1.2 → 2.1.3

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 +1 -1
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -14866,7 +14866,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14866
14866
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14867
14867
 
14868
14868
  "use strict";
14869
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst select_1 = __webpack_require__(/*! ../statements/select */ \"./node_modules/@abaplint/transpiler/build/src/statements/select.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 SelectTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const ret = new chunk_1.Chunk();\r\n const selectStatement = node.findFirstStatement(abaplint.Statements.SelectLoop);\r\n if (selectStatement === undefined) {\r\n throw \"Structure, select loop not found\";\r\n }\r\n const from = (_a = selectStatement.findFirstExpression(abaplint.Expressions.SQLFromSource)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n const intoName = (_b = selectStatement.findFirstExpression(abaplint.Expressions.SQLTarget)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n // note: this implementation SELECTs everything into memory, which might be bad, and sometimes not correct\r\n const targetName = unique_identifier_1.UniqueIdentifier.get();\r\n const loopName = unique_identifier_1.UniqueIdentifier.get();\r\n ret.appendString(`let ${targetName} = new abap.types.Table(abap.DDIC[\"${from}\"].type);\\n`);\r\n ret.appendChunk(new select_1.SelectTranspiler().transpile(selectStatement, traversal, targetName));\r\n ret.appendString(`\\nfor (const ${loopName} of ${targetName}.array()) {\\n`);\r\n ret.appendString(`${intoName} = ${loopName};\\n`);\r\n const body = node.findDirectStructure(abaplint.Structures.Body);\r\n if (body) {\r\n ret.appendChunk(traversal.traverse(body));\r\n }\r\n ret.appendString(\"}\\n\");\r\n return ret;\r\n }\r\n}\r\nexports.SelectTranspiler = SelectTranspiler;\r\n//# sourceMappingURL=select.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/select.js?");
14869
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst select_1 = __webpack_require__(/*! ../statements/select */ \"./node_modules/@abaplint/transpiler/build/src/statements/select.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 SelectTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const ret = new chunk_1.Chunk();\r\n const selectStatement = node.findFirstStatement(abaplint.Statements.SelectLoop);\r\n if (selectStatement === undefined) {\r\n throw \"Structure, select loop not found\";\r\n }\r\n const from = (_a = selectStatement.findFirstExpression(abaplint.Expressions.SQLFromSource)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n const intoName = (_b = selectStatement.findFirstExpression(abaplint.Expressions.SQLTarget)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n // note: this implementation SELECTs everything into memory, which might be bad, and sometimes not correct\r\n const targetName = unique_identifier_1.UniqueIdentifier.get();\r\n const loopName = unique_identifier_1.UniqueIdentifier.get();\r\n ret.appendString(`let ${targetName} = new abap.types.Table(abap.DDIC[\"${from}\"].type);\\n`);\r\n ret.appendChunk(new select_1.SelectTranspiler().transpile(selectStatement, traversal, targetName));\r\n ret.appendString(`\\nfor (const ${loopName} of ${targetName}.array()) {\\n`);\r\n ret.appendString(`${intoName === null || intoName === void 0 ? void 0 : intoName.replace(\"-\", \".get().\")}.set(${loopName});\\n`);\r\n const body = node.findDirectStructure(abaplint.Structures.Body);\r\n if (body) {\r\n ret.appendChunk(traversal.traverse(body));\r\n }\r\n ret.appendString(\"}\\n\");\r\n return ret;\r\n }\r\n}\r\nexports.SelectTranspiler = SelectTranspiler;\r\n//# sourceMappingURL=select.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/structures/select.js?");
14870
14870
 
14871
14871
  /***/ }),
14872
14872
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
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.2",
28
+ "@abaplint/transpiler": "^2.1.3",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",