@abaplint/core 2.102.6 → 2.102.8
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/abaplint.d.ts +1 -0
- package/build/src/abap/5_syntax/_builtin.js +6 -1
- package/build/src/abap/5_syntax/statements/assign.js +1 -1
- package/build/src/abap/5_syntax/statements/class_local_friends.js +14 -1
- package/build/src/objects/table_type.js +25 -26
- package/build/src/registry.js +1 -1
- package/build/src/rules/cyclomatic_complexity.js +3 -0
- package/package.json +4 -4
package/build/abaplint.d.ts
CHANGED
|
@@ -6120,6 +6120,7 @@ declare class TableType extends AbstractObject {
|
|
|
6120
6120
|
};
|
|
6121
6121
|
getDescription(): string | undefined;
|
|
6122
6122
|
setDirty(): void;
|
|
6123
|
+
private buildPrimaryKey;
|
|
6123
6124
|
private buildTableOptions;
|
|
6124
6125
|
parseType(reg: IRegistry): AbstractType;
|
|
6125
6126
|
private parseXML;
|
|
@@ -16,7 +16,12 @@ class BuiltInMethod extends _identifier_1.Identifier {
|
|
|
16
16
|
this.row = row;
|
|
17
17
|
}
|
|
18
18
|
getRequiredParameters() {
|
|
19
|
-
|
|
19
|
+
const ret = [];
|
|
20
|
+
for (const i in this.method.mandatory) {
|
|
21
|
+
const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);
|
|
22
|
+
ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));
|
|
23
|
+
}
|
|
24
|
+
return ret;
|
|
20
25
|
}
|
|
21
26
|
getOptional() {
|
|
22
27
|
throw new Error("BuiltInMethod->Method not implemented.");
|
|
@@ -13,7 +13,7 @@ class Assign {
|
|
|
13
13
|
const theSource = sources[sources.length - 1];
|
|
14
14
|
let sourceType = new source_1.Source().runSyntax(theSource, scope, filename);
|
|
15
15
|
if (sourceType === undefined || ((_b = node.findDirectExpression(Expressions.AssignSource)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Dynamic))) {
|
|
16
|
-
sourceType = new basic_1.
|
|
16
|
+
sourceType = new basic_1.AnyType();
|
|
17
17
|
}
|
|
18
18
|
for (const d of ((_c = node.findDirectExpression(Expressions.AssignSource)) === null || _c === void 0 ? void 0 : _c.findAllExpressions(Expressions.Dynamic)) || []) {
|
|
19
19
|
new dynamic_1.Dynamic().runSyntax(d, scope, filename);
|
|
@@ -5,10 +5,15 @@ const Expressions = require("../../2_statements/expressions");
|
|
|
5
5
|
const _reference_1 = require("../_reference");
|
|
6
6
|
class ClassLocalFriends {
|
|
7
7
|
runSyntax(node, scope, filename) {
|
|
8
|
-
const
|
|
8
|
+
const classNames = node.findAllExpressions(Expressions.ClassName);
|
|
9
|
+
const found = classNames[0];
|
|
9
10
|
if (found) {
|
|
10
11
|
const token = found.getFirstToken();
|
|
11
12
|
const name = token.getStr();
|
|
13
|
+
if (scope.getParentObj().getType() === "CLAS"
|
|
14
|
+
&& name.toUpperCase() !== scope.getParentObj().getName().toUpperCase()) {
|
|
15
|
+
throw new Error(`Befriending must be ` + scope.getParentObj().getName().toUpperCase());
|
|
16
|
+
}
|
|
12
17
|
const def = scope.findClassDefinition(name);
|
|
13
18
|
if (def) {
|
|
14
19
|
scope.addReference(token, def, _reference_1.ReferenceType.ObjectOrientedReference, filename);
|
|
@@ -17,6 +22,14 @@ class ClassLocalFriends {
|
|
|
17
22
|
throw new Error(`Class ${name.toUpperCase()} not found`);
|
|
18
23
|
}
|
|
19
24
|
}
|
|
25
|
+
for (let i = 1; i < classNames.length; i++) {
|
|
26
|
+
const className = classNames[i].concatTokens();
|
|
27
|
+
// make sure to check also DEFINITION DEFERRED
|
|
28
|
+
const found = scope.existsObject(className);
|
|
29
|
+
if (found.found === false) {
|
|
30
|
+
throw new Error(`Class ${className.toUpperCase()} not found`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
20
33
|
}
|
|
21
34
|
}
|
|
22
35
|
exports.ClassLocalFriends = ClassLocalFriends;
|
|
@@ -29,46 +29,45 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
29
29
|
this.parsedXML = undefined;
|
|
30
30
|
super.setDirty();
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
var _a, _b, _c, _d, _e
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
buildPrimaryKey() {
|
|
33
|
+
var _a, _b, _c, _d, _e;
|
|
34
|
+
const primaryKey = {
|
|
35
|
+
isUnique: ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.keykind) === "U",
|
|
36
|
+
type: basic_1.TableAccessType.standard,
|
|
37
|
+
keyFields: [],
|
|
38
|
+
name: "primary_key",
|
|
39
|
+
};
|
|
40
|
+
if (((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.accessmode) === "S") {
|
|
41
|
+
primaryKey.type = basic_1.TableAccessType.sorted;
|
|
42
42
|
}
|
|
43
43
|
else if (((_c = this.parsedXML) === null || _c === void 0 ? void 0 : _c.accessmode) === "H") {
|
|
44
|
-
primaryKey =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
keyFields: [],
|
|
48
|
-
name: "primary_key",
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
for (const f of ((_e = this.parsedXML) === null || _e === void 0 ? void 0 : _e.dd42v) || []) {
|
|
44
|
+
primaryKey.type = basic_1.TableAccessType.hashed;
|
|
45
|
+
}
|
|
46
|
+
for (const f of ((_d = this.parsedXML) === null || _d === void 0 ? void 0 : _d.dd42v) || []) {
|
|
52
47
|
if (f.keyname === "") {
|
|
53
|
-
primaryKey
|
|
48
|
+
primaryKey.keyFields.push(f.keyfield);
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
|
-
if (((
|
|
57
|
-
primaryKey
|
|
51
|
+
if (((_e = this.parsedXML) === null || _e === void 0 ? void 0 : _e.keydef) === "T" && primaryKey.keyFields.length === 0) {
|
|
52
|
+
primaryKey.keyFields.push("table_line");
|
|
58
53
|
}
|
|
54
|
+
return primaryKey;
|
|
55
|
+
}
|
|
56
|
+
buildTableOptions() {
|
|
57
|
+
var _a, _b, _c, _d;
|
|
59
58
|
let keyType = Types.TableKeyType.user;
|
|
60
|
-
if (((
|
|
59
|
+
if (((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.keydef) === "D") {
|
|
61
60
|
keyType = Types.TableKeyType.default;
|
|
62
61
|
}
|
|
63
62
|
const tableOptions = {
|
|
64
63
|
withHeader: false,
|
|
65
64
|
keyType: keyType,
|
|
66
|
-
primaryKey:
|
|
65
|
+
primaryKey: this.buildPrimaryKey(),
|
|
67
66
|
secondary: [],
|
|
68
67
|
};
|
|
69
|
-
for (const k of ((
|
|
68
|
+
for (const k of ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.dd43v) || []) {
|
|
70
69
|
const fields = [];
|
|
71
|
-
for (const f of ((
|
|
70
|
+
for (const f of ((_c = this.parsedXML) === null || _c === void 0 ? void 0 : _c.dd42v) || []) {
|
|
72
71
|
if (f.keyname === k.keyname) {
|
|
73
72
|
fields.push(f.keyfield);
|
|
74
73
|
}
|
|
@@ -84,7 +83,7 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
84
83
|
default:
|
|
85
84
|
break;
|
|
86
85
|
}
|
|
87
|
-
(
|
|
86
|
+
(_d = tableOptions.secondary) === null || _d === void 0 ? void 0 : _d.push({
|
|
88
87
|
name: k.keyname,
|
|
89
88
|
type: accessType,
|
|
90
89
|
keyFields: fields,
|
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.8",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
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.5",
|
|
57
57
|
"chai": "^4.3.7",
|
|
58
|
-
"eslint": "^8.
|
|
58
|
+
"eslint": "^8.46.0",
|
|
59
59
|
"mocha": "^10.2.0",
|
|
60
|
-
"c8": "^8.0.
|
|
60
|
+
"c8": "^8.0.1",
|
|
61
61
|
"source-map-support": "^0.5.21",
|
|
62
62
|
"ts-json-schema-generator": "^1.2.0",
|
|
63
63
|
"typescript": "^5.1.6"
|