@abaplint/transpiler 2.13.65 → 2.13.67

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.
@@ -37,6 +37,7 @@ exports.OpenCursorTranspiler = void 0;
37
37
  const abaplint = __importStar(require("@abaplint/core"));
38
38
  const chunk_1 = require("../chunk");
39
39
  const insert_database_1 = require("./insert_database");
40
+ const expressions_1 = require("../expressions");
40
41
  class OpenCursorTranspiler {
41
42
  transpile(node, traversal) {
42
43
  const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.SQLTarget)).getCode();
@@ -46,11 +47,21 @@ class OpenCursorTranspiler {
46
47
  select += traversal.traverse(selectExpression?.findDirectExpression(abaplint.Expressions.SQLFrom)).getCode();
47
48
  const cond = selectExpression?.findDirectExpression(abaplint.Expressions.SQLCond);
48
49
  if (cond) {
49
- select += "WHERE " + traversal.traverse(node).getCode();
50
+ select += "WHERE " + new expressions_1.SQLCondTranspiler().transpile(cond, traversal).getCode() + " ";
51
+ }
52
+ const upTo = selectExpression?.findDirectExpression(abaplint.Expressions.SQLUpTo);
53
+ if (upTo) {
54
+ const source = upTo.findFirstExpression(abaplint.Expressions.SimpleSource3);
55
+ if (source) {
56
+ select += `UP TO " + ${new expressions_1.SourceTranspiler(true).transpile(source, traversal).getCode()} + " ROWS `;
57
+ }
58
+ else {
59
+ select += upTo.concatTokens() + " ";
60
+ }
50
61
  }
51
62
  const orderBy = selectExpression?.findDirectExpression(abaplint.Expressions.SQLOrderBy);
52
63
  if (orderBy) {
53
- select += "ORDER BY " + traversal.traverse(node).getCode();
64
+ select += "ORDER BY " + new expressions_1.SQLOrderByTranspiler().transpile(orderBy, traversal).getCode();
54
65
  }
55
66
  const options = [];
56
67
  const connection = node.findDirectExpression(abaplint.Expressions.DatabaseConnection);
@@ -0,0 +1,7 @@
1
+ import * as abaplint from "@abaplint/core";
2
+ import { IStructureTranspiler } from "./_structure_transpiler";
3
+ import { Traversal } from "../traversal";
4
+ import { Chunk } from "../chunk";
5
+ export declare class CatchSystemExceptionsTranspiler implements IStructureTranspiler {
6
+ transpile(node: abaplint.Nodes.StructureNode, traversal: Traversal): Chunk;
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CatchSystemExceptionsTranspiler = void 0;
4
+ const chunk_1 = require("../chunk");
5
+ class CatchSystemExceptionsTranspiler {
6
+ transpile(node, traversal) {
7
+ return new chunk_1.Chunk().append(`throw new Error("CATCH SYSTEM-EXCEPTIONS, not supported, transpiler");`, node, traversal);
8
+ }
9
+ }
10
+ exports.CatchSystemExceptionsTranspiler = CatchSystemExceptionsTranspiler;
11
+ //# sourceMappingURL=catch_system_exceptions.js.map
@@ -2,6 +2,7 @@ export * from "./at_first";
2
2
  export * from "./at_last";
3
3
  export * from "./case_type";
4
4
  export * from "./case";
5
+ export * from "./catch_system_exceptions";
5
6
  export * from "./class_definition";
6
7
  export * from "./class_implementation";
7
8
  export * from "./constants";
@@ -18,6 +18,7 @@ __exportStar(require("./at_first"), exports);
18
18
  __exportStar(require("./at_last"), exports);
19
19
  __exportStar(require("./case_type"), exports);
20
20
  __exportStar(require("./case"), exports);
21
+ __exportStar(require("./catch_system_exceptions"), exports);
21
22
  __exportStar(require("./class_definition"), exports);
22
23
  __exportStar(require("./class_implementation"), exports);
23
24
  __exportStar(require("./constants"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.13.65",
3
+ "version": "2.13.67",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",