@abaplint/transpiler 2.1.14 → 2.1.15

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.
@@ -7,7 +7,7 @@ const expressions_1 = require("../expressions");
7
7
  const unique_identifier_1 = require("../unique_identifier");
8
8
  class SelectTranspiler {
9
9
  transpile(node, traversal, targetOverride) {
10
- var _a, _b, _c, _d, _e;
10
+ var _a, _b, _c, _d, _e, _f;
11
11
  let target = "undefined";
12
12
  if (targetOverride) {
13
13
  target = targetOverride;
@@ -58,8 +58,8 @@ class SelectTranspiler {
58
58
  }
59
59
  if (node.findFirstExpression(abaplint.Expressions.SQLForAllEntries)) {
60
60
  const unique = unique_identifier_1.UniqueIdentifier.get();
61
- const faeName = (_e = (_d = node.findFirstExpression(abaplint.Expressions.SQLForAllEntries)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(abaplint.Expressions.SQLSource)) === null || _e === void 0 ? void 0 : _e.concatTokens();
62
- select = select.replace(faeName, unique);
61
+ const faeName = (_f = (_e = (_d = node.findFirstExpression(abaplint.Expressions.SQLForAllEntries)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(abaplint.Expressions.SQLSource)) === null || _e === void 0 ? void 0 : _e.concatTokens()) === null || _f === void 0 ? void 0 : _f.toLowerCase();
62
+ select = select.replace(new RegExp(" " + faeName, "g"), unique);
63
63
  const code = `if (${faeName}.array().length === 0) {
64
64
  throw "FAE, todo, empty table";
65
65
  } else {
@@ -67,6 +67,7 @@ class SelectTranspiler {
67
67
  for (const ${unique} of abap.statements.loop(${faeName})) {
68
68
  await abap.statements.select(${target}, {select: "${select.trim()}"${extra}}, {appending: true});
69
69
  }
70
+ abap.builtin.sy.get().dbcnt.set(${target}.array().length);
70
71
  }`;
71
72
  return new chunk_1.Chunk().append(code, node, traversal);
72
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.1.14",
3
+ "version": "2.1.15",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",