@abaplint/core 2.102.4 → 2.102.6
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.
|
@@ -303,6 +303,13 @@ class TypeUtils {
|
|
|
303
303
|
return false;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
+
else if (source instanceof basic_1.ObjectReferenceType) {
|
|
307
|
+
if (target instanceof basic_1.XSequenceType
|
|
308
|
+
|| target instanceof basic_1.IntegerType
|
|
309
|
+
|| target instanceof basic_1.XStringType) {
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
306
313
|
else if (source instanceof basic_1.XStringType) {
|
|
307
314
|
if (target instanceof basic_1.CLikeType
|
|
308
315
|
|| target instanceof basic_1.IntegerType
|
|
@@ -7,16 +7,16 @@ const data_definition_1 = require("../expressions/data_definition");
|
|
|
7
7
|
const unknown_type_1 = require("../../types/basic/unknown_type");
|
|
8
8
|
class Data {
|
|
9
9
|
runSyntax(node, scope, filename) {
|
|
10
|
+
const name = node.findFirstExpression(Expressions.DefinitionName);
|
|
10
11
|
const dd = node.findFirstExpression(Expressions.DataDefinition);
|
|
11
12
|
if (dd) {
|
|
12
13
|
const id = new data_definition_1.DataDefinition().runSyntax(dd, scope, filename);
|
|
13
14
|
if ((id === null || id === void 0 ? void 0 : id.getType().isGeneric()) === true
|
|
14
15
|
&& (id === null || id === void 0 ? void 0 : id.getType().containsVoid()) === false) {
|
|
15
|
-
throw new Error("DATA definition cannot be generic");
|
|
16
|
+
throw new Error("DATA definition cannot be generic, " + name);
|
|
16
17
|
}
|
|
17
18
|
return id;
|
|
18
19
|
}
|
|
19
|
-
const name = node.findFirstExpression(Expressions.DefinitionName);
|
|
20
20
|
if (name) {
|
|
21
21
|
return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new unknown_type_1.UnknownType("data, fallback"));
|
|
22
22
|
}
|
|
@@ -15,10 +15,10 @@ class FloatingPointType extends _abstract_type_1.AbstractType {
|
|
|
15
15
|
return this.length;
|
|
16
16
|
}
|
|
17
17
|
toText() {
|
|
18
|
-
return "```
|
|
18
|
+
return "```f LENGTH " + this.getLength() + "```";
|
|
19
19
|
}
|
|
20
20
|
toABAP() {
|
|
21
|
-
return "
|
|
21
|
+
return "f LENGTH " + this.getLength();
|
|
22
22
|
}
|
|
23
23
|
isGeneric() {
|
|
24
24
|
return false;
|
|
@@ -30,7 +30,7 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
30
30
|
super.setDirty();
|
|
31
31
|
}
|
|
32
32
|
buildTableOptions() {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
34
34
|
let primaryKey = undefined;
|
|
35
35
|
if (((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.accessmode) === "S") {
|
|
36
36
|
primaryKey = {
|
|
@@ -39,34 +39,36 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
39
39
|
keyFields: [],
|
|
40
40
|
name: "primary_key",
|
|
41
41
|
};
|
|
42
|
-
for (const f of ((_c = this.parsedXML) === null || _c === void 0 ? void 0 : _c.dd42v) || []) {
|
|
43
|
-
if (f.keyname === "") {
|
|
44
|
-
primaryKey.keyFields.push(f.keyfield);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
42
|
}
|
|
48
|
-
else if (((
|
|
43
|
+
else if (((_c = this.parsedXML) === null || _c === void 0 ? void 0 : _c.accessmode) === "H") {
|
|
49
44
|
primaryKey = {
|
|
50
|
-
isUnique: ((
|
|
45
|
+
isUnique: ((_d = this.parsedXML) === null || _d === void 0 ? void 0 : _d.keykind) === "U",
|
|
51
46
|
type: basic_1.TableAccessType.hashed,
|
|
52
47
|
keyFields: [],
|
|
53
48
|
name: "primary_key",
|
|
54
49
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
}
|
|
51
|
+
for (const f of ((_e = this.parsedXML) === null || _e === void 0 ? void 0 : _e.dd42v) || []) {
|
|
52
|
+
if (f.keyname === "") {
|
|
53
|
+
primaryKey === null || primaryKey === void 0 ? void 0 : primaryKey.keyFields.push(f.keyfield);
|
|
59
54
|
}
|
|
60
55
|
}
|
|
56
|
+
if (((_f = this.parsedXML) === null || _f === void 0 ? void 0 : _f.keydef) === "T" && (primaryKey === null || primaryKey === void 0 ? void 0 : primaryKey.keyFields.length) === 0) {
|
|
57
|
+
primaryKey === null || primaryKey === void 0 ? void 0 : primaryKey.keyFields.push("table_line");
|
|
58
|
+
}
|
|
59
|
+
let keyType = Types.TableKeyType.user;
|
|
60
|
+
if (((_g = this.parsedXML) === null || _g === void 0 ? void 0 : _g.keydef) === "D") {
|
|
61
|
+
keyType = Types.TableKeyType.default;
|
|
62
|
+
}
|
|
61
63
|
const tableOptions = {
|
|
62
64
|
withHeader: false,
|
|
63
|
-
keyType:
|
|
65
|
+
keyType: keyType,
|
|
64
66
|
primaryKey: primaryKey,
|
|
65
67
|
secondary: [],
|
|
66
68
|
};
|
|
67
|
-
for (const k of ((
|
|
69
|
+
for (const k of ((_h = this.parsedXML) === null || _h === void 0 ? void 0 : _h.dd43v) || []) {
|
|
68
70
|
const fields = [];
|
|
69
|
-
for (const f of ((
|
|
71
|
+
for (const f of ((_j = this.parsedXML) === null || _j === void 0 ? void 0 : _j.dd42v) || []) {
|
|
70
72
|
if (f.keyname === k.keyname) {
|
|
71
73
|
fields.push(f.keyfield);
|
|
72
74
|
}
|
|
@@ -82,7 +84,7 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
82
84
|
default:
|
|
83
85
|
break;
|
|
84
86
|
}
|
|
85
|
-
(
|
|
87
|
+
(_k = tableOptions.secondary) === null || _k === void 0 ? void 0 : _k.push({
|
|
86
88
|
name: k.keyname,
|
|
87
89
|
type: accessType,
|
|
88
90
|
keyFields: fields,
|
|
@@ -173,6 +175,7 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
173
175
|
this.parsedXML.accessmode = dd40v.ACCESSMODE;
|
|
174
176
|
this.parsedXML.keykind = dd40v.KEYKIND;
|
|
175
177
|
this.parsedXML.ddtext = dd40v.DDTEXT;
|
|
178
|
+
this.parsedXML.keydef = dd40v.KEYDEF;
|
|
176
179
|
for (const x of (0, xml_utils_1.xmlToArray)((_a = values.DD42V) === null || _a === void 0 ? void 0 : _a.DD42V)) {
|
|
177
180
|
this.parsedXML.dd42v.push({
|
|
178
181
|
keyname: x.SECKEYNAME || "",
|
package/build/src/registry.js
CHANGED