@abaplint/transpiler 2.5.64 → 2.5.65

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.
@@ -45,6 +45,7 @@ export * from "./sql_from_source";
45
45
  export * from "./sql_from";
46
46
  export * from "./sql_join";
47
47
  export * from "./sql_source_simple";
48
+ export * from "./sql_into_structure";
48
49
  export * from "./sql_source";
49
50
  export * from "./sql_target";
50
51
  export * from "./string_template_source";
@@ -61,6 +61,7 @@ __exportStar(require("./sql_from_source"), exports);
61
61
  __exportStar(require("./sql_from"), exports);
62
62
  __exportStar(require("./sql_join"), exports);
63
63
  __exportStar(require("./sql_source_simple"), exports);
64
+ __exportStar(require("./sql_into_structure"), exports);
64
65
  __exportStar(require("./sql_source"), exports);
65
66
  __exportStar(require("./sql_target"), exports);
66
67
  __exportStar(require("./string_template_source"), exports);
@@ -0,0 +1,7 @@
1
+ import { Nodes } from "@abaplint/core";
2
+ import { IExpressionTranspiler } from "./_expression_transpiler";
3
+ import { Traversal } from "../traversal";
4
+ import { Chunk } from "../chunk";
5
+ export declare class SQLIntoStructureTranspiler implements IExpressionTranspiler {
6
+ transpile(node: Nodes.ExpressionNode, traversal: Traversal): Chunk;
7
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SQLIntoStructureTranspiler = void 0;
4
+ const abaplint = require("@abaplint/core");
5
+ const chunk_1 = require("../chunk");
6
+ class SQLIntoStructureTranspiler {
7
+ transpile(node, traversal) {
8
+ const targets = node.findDirectExpressions(abaplint.Expressions.SQLTarget);
9
+ const transpiled = targets.map(t => traversal.traverse(t));
10
+ if (targets.length === 1) {
11
+ return transpiled[0];
12
+ }
13
+ else {
14
+ const chunk = new chunk_1.Chunk();
15
+ chunk.appendString("[");
16
+ chunk.appendString(transpiled.map(t => t.getCode()).join(","));
17
+ chunk.appendString("]");
18
+ return chunk;
19
+ }
20
+ }
21
+ }
22
+ exports.SQLIntoStructureTranspiler = SQLIntoStructureTranspiler;
23
+ //# sourceMappingURL=sql_into_structure.js.map
@@ -9,6 +9,7 @@ const sql_from_1 = require("../expressions/sql_from");
9
9
  function escapeRegExp(string) {
10
10
  return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
11
11
  }
12
+ // TODO: currently SELECT into are always handled as CORRESPONDING
12
13
  class SelectTranspiler {
13
14
  transpile(node, traversal, targetOverride) {
14
15
  var _a;
@@ -16,9 +17,12 @@ class SelectTranspiler {
16
17
  if (targetOverride) {
17
18
  target = targetOverride;
18
19
  }
19
- else if (node.findFirstExpression(abaplint.Expressions.Target)) {
20
+ else if (node.findFirstExpression(abaplint.Expressions.SQLIntoTable)) {
20
21
  target = traversal.traverse(node.findFirstExpression(abaplint.Expressions.Target)).getCode();
21
22
  }
23
+ else if (node.findFirstExpression(abaplint.Expressions.SQLIntoStructure)) {
24
+ target = traversal.traverse(node.findFirstExpression(abaplint.Expressions.SQLIntoStructure)).getCode();
25
+ }
22
26
  let select = "SELECT ";
23
27
  const fieldList = node.findFirstExpression(abaplint.Expressions.SQLFieldList)
24
28
  || node.findFirstExpression(abaplint.Expressions.SQLFieldListLoop);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.5.64",
3
+ "version": "2.5.65",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",