@abaplint/core 2.95.38 → 2.95.39
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.
|
@@ -10,6 +10,9 @@ const _reference_1 = require("../_reference");
|
|
|
10
10
|
const _object_oriented_1 = require("../_object_oriented");
|
|
11
11
|
class ComponentChain {
|
|
12
12
|
runSyntax(context, node, scope, filename) {
|
|
13
|
+
if (context === undefined) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
13
16
|
const children = node.getChildren();
|
|
14
17
|
for (let i = 0; i < children.length; i++) {
|
|
15
18
|
if (context instanceof void_type_1.VoidType || context instanceof basic_1.UnknownType) {
|
|
@@ -72,7 +75,7 @@ class ComponentChain {
|
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
77
|
else {
|
|
75
|
-
throw new Error("ComponentChain, not a structure");
|
|
78
|
+
throw new Error("ComponentChain, not a structure, " + (context === null || context === void 0 ? void 0 : context.constructor.name));
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
81
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ComponentCompare = void 0;
|
|
4
4
|
const Expressions = require("../../2_statements/expressions");
|
|
5
|
-
const
|
|
5
|
+
const component_chain_1 = require("./component_chain");
|
|
6
6
|
const source_1 = require("./source");
|
|
7
7
|
class ComponentCompare {
|
|
8
8
|
runSyntax(node, scope, filename, type) {
|
|
@@ -10,23 +10,7 @@ class ComponentCompare {
|
|
|
10
10
|
if (chain === undefined) {
|
|
11
11
|
throw new Error("ComponentCompare, chain not found");
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
if (chain.getChildren().length === 1
|
|
15
|
-
&& type !== undefined
|
|
16
|
-
&& !(type instanceof basic_1.VoidType)
|
|
17
|
-
&& !(type instanceof basic_1.UnknownType)
|
|
18
|
-
&& !(type instanceof basic_1.AnyType)) {
|
|
19
|
-
const fieldName = chain.concatTokens();
|
|
20
|
-
if (fieldName.toLowerCase() !== "table_line") {
|
|
21
|
-
if (!(type instanceof basic_1.StructureType)) {
|
|
22
|
-
throw new Error("ComponentCompare, source not structured");
|
|
23
|
-
}
|
|
24
|
-
if (type.getComponentByName(fieldName) === undefined) {
|
|
25
|
-
throw new Error("Component \"" + fieldName + "\" not part of structure");
|
|
26
|
-
}
|
|
27
|
-
// todo, check type compatibility
|
|
28
|
-
}
|
|
29
|
-
}
|
|
13
|
+
new component_chain_1.ComponentChain().runSyntax(type, chain, scope, filename);
|
|
30
14
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
31
15
|
new source_1.Source().runSyntax(s, scope, filename);
|
|
32
16
|
}
|
|
@@ -6,12 +6,14 @@ const target_1 = require("../expressions/target");
|
|
|
6
6
|
const source_1 = require("../expressions/source");
|
|
7
7
|
const component_compare_1 = require("../expressions/component_compare");
|
|
8
8
|
const component_cond_1 = require("../expressions/component_cond");
|
|
9
|
+
const basic_1 = require("../../types/basic");
|
|
9
10
|
class DeleteInternal {
|
|
10
11
|
runSyntax(node, scope, filename) {
|
|
11
12
|
var _a;
|
|
12
13
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
13
14
|
new source_1.Source().runSyntax(s, scope, filename);
|
|
14
15
|
}
|
|
16
|
+
let targetType = undefined;
|
|
15
17
|
const target = node.findDirectExpression(Expressions.Target);
|
|
16
18
|
if (target) {
|
|
17
19
|
let tabl = undefined;
|
|
@@ -23,14 +25,17 @@ class DeleteInternal {
|
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
if (tabl === undefined) {
|
|
26
|
-
new target_1.Target().runSyntax(target, scope, filename);
|
|
28
|
+
targetType = new target_1.Target().runSyntax(target, scope, filename);
|
|
29
|
+
if (targetType instanceof basic_1.TableType) {
|
|
30
|
+
targetType = targetType.getRowType();
|
|
31
|
+
}
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
for (const t of node.findDirectExpressions(Expressions.ComponentCompare)) {
|
|
30
|
-
new component_compare_1.ComponentCompare().runSyntax(t, scope, filename);
|
|
35
|
+
new component_compare_1.ComponentCompare().runSyntax(t, scope, filename, targetType);
|
|
31
36
|
}
|
|
32
37
|
for (const t of node.findDirectExpressions(Expressions.ComponentCond)) {
|
|
33
|
-
new component_cond_1.ComponentCond().runSyntax(t, scope, filename);
|
|
38
|
+
new component_cond_1.ComponentCond().runSyntax(t, scope, filename, targetType);
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
}
|
package/build/src/registry.js
CHANGED