@abaplint/transpiler-cli 2.11.10 → 2.11.11
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 +53 -6
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -27011,6 +27011,10 @@ class Source {
|
|
|
27011
27011
|
{
|
|
27012
27012
|
const foundType = this.determineType(node, input, targetType);
|
|
27013
27013
|
const bodyType = cond_body_1.CondBody.runSyntax(node.findDirectExpression(Expressions.CondBody), input, foundType);
|
|
27014
|
+
/*
|
|
27015
|
+
console.log("COND BODY type;:");
|
|
27016
|
+
console.dir(bodyType);
|
|
27017
|
+
*/
|
|
27014
27018
|
if (foundType === undefined || foundType.isGeneric()) {
|
|
27015
27019
|
this.addIfInferred(node, input, bodyType);
|
|
27016
27020
|
}
|
|
@@ -27038,15 +27042,28 @@ class Source {
|
|
|
27038
27042
|
}
|
|
27039
27043
|
case "REF":
|
|
27040
27044
|
{
|
|
27041
|
-
|
|
27045
|
+
let foundType = this.determineType(node, input, targetType);
|
|
27042
27046
|
const s = Source.runSyntax(node.findDirectExpression(Expressions.Source), input);
|
|
27047
|
+
/*
|
|
27048
|
+
console.dir(node.concatTokens());
|
|
27049
|
+
console.dir(targetType);
|
|
27050
|
+
console.dir(foundType);
|
|
27051
|
+
console.dir(s);
|
|
27052
|
+
*/
|
|
27043
27053
|
if (foundType === undefined && s) {
|
|
27044
|
-
|
|
27054
|
+
foundType = new basic_1.DataReference(s);
|
|
27045
27055
|
}
|
|
27046
|
-
else if (foundType) {
|
|
27047
|
-
|
|
27056
|
+
else if (foundType && targetType === undefined) {
|
|
27057
|
+
foundType = new basic_1.DataReference(foundType);
|
|
27058
|
+
}
|
|
27059
|
+
/*
|
|
27060
|
+
if (targetType && !(targetType instanceof DataReference)) {
|
|
27061
|
+
const message = `REF: Types not compatible, ` + targetType.constructor.name;
|
|
27062
|
+
input.issues.push(syntaxIssue(input, node.getFirstToken(), message));
|
|
27048
27063
|
}
|
|
27049
|
-
|
|
27064
|
+
*/
|
|
27065
|
+
this.addIfInferred(node, input, foundType);
|
|
27066
|
+
return foundType;
|
|
27050
27067
|
}
|
|
27051
27068
|
case "FILTER":
|
|
27052
27069
|
{
|
|
@@ -27196,11 +27213,20 @@ class Source {
|
|
|
27196
27213
|
const typeExpression = node.findDirectExpression(Expressions.TypeNameOrInfer);
|
|
27197
27214
|
const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();
|
|
27198
27215
|
const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
|
|
27216
|
+
/*
|
|
27217
|
+
console.dir(inferredType);
|
|
27218
|
+
console.dir(typeToken);
|
|
27219
|
+
*/
|
|
27220
|
+
// hmm, need to align all this
|
|
27199
27221
|
if (typeName === "#" && inferredType && typeToken) {
|
|
27200
27222
|
const found = basic.lookupQualifiedName(inferredType.getQualifiedName());
|
|
27201
27223
|
if (found) {
|
|
27202
27224
|
input.scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, input.filename);
|
|
27203
27225
|
}
|
|
27226
|
+
else if (inferredType instanceof basic_1.DataReference) {
|
|
27227
|
+
const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, inferredType);
|
|
27228
|
+
input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename);
|
|
27229
|
+
}
|
|
27204
27230
|
else if (inferredType instanceof basic_1.ObjectReferenceType) {
|
|
27205
27231
|
const def = input.scope.findObjectDefinition(inferredType.getQualifiedName());
|
|
27206
27232
|
if (def) {
|
|
@@ -53661,7 +53687,7 @@ class Registry {
|
|
|
53661
53687
|
}
|
|
53662
53688
|
static abaplintVersion() {
|
|
53663
53689
|
// magic, see build script "version.sh"
|
|
53664
|
-
return "2.113.
|
|
53690
|
+
return "2.113.158";
|
|
53665
53691
|
}
|
|
53666
53692
|
getDDICReferences() {
|
|
53667
53693
|
return this.ddicReferences;
|
|
@@ -79943,6 +79969,7 @@ const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abapli
|
|
|
79943
79969
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
79944
79970
|
const constant_1 = __webpack_require__(/*! ./constant */ "./node_modules/@abaplint/transpiler/build/src/expressions/constant.js");
|
|
79945
79971
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
79972
|
+
const transpile_types_1 = __webpack_require__(/*! ../transpile_types */ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js");
|
|
79946
79973
|
class SourceTranspiler {
|
|
79947
79974
|
addGet;
|
|
79948
79975
|
constructor(addGet = false) {
|
|
@@ -80007,6 +80034,9 @@ class SourceTranspiler {
|
|
|
80007
80034
|
else if (c.get() instanceof core_1.Expressions.TextElement) {
|
|
80008
80035
|
ret = new chunk_1.Chunk().appendString(`new abap.types.String().set("${c.concatTokens()}")`);
|
|
80009
80036
|
}
|
|
80037
|
+
else if (c.get() instanceof core_1.Expressions.TypeNameOrInfer) {
|
|
80038
|
+
continue;
|
|
80039
|
+
}
|
|
80010
80040
|
else if (c.get() instanceof core_1.Expressions.ConvBody) {
|
|
80011
80041
|
const typ = node.findFirstExpression(core_1.Expressions.TypeNameOrInfer);
|
|
80012
80042
|
if (typ === undefined) {
|
|
@@ -80033,6 +80063,23 @@ class SourceTranspiler {
|
|
|
80033
80063
|
ret.append("abap.builtin.boolc(", c, traversal);
|
|
80034
80064
|
post.append(")", c, traversal);
|
|
80035
80065
|
}
|
|
80066
|
+
else if (c instanceof core_1.Nodes.TokenNode && c.getFirstToken().getStr().toUpperCase() === "REF") {
|
|
80067
|
+
const infer = node.findDirectExpression(core_1.Expressions.TypeNameOrInfer);
|
|
80068
|
+
if (infer?.concatTokens() !== "#") {
|
|
80069
|
+
throw new Error("transpiler: REF # todo1");
|
|
80070
|
+
}
|
|
80071
|
+
const scope = traversal.findCurrentScopeByToken(infer.getFirstToken());
|
|
80072
|
+
const inferType = traversal.lookupInferred(infer, scope);
|
|
80073
|
+
if (inferType === undefined) {
|
|
80074
|
+
throw new Error("transpiler: REF # todo, lookupInferred");
|
|
80075
|
+
}
|
|
80076
|
+
const typ = new transpile_types_1.TranspileTypes().toType(inferType);
|
|
80077
|
+
if (typ.startsWith("new abap.types.DataReference(") === false) {
|
|
80078
|
+
throw new Error("transpiler: REF # unexpected type");
|
|
80079
|
+
}
|
|
80080
|
+
ret.append(`${typ}.assign(`, c, traversal);
|
|
80081
|
+
post.append(")", c, traversal);
|
|
80082
|
+
}
|
|
80036
80083
|
else if (c instanceof core_1.Nodes.TokenNode && c.getFirstToken().getStr().toUpperCase() === "BIT") { // todo, this will not work in the general case
|
|
80037
80084
|
ret.append("abap.operators.bitnot(", c, traversal);
|
|
80038
80085
|
post.append(")", c, traversal);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.11",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -27,10 +27,10 @@
|
|
|
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.158",
|
|
31
|
+
"@abaplint/transpiler": "^2.11.11",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
|
-
"@types/node": "^24.2.
|
|
33
|
+
"@types/node": "^24.2.1",
|
|
34
34
|
"@types/progress": "^2.0.7",
|
|
35
35
|
"glob": "=7.2.0",
|
|
36
36
|
"progress": "^2.0.3",
|