@abaplint/transpiler-cli 2.3.122 → 2.3.123

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 +22 -2
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -72561,7 +72561,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
72561
72561
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
72562
72562
  class LoopTranspiler {
72563
72563
  transpile(node, traversal) {
72564
- var _a, _b;
72564
+ var _a, _b, _c;
72565
72565
  if (!(node.get() instanceof abaplint.Statements.Loop)) {
72566
72566
  throw new Error("LoopTranspiler, unexpected node");
72567
72567
  }
@@ -72620,12 +72620,32 @@ class LoopTranspiler {
72620
72620
  extra.push(`usingKey: "${keyNode.concatTokens()}"`);
72621
72621
  }
72622
72622
  }
72623
- const whereNode = node.findFirstExpression(abaplint.Expressions.ComponentCond);
72623
+ const whereNode = node.findDirectExpression(abaplint.Expressions.ComponentCond);
72624
72624
  if (whereNode) {
72625
72625
  const where = traversal.traverse(whereNode).getCode();
72626
72626
  // todo, evil workaround removing "await",
72627
72627
  extra.push("where: async " + where);
72628
72628
  }
72629
+ const topEquals = {};
72630
+ for (const compare of (whereNode === null || whereNode === void 0 ? void 0 : whereNode.findDirectExpressions(abaplint.Expressions.ComponentCompare)) || []) {
72631
+ const op = (_c = compare.findDirectExpression(abaplint.Expressions.CompareOperator)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();
72632
+ if (op !== "=" && op !== "EQ") {
72633
+ continue;
72634
+ }
72635
+ else if (compare.findDirectTokenByText("NOT")) {
72636
+ continue;
72637
+ }
72638
+ const tchain = traversal.traverse(compare.findDirectExpression(abaplint.Expressions.ComponentChainSimple));
72639
+ const tsource = traversal.traverse(compare.findDirectExpression(abaplint.Expressions.Source));
72640
+ topEquals[tchain.getCode()] = tsource.getCode();
72641
+ }
72642
+ if (Object.keys(topEquals).length > 0) {
72643
+ const fields = [];
72644
+ for (const n in topEquals) {
72645
+ fields.push(`"${n}": ` + topEquals[n]);
72646
+ }
72647
+ extra.push("topEquals: {" + fields.join(",") + "}");
72648
+ }
72629
72649
  let concat = "";
72630
72650
  if (extra.length > 0) {
72631
72651
  concat = ",{" + extra.join(",") + "}";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.3.122",
3
+ "version": "2.3.123",
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.122",
28
+ "@abaplint/transpiler": "^2.3.123",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",