@abaplint/transpiler-cli 2.11.54 → 2.11.56
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/bundle.js +44 -16
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -52324,12 +52324,17 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
52324
52324
|
if (field.GROUPNAME !== undefined) {
|
|
52325
52325
|
components.push({ name: field.GROUPNAME, type: found, asInclude: true });
|
|
52326
52326
|
}
|
|
52327
|
-
if (field.FIELDNAME.startsWith(".INCLU-") === false
|
|
52328
|
-
|| field.FIELDNAME === ".INCLU--AP") {
|
|
52327
|
+
if (field.FIELDNAME.startsWith(".INCLU-") === false) {
|
|
52329
52328
|
for (const c of found.getComponents()) {
|
|
52330
52329
|
components.push({ name: c.name, type: c.type });
|
|
52331
52330
|
}
|
|
52332
52331
|
}
|
|
52332
|
+
else if (field.FIELDNAME.startsWith(".INCLU-")) {
|
|
52333
|
+
const postfix = field.FIELDNAME.substring(".INCLU-".length);
|
|
52334
|
+
for (const c of found.getComponents()) {
|
|
52335
|
+
components.push({ name: c.name + postfix, type: c.type });
|
|
52336
|
+
}
|
|
52337
|
+
}
|
|
52333
52338
|
}
|
|
52334
52339
|
else if ((((_a = field.PRECFIELD) === null || _a === void 0 ? void 0 : _a.startsWith("CI_")) || ((_b = field.PRECFIELD) === null || _b === void 0 ? void 0 : _b.startsWith("SI_")))
|
|
52335
52340
|
&& found instanceof Types.UnknownType) {
|
|
@@ -53845,7 +53850,7 @@ class Registry {
|
|
|
53845
53850
|
}
|
|
53846
53851
|
static abaplintVersion() {
|
|
53847
53852
|
// magic, see build script "version.sh"
|
|
53848
|
-
return "2.113.
|
|
53853
|
+
return "2.113.187";
|
|
53849
53854
|
}
|
|
53850
53855
|
getDDICReferences() {
|
|
53851
53856
|
return this.ddicReferences;
|
|
@@ -79937,26 +79942,30 @@ class MethodCallBodyTranspiler {
|
|
|
79937
79942
|
}
|
|
79938
79943
|
transpile(node, traversal) {
|
|
79939
79944
|
const ret = new chunk_1.Chunk();
|
|
79940
|
-
let pt = false;
|
|
79945
|
+
// let pt = false;
|
|
79941
79946
|
for (const c of node.getChildren()) {
|
|
79942
79947
|
if (c instanceof core_1.Nodes.TokenNode) {
|
|
79948
|
+
/*
|
|
79943
79949
|
if (c.concatTokens().toUpperCase() === "PARAMETER") {
|
|
79944
|
-
|
|
79945
|
-
|
|
79946
|
-
}
|
|
79947
|
-
|
|
79948
|
-
|
|
79949
|
-
return ret;
|
|
79950
|
+
// PARAMETER-TABLE
|
|
79951
|
+
pt = true;
|
|
79952
|
+
} else if(c.concatTokens().toUpperCase() === "EXCEPTION") {
|
|
79953
|
+
// todo: handle EXCEPTION-TABLE, for now just produce valid javascript
|
|
79954
|
+
return ret;
|
|
79950
79955
|
}
|
|
79956
|
+
*/
|
|
79951
79957
|
}
|
|
79952
79958
|
else if (c.get() instanceof abaplint.Expressions.MethodCallParam) {
|
|
79953
79959
|
ret.appendChunk(new method_call_param_1.MethodCallParamTranspiler(this.m).transpile(c, traversal));
|
|
79954
79960
|
}
|
|
79955
79961
|
else {
|
|
79956
79962
|
ret.appendChunk(traversal.traverse(c));
|
|
79963
|
+
/*
|
|
79957
79964
|
if (pt === true) {
|
|
79958
|
-
|
|
79965
|
+
ret.appendString(".array().reduce((a, v) => ({ ...a, [v.get().name.get(
|
|
79966
|
+
).toLowerCase().trimEnd()]: v.get().value.dereference()}), {})");
|
|
79959
79967
|
}
|
|
79968
|
+
*/
|
|
79960
79969
|
}
|
|
79961
79970
|
}
|
|
79962
79971
|
return ret;
|
|
@@ -82269,6 +82278,7 @@ class HandleDataElement {
|
|
|
82269
82278
|
"type": ${transpile_types_1.TranspileTypes.toType(type)},
|
|
82270
82279
|
"domain": ${JSON.stringify(obj.getDomainName())},
|
|
82271
82280
|
"fixedValues": ${JSON.stringify(fixedValues)},
|
|
82281
|
+
"description": ${JSON.stringify(obj.getDescription())},
|
|
82272
82282
|
};`);
|
|
82273
82283
|
const output = {
|
|
82274
82284
|
object: {
|
|
@@ -82557,6 +82567,7 @@ class HandleTable {
|
|
|
82557
82567
|
"objectType": "TABL",
|
|
82558
82568
|
"type": ${transpile_types_1.TranspileTypes.toType(type)},
|
|
82559
82569
|
"keyFields": ${JSON.stringify(obj.listKeys(reg))},
|
|
82570
|
+
"description": ${JSON.stringify(obj.getDescription())},
|
|
82560
82571
|
};`);
|
|
82561
82572
|
const output = {
|
|
82562
82573
|
object: {
|
|
@@ -82598,6 +82609,7 @@ class HandleTableType {
|
|
|
82598
82609
|
const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
|
|
82599
82610
|
"objectType": "TTYP",
|
|
82600
82611
|
"type": ${transpile_types_1.TranspileTypes.toType(type)},
|
|
82612
|
+
"description": ${JSON.stringify(obj.getDescription())},
|
|
82601
82613
|
};`);
|
|
82602
82614
|
const output = {
|
|
82603
82615
|
object: {
|
|
@@ -83756,14 +83768,25 @@ class CallTranspiler {
|
|
|
83756
83768
|
const methodSource = node.findDirectExpression(abaplint.Expressions.MethodSource);
|
|
83757
83769
|
if (methodSource) {
|
|
83758
83770
|
let body = "";
|
|
83771
|
+
let pre = "";
|
|
83772
|
+
let post = "";
|
|
83759
83773
|
const nameToken = methodSource.getLastChild()?.getFirstToken();
|
|
83760
83774
|
const m = nameToken ? traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken)) : undefined;
|
|
83761
83775
|
const methodCallBody = node.findDirectExpression(abaplint.Expressions.MethodCallBody);
|
|
83762
83776
|
if (methodCallBody) {
|
|
83763
|
-
|
|
83777
|
+
if (methodCallBody.findDirectTokenByText("EXCEPTION")) {
|
|
83778
|
+
throw new Error("EXCEPTION-TABLE not supported, todo");
|
|
83779
|
+
}
|
|
83780
|
+
if (methodCallBody.findDirectTokenByText("PARAMETER")) {
|
|
83781
|
+
const source = traversal.traverse(methodCallBody.findDirectExpression(abaplint.Expressions.Source)).getCode();
|
|
83782
|
+
pre = 'await abap.parametersCall(';
|
|
83783
|
+
body = ", " + source + ")";
|
|
83784
|
+
}
|
|
83785
|
+
else {
|
|
83786
|
+
body = new expressions_1.MethodCallBodyTranspiler(m?.def).transpile(methodCallBody, traversal).getCode();
|
|
83787
|
+
body = "(" + body + ")";
|
|
83788
|
+
}
|
|
83764
83789
|
}
|
|
83765
|
-
let pre = "";
|
|
83766
|
-
let post = "";
|
|
83767
83790
|
const receiving = node.findFirstExpression(abaplint.Expressions.MethodParameters)?.findExpressionAfterToken("RECEIVING");
|
|
83768
83791
|
if (receiving) {
|
|
83769
83792
|
const target = traversal.traverse(receiving.findDirectExpression(abaplint.Expressions.Target));
|
|
@@ -83806,7 +83829,10 @@ class CallTranspiler {
|
|
|
83806
83829
|
}
|
|
83807
83830
|
}
|
|
83808
83831
|
}
|
|
83809
|
-
|
|
83832
|
+
if (body === "") {
|
|
83833
|
+
body = "()";
|
|
83834
|
+
}
|
|
83835
|
+
return new chunk_1.Chunk().appendString(ms).appendString(body + post + ";");
|
|
83810
83836
|
}
|
|
83811
83837
|
throw new Error("CallTranspiler, todo");
|
|
83812
83838
|
}
|
|
@@ -90130,10 +90156,12 @@ class InterfaceTranspiler {
|
|
|
90130
90156
|
for (const c of node.getChildren()) {
|
|
90131
90157
|
if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.Interface) {
|
|
90132
90158
|
const scope = traversal.findCurrentScopeByToken(node.getFirstToken());
|
|
90133
|
-
|
|
90159
|
+
const token = c.findDirectExpression(abaplint.Expressions.InterfaceName).getFirstToken();
|
|
90160
|
+
name = token.getStr().toLowerCase();
|
|
90134
90161
|
name = traversal_1.Traversal.escapeNamespace(name);
|
|
90135
90162
|
ret += `class ${name} {\n`;
|
|
90136
90163
|
ret += `static INTERNAL_TYPE = 'INTF';\n`;
|
|
90164
|
+
ret += `static INTERNAL_NAME = '${traversal.buildInternalName(token.getStr(), def)}';\n`;
|
|
90137
90165
|
ret += `static ATTRIBUTES = {${Array.from(traversal.buildAttributes(def, scope)).join(",\n")}};\n`;
|
|
90138
90166
|
ret += `static METHODS = {${traversal.buildMethods(def, scope).join(",\n")}};\n`;
|
|
90139
90167
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.56",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"author": "abaplint",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@abaplint/core": "^2.113.
|
|
31
|
-
"@abaplint/transpiler": "^2.11.
|
|
30
|
+
"@abaplint/core": "^2.113.187",
|
|
31
|
+
"@abaplint/transpiler": "^2.11.56",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
33
|
"@types/node": "^24.3.0",
|
|
34
34
|
"@types/progress": "^2.0.7",
|