@abaplint/transpiler-cli 2.3.49 → 2.3.50

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
@@ -14844,7 +14844,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14844
14844
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14845
14845
 
14846
14846
  "use strict";
14847
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LoopTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.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\nclass LoopTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n if (!(node.get() instanceof abaplint.Statements.Loop)) {\r\n throw new Error(\"LoopTranspiler, unexpected node\");\r\n }\r\n const source = traversal.traverse(node.findDirectExpression(abaplint.Expressions.SimpleSource2)).getCode();\r\n const unique1 = unique_identifier_1.UniqueIdentifier.get();\r\n let target = \"\";\r\n const into = (_a = node.findDirectExpression(abaplint.Expressions.LoopTarget)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.Target);\r\n if (into) {\r\n const concat = node.concatTokens().toUpperCase();\r\n const t = traversal.traverse(into).getCode();\r\n const scope = traversal.findCurrentScopeByToken(node.getFirstToken());\r\n const typ = traversal.determineType(node, scope);\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n // target is assumed to be a data reference\r\n target = t + \".assign(\" + unique1 + \");\";\r\n }\r\n else if (typ instanceof abaplint.BasicTypes.DataReference) {\r\n // row type and target is assumed to be data references\r\n target = t + \".assign(\" + unique1 + \".getPointer());\";\r\n }\r\n else {\r\n target = t + \".set(\" + unique1 + \");\";\r\n }\r\n }\r\n else {\r\n const assigning = (_b = node.findFirstExpression(abaplint.Expressions.FSTarget)) === null || _b === void 0 ? void 0 : _b.findFirstExpression(abaplint.Expressions.FieldSymbol);\r\n if (assigning) {\r\n target = traversal.traverse(assigning).getCode() + \".assign(\" + unique1 + \");\";\r\n }\r\n }\r\n const extra = [];\r\n const fromNode = node.findExpressionAfterToken(\"FROM\");\r\n if (fromNode) {\r\n const from = new expressions_1.SourceTranspiler().transpile(fromNode, traversal).getCode();\r\n extra.push(\"from: \" + from);\r\n }\r\n const toNode = node.findExpressionAfterToken(\"TO\");\r\n if (toNode) {\r\n const to = new expressions_1.SourceTranspiler().transpile(toNode, traversal).getCode();\r\n extra.push(\"to: \" + to);\r\n }\r\n const keyNode = node.findExpressionAfterToken(\"KEY\");\r\n if (keyNode) {\r\n extra.push(`usingKey: \"${keyNode.concatTokens()}\"`);\r\n }\r\n const whereNode = node.findFirstExpression(abaplint.Expressions.ComponentCond);\r\n if (whereNode) {\r\n const where = traversal.traverse(whereNode).getCode();\r\n // todo, evil workaround removing \"await\",\r\n extra.push(\"where: async \" + where);\r\n }\r\n let concat = \"\";\r\n if (extra.length > 0) {\r\n concat = \",{\" + extra.join(\",\") + \"}\";\r\n }\r\n return new chunk_1.Chunk(`for await (const ${unique1} of abap.statements.loop(${source}${concat})) {\\n${target}`);\r\n }\r\n}\r\nexports.LoopTranspiler = LoopTranspiler;\r\n//# sourceMappingURL=loop.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/loop.js?");
14847
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LoopTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.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\nclass LoopTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n if (!(node.get() instanceof abaplint.Statements.Loop)) {\r\n throw new Error(\"LoopTranspiler, unexpected node\");\r\n }\r\n const source = traversal.traverse(node.findDirectExpression(abaplint.Expressions.SimpleSource2)).getCode();\r\n const unique1 = unique_identifier_1.UniqueIdentifier.get();\r\n let target = \"\";\r\n const into = (_a = node.findDirectExpression(abaplint.Expressions.LoopTarget)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(abaplint.Expressions.Target);\r\n if (into) {\r\n const concat = node.concatTokens().toUpperCase();\r\n const t = traversal.traverse(into).getCode();\r\n const scope = traversal.findCurrentScopeByToken(node.getFirstToken());\r\n const typ = traversal.determineType(node, scope);\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n // target is assumed to be a data reference\r\n target = t + \".assign(\" + unique1 + \");\";\r\n }\r\n else if (typ instanceof abaplint.BasicTypes.DataReference) {\r\n // row type and target is assumed to be data references\r\n target = t + \".assign(\" + unique1 + \".getPointer());\";\r\n }\r\n else {\r\n target = t + \".set(\" + unique1 + \");\";\r\n }\r\n }\r\n else {\r\n const assigning = (_b = node.findFirstExpression(abaplint.Expressions.FSTarget)) === null || _b === void 0 ? void 0 : _b.findFirstExpression(abaplint.Expressions.FieldSymbol);\r\n if (assigning) {\r\n target = traversal.traverse(assigning).getCode() + \".assign(\" + unique1 + \");\";\r\n }\r\n }\r\n const extra = [];\r\n const fromNode = node.findExpressionAfterToken(\"FROM\");\r\n if (fromNode) {\r\n const from = new expressions_1.SourceTranspiler().transpile(fromNode, traversal).getCode();\r\n extra.push(\"from: \" + from);\r\n }\r\n const toNode = node.findExpressionAfterToken(\"TO\");\r\n if (toNode) {\r\n const to = new expressions_1.SourceTranspiler().transpile(toNode, traversal).getCode();\r\n extra.push(\"to: \" + to);\r\n }\r\n const keyNode = node.findExpressionAfterToken(\"KEY\");\r\n if (keyNode) {\r\n if (keyNode.get() instanceof abaplint.Expressions.Dynamic) {\r\n const children = keyNode.getChildren();\r\n if (children[1] instanceof abaplint.Nodes.ExpressionNode\r\n && children[1].get() instanceof abaplint.Expressions.FieldChain) {\r\n const t = new expressions_1.FieldChainTranspiler(true).transpile(children[1], traversal);\r\n extra.push(`usingKey: ${t.getCode()}`);\r\n }\r\n else {\r\n extra.push(`usingKey: ${keyNode.concatTokens()}`);\r\n }\r\n }\r\n else {\r\n extra.push(`usingKey: \"${keyNode.concatTokens()}\"`);\r\n }\r\n }\r\n const whereNode = node.findFirstExpression(abaplint.Expressions.ComponentCond);\r\n if (whereNode) {\r\n const where = traversal.traverse(whereNode).getCode();\r\n // todo, evil workaround removing \"await\",\r\n extra.push(\"where: async \" + where);\r\n }\r\n let concat = \"\";\r\n if (extra.length > 0) {\r\n concat = \",{\" + extra.join(\",\") + \"}\";\r\n }\r\n return new chunk_1.Chunk(`for await (const ${unique1} of abap.statements.loop(${source}${concat})) {\\n${target}`);\r\n }\r\n}\r\nexports.LoopTranspiler = LoopTranspiler;\r\n//# sourceMappingURL=loop.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/loop.js?");
14848
14848
 
14849
14849
  /***/ }),
14850
14850
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.3.49",
3
+ "version": "2.3.50",
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.49",
28
+ "@abaplint/transpiler": "^2.3.50",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",