@abaplint/core 2.89.4 → 2.89.5
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.
|
@@ -120,7 +120,11 @@ class Source {
|
|
|
120
120
|
case "VALUE":
|
|
121
121
|
{
|
|
122
122
|
const foundType = this.determineType(node, scope, filename, targetType);
|
|
123
|
-
|
|
123
|
+
const bodyType = new value_body_1.ValueBody().runSyntax(node.findDirectExpression(Expressions.ValueBody), scope, filename, foundType);
|
|
124
|
+
if (foundType === undefined || foundType.isGeneric()) {
|
|
125
|
+
this.addIfInferred(node, scope, filename, bodyType);
|
|
126
|
+
}
|
|
127
|
+
return foundType ? foundType : bodyType;
|
|
124
128
|
}
|
|
125
129
|
default:
|
|
126
130
|
return new unknown_type_1.UnknownType("todo, Source type " + tok);
|
|
@@ -33,6 +33,9 @@ class ValueBody {
|
|
|
33
33
|
while (scope.getType() === _scope_type_1.ScopeType.For) {
|
|
34
34
|
scope.pop(node.getLastToken().getEnd());
|
|
35
35
|
}
|
|
36
|
+
if ((targetType === null || targetType === void 0 ? void 0 : targetType.isGeneric()) && type) {
|
|
37
|
+
return type;
|
|
38
|
+
}
|
|
36
39
|
return targetType ? targetType : type;
|
|
37
40
|
}
|
|
38
41
|
}
|
package/build/src/ddic.js
CHANGED
|
@@ -46,13 +46,13 @@ class DDIC {
|
|
|
46
46
|
lookupBuiltinType(name, length, decimals, qualifiedName) {
|
|
47
47
|
switch (name) {
|
|
48
48
|
case "STRING":
|
|
49
|
-
return new Types.StringType(name);
|
|
49
|
+
return new Types.StringType(qualifiedName || name);
|
|
50
50
|
case "XSTRING":
|
|
51
|
-
return new Types.XStringType(name);
|
|
51
|
+
return new Types.XStringType(qualifiedName || name);
|
|
52
52
|
case "D":
|
|
53
|
-
return new Types.DateType(name);
|
|
53
|
+
return new Types.DateType(qualifiedName || name);
|
|
54
54
|
case "T":
|
|
55
|
-
return new Types.TimeType(name);
|
|
55
|
+
return new Types.TimeType(qualifiedName || name);
|
|
56
56
|
case "XSEQUENCE":
|
|
57
57
|
return new Types.XSequenceType(qualifiedName);
|
|
58
58
|
case "CLIKE":
|
|
@@ -81,9 +81,9 @@ class DDIC {
|
|
|
81
81
|
return new Types.CSequenceType(qualifiedName);
|
|
82
82
|
case "I":
|
|
83
83
|
case "INT8": // todo, take version into account
|
|
84
|
-
return new Types.IntegerType(name);
|
|
84
|
+
return new Types.IntegerType(qualifiedName || name);
|
|
85
85
|
case "F":
|
|
86
|
-
return new Types.FloatType(name);
|
|
86
|
+
return new Types.FloatType(qualifiedName || name);
|
|
87
87
|
case "P":
|
|
88
88
|
if (length && decimals) {
|
|
89
89
|
return new Types.PackedType(length, decimals, qualifiedName);
|
package/build/src/registry.js
CHANGED
|
@@ -1202,6 +1202,9 @@ ${indentation} output = ${topTarget}.`;
|
|
|
1202
1202
|
}
|
|
1203
1203
|
else if (b.get() instanceof Expressions.Source) {
|
|
1204
1204
|
structureName = b.concatTokens();
|
|
1205
|
+
if (base && (valueBody === null || valueBody === void 0 ? void 0 : valueBody.findDirectTokenByText("(")) === undefined) {
|
|
1206
|
+
structureName = uniqueName;
|
|
1207
|
+
}
|
|
1205
1208
|
}
|
|
1206
1209
|
else if (b.get() instanceof Expressions.ValueBodyLines) {
|
|
1207
1210
|
body += indentation + "APPEND " + b.concatTokens() + ` TO ${uniqueName}.\n`;
|