@abaplint/core 2.82.6 → 2.82.10
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.
|
@@ -524,39 +524,52 @@ class BasicTypes {
|
|
|
524
524
|
return foundType;
|
|
525
525
|
}
|
|
526
526
|
resolveConstantValue(expr) {
|
|
527
|
-
var _a;
|
|
527
|
+
var _a, _b;
|
|
528
528
|
if (!(expr.get() instanceof Expressions.SimpleFieldChain)) {
|
|
529
529
|
throw new Error("resolveConstantValue");
|
|
530
530
|
}
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
const found = this.scope.findVariable(
|
|
531
|
+
const firstNode = expr.getFirstChild();
|
|
532
|
+
const firstToken = firstNode.getFirstToken();
|
|
533
|
+
const firstName = firstToken.getStr();
|
|
534
|
+
if (firstNode.get() instanceof Expressions.Field) {
|
|
535
|
+
const found = this.scope.findVariable(firstName);
|
|
536
536
|
const val = found === null || found === void 0 ? void 0 : found.getValue();
|
|
537
537
|
if (typeof val === "string") {
|
|
538
|
-
this.scope.addReference(
|
|
538
|
+
this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);
|
|
539
539
|
return val;
|
|
540
540
|
}
|
|
541
541
|
return undefined;
|
|
542
542
|
}
|
|
543
|
-
else if (
|
|
544
|
-
|
|
545
|
-
|
|
543
|
+
else if (firstNode.get() instanceof Expressions.ClassName
|
|
544
|
+
&& firstName.toLowerCase() === this.scope.getName().toLowerCase()
|
|
545
|
+
&& (this.scope.getType() === _scope_type_1.ScopeType.Interface
|
|
546
|
+
|| this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)) {
|
|
547
|
+
const children = expr.getChildren();
|
|
548
|
+
const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
549
|
+
const found = this.scope.findVariable(token.getStr());
|
|
550
|
+
const val = found === null || found === void 0 ? void 0 : found.getValue();
|
|
551
|
+
if (typeof val === "string") {
|
|
552
|
+
this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);
|
|
553
|
+
return val;
|
|
554
|
+
}
|
|
555
|
+
return undefined;
|
|
556
|
+
}
|
|
557
|
+
else if (firstNode.get() instanceof Expressions.ClassName) {
|
|
558
|
+
const obj = this.scope.findObjectDefinition(firstName);
|
|
546
559
|
if (obj === undefined) {
|
|
547
|
-
if (this.scope.existsObject(
|
|
560
|
+
if (this.scope.existsObject(firstName).found === true) {
|
|
548
561
|
return undefined;
|
|
549
562
|
}
|
|
550
|
-
else if (this.scope.getDDIC().inErrorNamespace(
|
|
551
|
-
throw new Error("resolveConstantValue, not found: " +
|
|
563
|
+
else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {
|
|
564
|
+
throw new Error("resolveConstantValue, not found: " + firstName);
|
|
552
565
|
}
|
|
553
566
|
else {
|
|
554
|
-
this.scope.addReference(
|
|
567
|
+
this.scope.addReference(firstNode.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: firstName.toUpperCase() });
|
|
555
568
|
return undefined;
|
|
556
569
|
}
|
|
557
570
|
}
|
|
558
571
|
const children = expr.getChildren();
|
|
559
|
-
const token = (
|
|
572
|
+
const token = (_b = children[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();
|
|
560
573
|
const attr = token.getStr();
|
|
561
574
|
const c = new _object_oriented_1.ObjectOriented(this.scope).searchConstantName(obj, attr);
|
|
562
575
|
if (c instanceof class_constant_1.ClassConstant) {
|
|
@@ -60,7 +60,6 @@ class FindGlobalDefinitions {
|
|
|
60
60
|
if (def === undefined) {
|
|
61
61
|
return 1;
|
|
62
62
|
}
|
|
63
|
-
// todo, count constants
|
|
64
63
|
let count = 0;
|
|
65
64
|
for (const t of def.getTypeDefinitions().getAll()) {
|
|
66
65
|
count = count + this.count(t.type.getType());
|
|
@@ -68,6 +67,9 @@ class FindGlobalDefinitions {
|
|
|
68
67
|
for (const a of def.getAttributes().getAll()) {
|
|
69
68
|
count = count + this.count(a.getType());
|
|
70
69
|
}
|
|
70
|
+
for (const a of def.getAttributes().getConstants()) {
|
|
71
|
+
count = count + this.count(a.getType());
|
|
72
|
+
}
|
|
71
73
|
for (const m of def.getMethodDefinitions().getAll()) {
|
|
72
74
|
for (const p of m.getParameters().getAll()) {
|
|
73
75
|
count = count + this.count(p.getType());
|
|
@@ -146,6 +146,12 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
146
146
|
type: new basic_1.DataReference(new basic_1.AnyType())
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
+
else if (field.ROLLNAME === "OBJECT") {
|
|
150
|
+
components.push({
|
|
151
|
+
name: field.FIELDNAME,
|
|
152
|
+
type: new basic_1.GenericObjectReferenceType()
|
|
153
|
+
});
|
|
154
|
+
}
|
|
149
155
|
else {
|
|
150
156
|
const lookup = ddic.lookupObject(field.ROLLNAME);
|
|
151
157
|
components.push({ name: field.FIELDNAME, type: lookup.type });
|
|
@@ -4,6 +4,7 @@ exports.TableType = void 0;
|
|
|
4
4
|
const _abstract_object_1 = require("./_abstract_object");
|
|
5
5
|
const Types = require("../abap/types/basic");
|
|
6
6
|
const ddic_1 = require("../ddic");
|
|
7
|
+
const basic_1 = require("../abap/types/basic");
|
|
7
8
|
class TableType extends _abstract_object_1.AbstractObject {
|
|
8
9
|
constructor() {
|
|
9
10
|
super(...arguments);
|
|
@@ -55,6 +56,9 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
55
56
|
references.push({ object: lookup.object });
|
|
56
57
|
}
|
|
57
58
|
}
|
|
59
|
+
else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype === "OBJECT") {
|
|
60
|
+
type = new Types.TableType(new basic_1.GenericObjectReferenceType(), { withHeader: false }, this.getName());
|
|
61
|
+
}
|
|
58
62
|
else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype !== undefined) {
|
|
59
63
|
const lookup = ddic.lookupObject(this.parsedXML.rowtype);
|
|
60
64
|
type = new Types.TableType(lookup.type, { withHeader: false }, this.getName());
|
package/build/src/registry.js
CHANGED