@abaplint/transpiler 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.
@@ -101,7 +101,13 @@ class SQLCondTranspiler {
101
101
  }
102
102
  }
103
103
  else {
104
- ret += source.concatTokens();
104
+ const concat = source.concatTokens();
105
+ if (concat.startsWith("`")) {
106
+ ret += "'" + concat.substring(1, concat.length - 1) + "'";
107
+ }
108
+ else {
109
+ ret += concat;
110
+ }
105
111
  }
106
112
  return ret;
107
113
  }
@@ -25,8 +25,9 @@ class ReadTableTranspiler {
25
25
  if (keyName && node.findDirectTokenByText("COMPONENTS")) {
26
26
  extra.push("keyName: \"" + keyName.concatTokens() + "\"");
27
27
  }
28
+ const withTableKey = node.findTokenSequencePosition("WITH", "TABLE");
28
29
  const binary = node.findTokenSequencePosition("BINARY", "SEARCH");
29
- if (binary) {
30
+ if (binary || withTableKey) {
30
31
  extra.push("binarySearch: true");
31
32
  }
32
33
  const rt = node.findDirectExpression(abaplint.Expressions.ReadTableTarget);
@@ -14,6 +14,7 @@ class SelectTranspiler {
14
14
  if (selectStatement === undefined) {
15
15
  throw "Structure, select loop not found";
16
16
  }
17
+ const concat = selectStatement.concatTokens().toUpperCase();
17
18
  const from = (_a = selectStatement.findFirstExpression(abaplint.Expressions.SQLFromSource)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
18
19
  const intoName = new expressions_1.SQLTargetTranspiler().transpile(selectStatement.findFirstExpression(abaplint.Expressions.SQLTarget), traversal).getCode();
19
20
  // note: this implementation SELECTs everything into memory, which might be bad, and sometimes not correct
@@ -22,7 +23,12 @@ class SelectTranspiler {
22
23
  ret.appendString(`let ${targetName} = new abap.types.Table(abap.DDIC["${from}"].type);\n`);
23
24
  ret.appendChunk(new select_1.SelectTranspiler().transpile(selectStatement, traversal, targetName));
24
25
  ret.appendString(`\nfor (const ${loopName} of ${targetName}.array()) {\n`);
25
- ret.appendString(`${intoName}.set(${loopName});\n`);
26
+ if (concat.includes(" INTO CORRESPONDING FIELDS OF ")) {
27
+ ret.appendString(`abap.statements.moveCorresponding(${loopName}, ${intoName});\n`);
28
+ }
29
+ else {
30
+ ret.appendString(`${intoName}.set(${loopName});\n`);
31
+ }
26
32
  const body = node.findDirectStructure(abaplint.Structures.Body);
27
33
  if (body) {
28
34
  ret.appendChunk(traversal.traverse(body));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.5.45",
3
+ "version": "2.5.46",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",