@abaplint/core 2.102.3 → 2.102.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.
- package/build/src/abap/5_syntax/_type_utils.js +14 -0
- package/build/src/abap/5_syntax/expressions/method_call_param.js +1 -0
- package/build/src/abap/5_syntax/expressions/method_parameters.js +1 -0
- package/build/src/abap/5_syntax/expressions/string_template.js +3 -2
- package/build/src/abap/types/basic/floating_point_type.js +2 -2
- package/build/src/objects/table_type.js +37 -6
- package/build/src/registry.js +1 -1
- package/package.json +3 -3
|
@@ -214,7 +214,11 @@ class TypeUtils {
|
|
|
214
214
|
/*
|
|
215
215
|
console.dir(source);
|
|
216
216
|
console.dir(target);
|
|
217
|
+
console.dir(calculated);
|
|
217
218
|
*/
|
|
219
|
+
if (calculated && source instanceof basic_1.StringType && target instanceof basic_1.XStringType) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
218
222
|
if (calculated) {
|
|
219
223
|
return this.isAssignable(source, target);
|
|
220
224
|
}
|
|
@@ -265,6 +269,9 @@ class TypeUtils {
|
|
|
265
269
|
}
|
|
266
270
|
return false;
|
|
267
271
|
}
|
|
272
|
+
else if (target instanceof cgeneric_type_1.CGenericType) {
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
268
275
|
else if (target instanceof basic_1.XSequenceType || target instanceof basic_1.XStringType) {
|
|
269
276
|
if (((_g = source.getAbstractTypeData()) === null || _g === void 0 ? void 0 : _g.derivedFromConstant) === true) {
|
|
270
277
|
return true;
|
|
@@ -296,6 +303,13 @@ class TypeUtils {
|
|
|
296
303
|
return false;
|
|
297
304
|
}
|
|
298
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
|
+
}
|
|
299
313
|
else if (source instanceof basic_1.XStringType) {
|
|
300
314
|
if (target instanceof basic_1.CLikeType
|
|
301
315
|
|| target instanceof basic_1.IntegerType
|
|
@@ -53,6 +53,7 @@ class MethodCallParam {
|
|
|
53
53
|
sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);
|
|
54
54
|
}
|
|
55
55
|
const calculated = child.findFirstExpression(Expressions.MethodCallChain) !== undefined
|
|
56
|
+
|| child.findFirstExpression(Expressions.StringTemplate) !== undefined
|
|
56
57
|
|| child.findFirstExpression(Expressions.ArithOperator) !== undefined;
|
|
57
58
|
if (sourceType === undefined) {
|
|
58
59
|
throw new Error("No source type determined, method source");
|
|
@@ -127,6 +127,7 @@ class MethodParameters {
|
|
|
127
127
|
for (const item of items) {
|
|
128
128
|
const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);
|
|
129
129
|
const calculated = item.source.findFirstExpression(Expressions.MethodCallChain) !== undefined
|
|
130
|
+
|| item.source.findFirstExpression(Expressions.StringTemplate) !== undefined
|
|
130
131
|
|| item.source.findFirstExpression(Expressions.ArithOperator) !== undefined;
|
|
131
132
|
if (parameter === undefined) {
|
|
132
133
|
throw new Error("Method importing parameter \"" + item.name + "\" does not exist");
|
|
@@ -8,9 +8,10 @@ const _type_utils_1 = require("../_type_utils");
|
|
|
8
8
|
class StringTemplate {
|
|
9
9
|
runSyntax(node, scope, filename) {
|
|
10
10
|
const typeUtils = new _type_utils_1.TypeUtils(scope);
|
|
11
|
+
const ret = basic_1.StringType.get();
|
|
11
12
|
for (const templateSource of node.findAllExpressions(Expressions.StringTemplateSource)) {
|
|
12
13
|
const s = templateSource.findDirectExpression(Expressions.Source);
|
|
13
|
-
const type = new source_1.Source().runSyntax(s, scope, filename,
|
|
14
|
+
const type = new source_1.Source().runSyntax(s, scope, filename, ret);
|
|
14
15
|
if (type === undefined) {
|
|
15
16
|
throw new Error("No target type determined");
|
|
16
17
|
}
|
|
@@ -34,7 +35,7 @@ class StringTemplate {
|
|
|
34
35
|
throw new Error("Cannot apply ALPHA to this type");
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
return
|
|
38
|
+
return ret;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
exports.StringTemplate = StringTemplate;
|
|
@@ -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;
|
|
@@ -21,23 +21,50 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
getDescription() {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
var _a;
|
|
25
|
+
this.parseXML();
|
|
26
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.ddtext;
|
|
26
27
|
}
|
|
27
28
|
setDirty() {
|
|
28
29
|
this.parsedXML = undefined;
|
|
29
30
|
super.setDirty();
|
|
30
31
|
}
|
|
31
32
|
buildTableOptions() {
|
|
32
|
-
var _a, _b, _c;
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
34
|
+
let primaryKey = undefined;
|
|
35
|
+
if (((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.accessmode) === "S") {
|
|
36
|
+
primaryKey = {
|
|
37
|
+
isUnique: ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.keykind) === "U",
|
|
38
|
+
type: basic_1.TableAccessType.sorted,
|
|
39
|
+
keyFields: [],
|
|
40
|
+
name: "primary_key",
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
else if (((_c = this.parsedXML) === null || _c === void 0 ? void 0 : _c.accessmode) === "H") {
|
|
44
|
+
primaryKey = {
|
|
45
|
+
isUnique: ((_d = this.parsedXML) === null || _d === void 0 ? void 0 : _d.keykind) === "U",
|
|
46
|
+
type: basic_1.TableAccessType.hashed,
|
|
47
|
+
keyFields: [],
|
|
48
|
+
name: "primary_key",
|
|
49
|
+
};
|
|
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);
|
|
54
|
+
}
|
|
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
|
+
}
|
|
33
59
|
const tableOptions = {
|
|
34
60
|
withHeader: false,
|
|
35
61
|
keyType: Types.TableKeyType.user,
|
|
62
|
+
primaryKey: primaryKey,
|
|
36
63
|
secondary: [],
|
|
37
64
|
};
|
|
38
|
-
for (const k of ((
|
|
65
|
+
for (const k of ((_g = this.parsedXML) === null || _g === void 0 ? void 0 : _g.dd43v) || []) {
|
|
39
66
|
const fields = [];
|
|
40
|
-
for (const f of ((
|
|
67
|
+
for (const f of ((_h = this.parsedXML) === null || _h === void 0 ? void 0 : _h.dd42v) || []) {
|
|
41
68
|
if (f.keyname === k.keyname) {
|
|
42
69
|
fields.push(f.keyfield);
|
|
43
70
|
}
|
|
@@ -53,7 +80,7 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
53
80
|
default:
|
|
54
81
|
break;
|
|
55
82
|
}
|
|
56
|
-
(
|
|
83
|
+
(_j = tableOptions.secondary) === null || _j === void 0 ? void 0 : _j.push({
|
|
57
84
|
name: k.keyname,
|
|
58
85
|
type: accessType,
|
|
59
86
|
keyFields: fields,
|
|
@@ -141,6 +168,10 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
141
168
|
this.parsedXML.datatype = dd40v.DATATYPE;
|
|
142
169
|
this.parsedXML.leng = dd40v.LENG;
|
|
143
170
|
this.parsedXML.decimals = dd40v.DECIMALS;
|
|
171
|
+
this.parsedXML.accessmode = dd40v.ACCESSMODE;
|
|
172
|
+
this.parsedXML.keykind = dd40v.KEYKIND;
|
|
173
|
+
this.parsedXML.ddtext = dd40v.DDTEXT;
|
|
174
|
+
this.parsedXML.keydef = dd40v.KEYDEF;
|
|
144
175
|
for (const x of (0, xml_utils_1.xmlToArray)((_a = values.DD42V) === null || _a === void 0 ? void 0 : _a.DD42V)) {
|
|
145
176
|
this.parsedXML.dd42v.push({
|
|
146
177
|
keyname: x.SECKEYNAME || "",
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.102.
|
|
3
|
+
"version": "2.102.5",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://abaplint.org",
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.36.
|
|
53
|
+
"@microsoft/api-extractor": "^7.36.3",
|
|
54
54
|
"@types/chai": "^4.3.5",
|
|
55
55
|
"@types/mocha": "^10.0.1",
|
|
56
|
-
"@types/node": "^20.4.
|
|
56
|
+
"@types/node": "^20.4.4",
|
|
57
57
|
"chai": "^4.3.7",
|
|
58
58
|
"eslint": "^8.45.0",
|
|
59
59
|
"mocha": "^10.2.0",
|