@abaplint/core 2.82.7 → 2.82.11
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 +8 -0
- package/build/src/abap/5_syntax/basic_types.js +28 -15
- package/build/src/abap/types/basic/decfloat_type.js +20 -0
- package/build/src/abap/types/basic/index.js +1 -0
- package/build/src/ddic.js +2 -0
- package/build/src/objects/table_type.js +7 -0
- package/build/src/registry.js +1 -1
- package/build/src/rules/unknown_types.js +28 -3
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -324,6 +324,7 @@ declare namespace BasicTypes {
|
|
|
324
324
|
CSequenceType,
|
|
325
325
|
DataReference,
|
|
326
326
|
DateType,
|
|
327
|
+
DecFloatType,
|
|
327
328
|
DecFloat16Type,
|
|
328
329
|
DecFloat34Type,
|
|
329
330
|
FloatType,
|
|
@@ -1241,6 +1242,13 @@ declare class DecFloat34Type extends AbstractType {
|
|
|
1241
1242
|
containsVoid(): boolean;
|
|
1242
1243
|
}
|
|
1243
1244
|
|
|
1245
|
+
declare class DecFloatType extends AbstractType {
|
|
1246
|
+
toText(): string;
|
|
1247
|
+
isGeneric(): boolean;
|
|
1248
|
+
toABAP(): string;
|
|
1249
|
+
containsVoid(): boolean;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1244
1252
|
declare class Decimals extends Expression {
|
|
1245
1253
|
getRunnable(): IStatementRunnable;
|
|
1246
1254
|
}
|
|
@@ -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) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DecFloatType = void 0;
|
|
4
|
+
const _abstract_type_1 = require("./_abstract_type");
|
|
5
|
+
class DecFloatType extends _abstract_type_1.AbstractType {
|
|
6
|
+
toText() {
|
|
7
|
+
return "```decfloat```";
|
|
8
|
+
}
|
|
9
|
+
isGeneric() {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
toABAP() {
|
|
13
|
+
return "decfloat";
|
|
14
|
+
}
|
|
15
|
+
containsVoid() {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.DecFloatType = DecFloatType;
|
|
20
|
+
//# sourceMappingURL=decfloat_type.js.map
|
|
@@ -16,6 +16,7 @@ __exportStar(require("./clike_type"), exports);
|
|
|
16
16
|
__exportStar(require("./csequence_type"), exports);
|
|
17
17
|
__exportStar(require("./data_reference_type"), exports);
|
|
18
18
|
__exportStar(require("./date_type"), exports);
|
|
19
|
+
__exportStar(require("./decfloat_type"), exports);
|
|
19
20
|
__exportStar(require("./decfloat16_type"), exports);
|
|
20
21
|
__exportStar(require("./decfloat34_type"), exports);
|
|
21
22
|
__exportStar(require("./float_type"), exports);
|
package/build/src/ddic.js
CHANGED
|
@@ -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,12 @@ 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
|
+
}
|
|
62
|
+
else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype === "DATA") {
|
|
63
|
+
type = new Types.TableType(new basic_1.DataReference(new basic_1.AnyType()), { withHeader: false }, this.getName());
|
|
64
|
+
}
|
|
58
65
|
else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype !== undefined) {
|
|
59
66
|
const lookup = ddic.lookupObject(this.parsedXML.rowtype);
|
|
60
67
|
type = new Types.TableType(lookup.type, { withHeader: false }, this.getName());
|
package/build/src/registry.js
CHANGED
|
@@ -40,9 +40,27 @@ class UnknownTypes {
|
|
|
40
40
|
return [];
|
|
41
41
|
}
|
|
42
42
|
const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;
|
|
43
|
-
|
|
43
|
+
const found = this.traverse(spaghetti.getTop());
|
|
44
|
+
return this.removeDuplicates(found);
|
|
44
45
|
}
|
|
45
46
|
/////////////////////
|
|
47
|
+
removeDuplicates(list) {
|
|
48
|
+
const deduplicated = [];
|
|
49
|
+
for (const result of list) {
|
|
50
|
+
let cont = false;
|
|
51
|
+
for (const d of deduplicated) {
|
|
52
|
+
if (result.getStart().equals(d.getStart())) {
|
|
53
|
+
cont = true;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (cont === true) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
deduplicated.push(result);
|
|
61
|
+
}
|
|
62
|
+
return deduplicated;
|
|
63
|
+
}
|
|
46
64
|
traverse(node) {
|
|
47
65
|
var _a;
|
|
48
66
|
const ret = [];
|
|
@@ -73,7 +91,14 @@ class UnknownTypes {
|
|
|
73
91
|
}
|
|
74
92
|
}
|
|
75
93
|
for (const v of node.getData().idefs) {
|
|
76
|
-
const found = this.
|
|
94
|
+
const found = this.checkMethodParameters(v);
|
|
95
|
+
if (found) {
|
|
96
|
+
const message = "Contains unknown, " + found.found;
|
|
97
|
+
ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
for (const v of node.getData().cdefs) {
|
|
101
|
+
const found = this.checkMethodParameters(v);
|
|
77
102
|
if (found) {
|
|
78
103
|
const message = "Contains unknown, " + found.found;
|
|
79
104
|
ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));
|
|
@@ -84,7 +109,7 @@ class UnknownTypes {
|
|
|
84
109
|
}
|
|
85
110
|
return ret;
|
|
86
111
|
}
|
|
87
|
-
|
|
112
|
+
checkMethodParameters(idef) {
|
|
88
113
|
var _a;
|
|
89
114
|
for (const m of ((_a = idef.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {
|
|
90
115
|
for (const p of m.getParameters().getAll()) {
|