@abaplint/transpiler 2.3.104 → 2.3.106
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.
- package/build/src/expressions/sql_cond.js +0 -8
- package/build/src/statements/index.d.ts +1 -0
- package/build/src/statements/index.js +1 -0
- package/build/src/statements/select_option.d.ts +7 -0
- package/build/src/statements/select_option.js +11 -0
- package/build/src/statements/update_database.d.ts +1 -1
- package/build/src/statements/update_database.js +21 -2
- package/package.json +2 -2
|
@@ -71,14 +71,6 @@ class SQLCondTranspiler {
|
|
|
71
71
|
}
|
|
72
72
|
ret += fieldName.concatTokens() + " " + operator.concatTokens() + " ";
|
|
73
73
|
ret += this.sqlSource(source, traversal);
|
|
74
|
-
/*
|
|
75
|
-
const simple = source.findDirectExpression(abaplint.Expressions.SimpleSource3);
|
|
76
|
-
if (simple && simple.findDirectExpression(abaplint.Expressions.Constant) === undefined) {
|
|
77
|
-
ret += "'\" + " + new SimpleSource3Transpiler(true).transpile(simple, traversal).getCode() + " + \"'";
|
|
78
|
-
} else {
|
|
79
|
-
ret += source.concatTokens();
|
|
80
|
-
}
|
|
81
|
-
*/
|
|
82
74
|
return ret;
|
|
83
75
|
}
|
|
84
76
|
sqlSource(source, traversal) {
|
|
@@ -122,6 +122,7 @@ __exportStar(require("./return"), exports);
|
|
|
122
122
|
__exportStar(require("./rollback"), exports);
|
|
123
123
|
__exportStar(require("./scan"), exports);
|
|
124
124
|
__exportStar(require("./search"), exports);
|
|
125
|
+
__exportStar(require("./select_option"), exports);
|
|
125
126
|
__exportStar(require("./select"), exports);
|
|
126
127
|
__exportStar(require("./selection_screen"), exports);
|
|
127
128
|
__exportStar(require("./set_bit"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as abaplint from "@abaplint/core";
|
|
2
|
+
import { IStatementTranspiler } from "./_statement_transpiler";
|
|
3
|
+
import { Traversal } from "../traversal";
|
|
4
|
+
import { Chunk } from "../chunk";
|
|
5
|
+
export declare class SelectOptionTranspiler implements IStatementTranspiler {
|
|
6
|
+
transpile(_node: abaplint.Nodes.StatementNode, _traversal: Traversal): Chunk;
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SelectOptionTranspiler = void 0;
|
|
4
|
+
const chunk_1 = require("../chunk");
|
|
5
|
+
class SelectOptionTranspiler {
|
|
6
|
+
transpile(_node, _traversal) {
|
|
7
|
+
return new chunk_1.Chunk(`throw new Error("SelectOption, not supported, transpiler");`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.SelectOptionTranspiler = SelectOptionTranspiler;
|
|
11
|
+
//# sourceMappingURL=select_option.js.map
|
|
@@ -3,5 +3,5 @@ import { IStatementTranspiler } from "./_statement_transpiler";
|
|
|
3
3
|
import { Traversal } from "../traversal";
|
|
4
4
|
import { Chunk } from "../chunk";
|
|
5
5
|
export declare class UpdateDatabaseTranspiler implements IStatementTranspiler {
|
|
6
|
-
transpile(
|
|
6
|
+
transpile(node: abaplint.Nodes.StatementNode, traversal: Traversal): Chunk;
|
|
7
7
|
}
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateDatabaseTranspiler = void 0;
|
|
4
|
+
const abaplint = require("@abaplint/core");
|
|
4
5
|
const chunk_1 = require("../chunk");
|
|
5
6
|
class UpdateDatabaseTranspiler {
|
|
6
|
-
transpile(
|
|
7
|
-
|
|
7
|
+
transpile(node, traversal) {
|
|
8
|
+
var _a;
|
|
9
|
+
const table = traversal.traverse(node.findFirstExpression(abaplint.Expressions.DatabaseTable));
|
|
10
|
+
const options = [];
|
|
11
|
+
const cond = node.findFirstExpression(abaplint.Expressions.SQLCond);
|
|
12
|
+
if (cond) {
|
|
13
|
+
const ttab = traversal.traverse(cond);
|
|
14
|
+
options.push(`"where": "` + ttab.getCode() + `"`);
|
|
15
|
+
}
|
|
16
|
+
const sets = node.findAllExpressions(abaplint.Expressions.SQLFieldAndValue);
|
|
17
|
+
if (sets.length > 0) {
|
|
18
|
+
const s = [];
|
|
19
|
+
for (const set of sets) {
|
|
20
|
+
const name = (_a = set.findDirectExpression(abaplint.Expressions.SQLFieldName)) === null || _a === void 0 ? void 0 : _a.concatTokens();
|
|
21
|
+
const source = traversal.traverse(set.findDirectExpression(abaplint.Expressions.SQLSource));
|
|
22
|
+
s.push("\"'" + name + "' = '\" + " + source.getCode() + ".get() + \"'\"");
|
|
23
|
+
}
|
|
24
|
+
options.push(`"set": [${s.join(",")}]`);
|
|
25
|
+
}
|
|
26
|
+
return new chunk_1.Chunk(`await abap.statements.updateDatabase(${table.getCode()}, {${options.join(", ")}});`);
|
|
8
27
|
}
|
|
9
28
|
}
|
|
10
29
|
exports.UpdateDatabaseTranspiler = UpdateDatabaseTranspiler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.106",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"author": "abaplint",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@abaplint/core": "^2.94.
|
|
31
|
+
"@abaplint/core": "^2.94.19",
|
|
32
32
|
"source-map": "^0.7.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|