@abaplint/transpiler 2.13.25 → 2.13.27
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/db/index.js
CHANGED
|
@@ -63,17 +63,21 @@ class DatabaseSetup {
|
|
|
63
63
|
insert.push(...populateTables.insertWWWPARAMS(obj));
|
|
64
64
|
}
|
|
65
65
|
else if (obj instanceof abaplint.Objects.Class
|
|
66
|
-
|| obj instanceof abaplint.Objects.Interface
|
|
66
|
+
|| obj instanceof abaplint.Objects.Interface
|
|
67
|
+
|| obj instanceof abaplint.Objects.Program) {
|
|
67
68
|
if (options?.populateTables?.reposrc !== false) {
|
|
68
69
|
insert.push(populateTables.insertREPOSRC(obj));
|
|
69
70
|
}
|
|
70
|
-
if (
|
|
71
|
+
if ((obj instanceof abaplint.Objects.Class || obj instanceof abaplint.Objects.Interface)
|
|
72
|
+
&& options?.populateTables?.seosubco !== false) {
|
|
71
73
|
insert.push(...populateTables.insertSEOSUBCO(obj));
|
|
72
74
|
}
|
|
73
|
-
if (
|
|
75
|
+
if ((obj instanceof abaplint.Objects.Class || obj instanceof abaplint.Objects.Interface)
|
|
76
|
+
&& options?.populateTables?.seosubcodf !== false) {
|
|
74
77
|
insert.push(...populateTables.insertSEOSUBCODF(obj));
|
|
75
78
|
}
|
|
76
|
-
if (
|
|
79
|
+
if ((obj instanceof abaplint.Objects.Class || obj instanceof abaplint.Objects.Interface)
|
|
80
|
+
&& options?.populateTables?.seosubcotx !== false) {
|
|
77
81
|
insert.push(...populateTables.insertSEOSUBCOTX(obj));
|
|
78
82
|
}
|
|
79
83
|
}
|
|
@@ -9,7 +9,7 @@ export declare class PopulateTables {
|
|
|
9
9
|
private readonly hasTADIR;
|
|
10
10
|
private readonly hasWWWPARAMS;
|
|
11
11
|
constructor(reg: abaplint.IRegistry);
|
|
12
|
-
insertREPOSRC(obj: abaplint.Objects.Class | abaplint.Objects.Interface): string;
|
|
12
|
+
insertREPOSRC(obj: abaplint.Objects.Class | abaplint.Objects.Interface | abaplint.Objects.Program): string;
|
|
13
13
|
insertT100(msag: abaplint.Objects.MessageClass): string[];
|
|
14
14
|
insertSEOSUBCO(obj: abaplint.Objects.Class | abaplint.Objects.Interface): string[];
|
|
15
15
|
insertSEOSUBCODF(obj: abaplint.Objects.Class | abaplint.Objects.Interface): string[];
|
|
@@ -16,7 +16,7 @@ class ReadReportTranspiler {
|
|
|
16
16
|
if (stateNode) {
|
|
17
17
|
options.push("state: " + new expressions_1.SourceTranspiler().transpile(stateNode, traversal).getCode());
|
|
18
18
|
}
|
|
19
|
-
return new chunk_1.Chunk().appendString(`abap.statements.readReport(`)
|
|
19
|
+
return new chunk_1.Chunk().appendString(`await abap.statements.readReport(`)
|
|
20
20
|
.appendChunk(reportChunk)
|
|
21
21
|
.appendString(", {" + options.join(",") + "}")
|
|
22
22
|
.appendString(");");
|
|
@@ -5,5 +5,6 @@ import { Chunk } from "../chunk";
|
|
|
5
5
|
export declare class SelectTranspiler implements IStatementTranspiler {
|
|
6
6
|
transpile(node: abaplint.Nodes.StatementNode, traversal: Traversal, targetOverride?: string): Chunk;
|
|
7
7
|
private findTable;
|
|
8
|
+
private dynamicSelectList;
|
|
8
9
|
private isWhereExpression;
|
|
9
10
|
}
|
|
@@ -75,12 +75,19 @@ class SelectTranspiler {
|
|
|
75
75
|
if (orderBy) {
|
|
76
76
|
select += new expressions_1.SQLOrderByTranspiler().transpile(orderBy, traversal).getCode();
|
|
77
77
|
}
|
|
78
|
+
const fieldListDynamics = new Set(fieldList.findAllExpressionsRecursive(abaplint.Expressions.Dynamic));
|
|
78
79
|
for (const d of node.findAllExpressionsRecursive(abaplint.Expressions.Dynamic)) {
|
|
79
80
|
const chain = d.findFirstExpression(abaplint.Expressions.FieldChain);
|
|
80
81
|
if (chain) {
|
|
81
|
-
const code = new expressions_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();
|
|
82
82
|
const search = d.concatTokens();
|
|
83
|
-
|
|
83
|
+
if (fieldListDynamics.has(d)) {
|
|
84
|
+
const code = new expressions_1.FieldChainTranspiler(false).transpile(chain, traversal).getCode();
|
|
85
|
+
select = select.replace(search, `" + ${this.dynamicSelectList(code)} + "`);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
const code = new expressions_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();
|
|
89
|
+
select = select.replace(search, `" + ${code} + "`);
|
|
90
|
+
}
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
93
|
const concat = node.concatTokens().toUpperCase();
|
|
@@ -142,6 +149,11 @@ class SelectTranspiler {
|
|
|
142
149
|
}
|
|
143
150
|
return { table: tabl, keys };
|
|
144
151
|
}
|
|
152
|
+
dynamicSelectList(code) {
|
|
153
|
+
return `(${code} instanceof abap.types.Table || ${code} instanceof abap.types.HashedTable`
|
|
154
|
+
+ ` ? (${code}.array().length === 0 ? "*" : ${code}.array().map(row => row.get()).join(", "))`
|
|
155
|
+
+ ` : ${code}.get())`;
|
|
156
|
+
}
|
|
145
157
|
isWhereExpression(node, expression) {
|
|
146
158
|
// check if previous token before sqlCond is "WHERE". It could also be "ON" in case of join condition
|
|
147
159
|
let prevToken;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.27",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"author": "abaplint",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@abaplint/core": "^2.119.
|
|
32
|
+
"@abaplint/core": "^2.119.24",
|
|
33
33
|
"source-map": "^0.7.6"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|