@abaplint/transpiler-cli 2.5.45 → 2.5.46

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 +16 -3
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -69140,7 +69140,13 @@ class SQLCondTranspiler {
69140
69140
  }
69141
69141
  }
69142
69142
  else {
69143
- ret += source.concatTokens();
69143
+ const concat = source.concatTokens();
69144
+ if (concat.startsWith("`")) {
69145
+ ret += "'" + concat.substring(1, concat.length - 1) + "'";
69146
+ }
69147
+ else {
69148
+ ret += concat;
69149
+ }
69144
69150
  }
69145
69151
  return ret;
69146
69152
  }
@@ -74202,8 +74208,9 @@ class ReadTableTranspiler {
74202
74208
  if (keyName && node.findDirectTokenByText("COMPONENTS")) {
74203
74209
  extra.push("keyName: \"" + keyName.concatTokens() + "\"");
74204
74210
  }
74211
+ const withTableKey = node.findTokenSequencePosition("WITH", "TABLE");
74205
74212
  const binary = node.findTokenSequencePosition("BINARY", "SEARCH");
74206
- if (binary) {
74213
+ if (binary || withTableKey) {
74207
74214
  extra.push("binarySearch: true");
74208
74215
  }
74209
74216
  const rt = node.findDirectExpression(abaplint.Expressions.ReadTableTarget);
@@ -76511,6 +76518,7 @@ class SelectTranspiler {
76511
76518
  if (selectStatement === undefined) {
76512
76519
  throw "Structure, select loop not found";
76513
76520
  }
76521
+ const concat = selectStatement.concatTokens().toUpperCase();
76514
76522
  const from = (_a = selectStatement.findFirstExpression(abaplint.Expressions.SQLFromSource)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
76515
76523
  const intoName = new expressions_1.SQLTargetTranspiler().transpile(selectStatement.findFirstExpression(abaplint.Expressions.SQLTarget), traversal).getCode();
76516
76524
  // note: this implementation SELECTs everything into memory, which might be bad, and sometimes not correct
@@ -76519,7 +76527,12 @@ class SelectTranspiler {
76519
76527
  ret.appendString(`let ${targetName} = new abap.types.Table(abap.DDIC["${from}"].type);\n`);
76520
76528
  ret.appendChunk(new select_1.SelectTranspiler().transpile(selectStatement, traversal, targetName));
76521
76529
  ret.appendString(`\nfor (const ${loopName} of ${targetName}.array()) {\n`);
76522
- ret.appendString(`${intoName}.set(${loopName});\n`);
76530
+ if (concat.includes(" INTO CORRESPONDING FIELDS OF ")) {
76531
+ ret.appendString(`abap.statements.moveCorresponding(${loopName}, ${intoName});\n`);
76532
+ }
76533
+ else {
76534
+ ret.appendString(`${intoName}.set(${loopName});\n`);
76535
+ }
76523
76536
  const body = node.findDirectStructure(abaplint.Structures.Body);
76524
76537
  if (body) {
76525
76538
  ret.appendChunk(traversal.traverse(body));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.5.45",
3
+ "version": "2.5.46",
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.5.45",
28
+ "@abaplint/transpiler": "^2.5.46",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",