@abaplint/core 2.113.231 → 2.113.233
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/2_statements/expressions/component_compare_simple.js +1 -1
- package/build/src/abap/2_statements/statements/read_table.js +3 -4
- package/build/src/abap/5_syntax/_type_utils.js +22 -1
- package/build/src/abap/5_syntax/expressions/component_compare_simple.js +3 -1
- package/build/src/abap/5_syntax/expressions/field_assignment.js +1 -1
- package/build/src/abap/5_syntax/statements/method_implementation.js +8 -0
- package/build/src/abap/5_syntax/statements/read_table.js +5 -0
- package/build/src/registry.js +1 -1
- package/package.json +3 -3
|
@@ -7,7 +7,7 @@ const component_chain_simple_1 = require("./component_chain_simple");
|
|
|
7
7
|
const version_1 = require("../../../version");
|
|
8
8
|
class ComponentCompareSimple extends combi_1.Expression {
|
|
9
9
|
getRunnable() {
|
|
10
|
-
const source = (0, combi_1.
|
|
10
|
+
const source = (0, combi_1.altPrio)((0, combi_1.ver)(version_1.Version.v740sp02, _1.Source, version_1.Version.OpenABAP), _1.SimpleSource4);
|
|
11
11
|
const ret = (0, combi_1.seq)((0, combi_1.altPrio)(component_chain_simple_1.ComponentChainSimple, _1.Dynamic), "=", source);
|
|
12
12
|
return (0, combi_1.plus)(ret);
|
|
13
13
|
}
|
|
@@ -10,12 +10,11 @@ class ReadTable {
|
|
|
10
10
|
const comparing = (0, combi_1.seq)("COMPARING", (0, combi_1.alt)((0, combi_1.plus)(expressions_1.FieldSub), (0, combi_1.plus)(expressions_1.Dynamic)));
|
|
11
11
|
const index = (0, combi_1.seq)("INDEX", expressions_1.Source);
|
|
12
12
|
const components = (0, combi_1.seq)((0, combi_1.alt)(expressions_1.Field, expressions_1.Dynamic), "COMPONENTS", expressions_1.ComponentCompareSimple);
|
|
13
|
-
const
|
|
14
|
-
const key = (0, combi_1.seq)((0, combi_1.altPrio)("WITH KEY", "WITH TABLE KEY"), (0, combi_1.alt)(expressions_1.ComponentCompareSimple, components, (0, combi_1.seq)((0, combi_1.optPrio)("="), source)));
|
|
13
|
+
const key = (0, combi_1.seq)((0, combi_1.altPrio)("WITH KEY", "WITH TABLE KEY"), (0, combi_1.alt)(expressions_1.ComponentCompareSimple, components, (0, combi_1.seq)((0, combi_1.optPrio)("="), expressions_1.Source)));
|
|
15
14
|
const using = (0, combi_1.seq)("USING KEY", (0, combi_1.alt)(expressions_1.Field, expressions_1.Dynamic));
|
|
16
|
-
const from = (0, combi_1.seq)("FROM",
|
|
15
|
+
const from = (0, combi_1.seq)("FROM", expressions_1.Source);
|
|
17
16
|
const perm = (0, combi_1.per)((0, combi_1.alt)(index, key, from), expressions_1.ReadTableTarget, using, comparing, "CASTING", (0, combi_1.seq)("TRANSPORTING", (0, combi_1.altPrio)("ALL FIELDS", "NO FIELDS", transporting_fields_1.TransportingFields)), "BINARY SEARCH");
|
|
18
|
-
return (0, combi_1.seq)("READ TABLE",
|
|
17
|
+
return (0, combi_1.seq)("READ TABLE", (0, combi_1.alt)(expressions_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source, version_1.Version.OpenABAP)), (0, combi_1.opt)(perm));
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
exports.ReadTable = ReadTable;
|
|
@@ -503,9 +503,30 @@ class TypeUtils {
|
|
|
503
503
|
return true;
|
|
504
504
|
}
|
|
505
505
|
else if (source instanceof basic_1.StructureType) {
|
|
506
|
-
|
|
506
|
+
const targetDeep = this.structureContainsString(target);
|
|
507
|
+
const sourceDeep = this.structureContainsString(source);
|
|
508
|
+
if (targetDeep && !sourceDeep) {
|
|
507
509
|
return false;
|
|
508
510
|
}
|
|
511
|
+
const targetComponents = target.getComponents();
|
|
512
|
+
const sourceComponents = source.getComponents();
|
|
513
|
+
if (targetComponents.length !== sourceComponents.length) {
|
|
514
|
+
if (targetDeep === true || sourceDeep === true) {
|
|
515
|
+
return false;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
for (let i = 0; i < targetComponents.length; i++) {
|
|
519
|
+
if (sourceComponents[i] === undefined) {
|
|
520
|
+
continue;
|
|
521
|
+
}
|
|
522
|
+
// hmm
|
|
523
|
+
if (sourceComponents[i].type instanceof basic_1.StringType && !(targetComponents[i].type instanceof basic_1.StringType)) {
|
|
524
|
+
return false;
|
|
525
|
+
}
|
|
526
|
+
else if (!(sourceComponents[i].type instanceof basic_1.StringType) && targetComponents[i].type instanceof basic_1.StringType) {
|
|
527
|
+
return false;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
509
530
|
return true;
|
|
510
531
|
}
|
|
511
532
|
else if (target.containsVoid() === true) {
|
|
@@ -18,7 +18,9 @@ class ComponentCompareSimple {
|
|
|
18
18
|
else if (c.get() instanceof Expressions.Dynamic) {
|
|
19
19
|
targetType = undefined;
|
|
20
20
|
}
|
|
21
|
-
else if (c.get() instanceof Expressions.Source
|
|
21
|
+
else if (c.get() instanceof Expressions.Source
|
|
22
|
+
|| c.get() instanceof Expressions.SimpleSource4
|
|
23
|
+
|| c.get() instanceof Expressions.SimpleSource2) {
|
|
22
24
|
const sourceType = source_1.Source.runSyntax(c, input, targetType);
|
|
23
25
|
if (targetType && new _type_utils_1.TypeUtils(input.scope).isAssignable(sourceType, targetType) === false) {
|
|
24
26
|
const message = "ComponentCompareSimple, incompatible types";
|
|
@@ -26,7 +26,7 @@ class FieldAssignment {
|
|
|
26
26
|
const text = c.concatTokens();
|
|
27
27
|
if (text !== "-" && context instanceof basic_1.StructureType) {
|
|
28
28
|
context = context.getComponentByName(text);
|
|
29
|
-
if (context === undefined
|
|
29
|
+
if (context === undefined) {
|
|
30
30
|
const message = `field ${text} does not exist in structure`;
|
|
31
31
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
32
32
|
return;
|
|
@@ -6,6 +6,7 @@ const _object_oriented_1 = require("../_object_oriented");
|
|
|
6
6
|
const _scope_type_1 = require("../_scope_type");
|
|
7
7
|
const _reference_1 = require("../_reference");
|
|
8
8
|
const _syntax_input_1 = require("../_syntax_input");
|
|
9
|
+
const visibility_1 = require("../../4_file_information/visibility");
|
|
9
10
|
class MethodImplementation {
|
|
10
11
|
runSyntax(node, input) {
|
|
11
12
|
const helper = new _object_oriented_1.ObjectOriented(input.scope);
|
|
@@ -19,6 +20,13 @@ class MethodImplementation {
|
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
const { method: methodDefinition } = helper.searchMethodName(classDefinition, methodName);
|
|
23
|
+
if (classDefinition.isForTesting()
|
|
24
|
+
&& (methodDefinition === null || methodDefinition === void 0 ? void 0 : methodDefinition.getVisibility()) !== visibility_1.Visibility.Private
|
|
25
|
+
&& ["SETUP", "TEARDOWN", "CLASS_SETUP", "CLASS_TEARDOWN"].includes(methodName.toUpperCase())) {
|
|
26
|
+
const message = "Special test method \"" + methodName + "\" must be private";
|
|
27
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
22
30
|
const start = node.getFirstToken().getStart();
|
|
23
31
|
if ((methodDefinition === null || methodDefinition === void 0 ? void 0 : methodDefinition.isStatic()) === false) {
|
|
24
32
|
input.scope.push(_scope_type_1.ScopeType.MethodInstance, methodName, start, input.filename);
|
|
@@ -42,6 +42,11 @@ class ReadTable {
|
|
|
42
42
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
+
else if (sourceType instanceof basic_1.TableType && sourceType.getAccessType() === basic_1.TableAccessType.hashed) {
|
|
46
|
+
const message = "INDEX on hashed table not possible";
|
|
47
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
51
|
const fromSource = node.findExpressionAfterToken("FROM");
|
|
47
52
|
if (fromSource) {
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.233",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@microsoft/api-extractor": "^7.53.1",
|
|
54
54
|
"@types/chai": "^4.3.20",
|
|
55
55
|
"@types/mocha": "^10.0.10",
|
|
56
|
-
"@types/node": "^24.
|
|
56
|
+
"@types/node": "^24.9.1",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
|
-
"eslint": "^9.
|
|
58
|
+
"eslint": "^9.38.0",
|
|
59
59
|
"mocha": "^11.7.4",
|
|
60
60
|
"c8": "^10.1.3",
|
|
61
61
|
"source-map-support": "^0.5.21",
|