@abaplint/core 2.115.22 → 2.115.24
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/cast.js +1 -1
- package/build/src/abap/2_statements/statements/move.js +1 -2
- package/build/src/abap/5_syntax/statements/create_object.js +7 -6
- package/build/src/cds/expressions/cds_annotation.js +3 -1
- package/build/src/cds/expressions/cds_arithmetics.js +4 -1
- package/build/src/objects/rename/renamer_helper.js +9 -1
- package/build/src/registry.js +1 -1
- package/package.json +3 -3
|
@@ -9,7 +9,7 @@ const let_1 = require("./let");
|
|
|
9
9
|
class Cast extends combi_1.Expression {
|
|
10
10
|
getRunnable() {
|
|
11
11
|
const rparen = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight));
|
|
12
|
-
const cast = (0, combi_1.seq)("CAST", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.optPrio)(let_1.Let), _1.Source, rparen);
|
|
12
|
+
const cast = (0, combi_1.seq)("CAST", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.optPrio)(let_1.Let), _1.Source, rparen, (0, combi_1.opt)(_1.Dereference));
|
|
13
13
|
return (0, combi_1.ver)(version_1.Version.v740sp02, cast, version_1.Version.OpenABAP);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -14,8 +14,7 @@ class Move {
|
|
|
14
14
|
const equals = (0, combi_1.altPrio)((0, combi_1.altPrio)(chained, "?="), calcAssign);
|
|
15
15
|
// todo, move "?=" to CAST?
|
|
16
16
|
const eq = (0, combi_1.seq)(expressions_1.Target, equals, expressions_1.Source);
|
|
17
|
-
|
|
18
|
-
return (0, combi_1.alt)(move, eq, eqd);
|
|
17
|
+
return (0, combi_1.alt)(move, eq);
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
exports.Move = Move;
|
|
@@ -72,8 +72,9 @@ class CreateObject {
|
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
else if (found instanceof basic_1.ObjectReferenceType) {
|
|
75
|
-
const
|
|
76
|
-
|
|
75
|
+
const identifier = found.getIdentifier();
|
|
76
|
+
const idFound = input.scope.findObjectDefinition(identifier.getName());
|
|
77
|
+
if (idFound instanceof types_1.InterfaceDefinition && type === undefined) {
|
|
77
78
|
const message = "Interface reference, cannot be instantiated";
|
|
78
79
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
79
80
|
return;
|
|
@@ -85,11 +86,11 @@ class CreateObject {
|
|
|
85
86
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
|
-
else if (
|
|
89
|
-
cdef =
|
|
89
|
+
else if (idFound instanceof types_1.ClassDefinition && cdef === undefined) {
|
|
90
|
+
cdef = idFound;
|
|
90
91
|
}
|
|
91
|
-
if (type === undefined &&
|
|
92
|
-
const message =
|
|
92
|
+
if (type === undefined && idFound instanceof types_1.ClassDefinition && idFound.isAbstract() === true) {
|
|
93
|
+
const message = identifier.getName() + " is abstract, cannot be instantiated";
|
|
93
94
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
@@ -7,7 +7,9 @@ const cds_annotation_array_1 = require("./cds_annotation_array");
|
|
|
7
7
|
class CDSAnnotation extends combi_1.Expression {
|
|
8
8
|
getRunnable() {
|
|
9
9
|
const nameWithSlash = (0, combi_1.seq)((0, combi_1.regex)(/^\w+$/), (0, combi_1.star)((0, combi_1.seq)("/", (0, combi_1.regex)(/^\w+$/))));
|
|
10
|
-
|
|
10
|
+
// Support both "@Name" (single token) and "@ Name" (two tokens with space)
|
|
11
|
+
const annotationStart = (0, combi_1.alt)((0, combi_1.regex)(/^@\w+$/), (0, combi_1.seq)("@", (0, combi_1.regex)(/^\w+$/)));
|
|
12
|
+
return (0, combi_1.seq)(annotationStart, (0, combi_1.star)((0, combi_1.seq)(".", nameWithSlash)), (0, combi_1.opt)((0, combi_1.seq)(":", (0, combi_1.alt)(cds_annotation_array_1.CDSAnnotationArray, _1.CDSAnnotationObject, _1.CDSAnnotationSimple))));
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
15
|
exports.CDSAnnotation = CDSAnnotation;
|
|
@@ -9,11 +9,14 @@ class CDSArithmetics extends combi_1.Expression {
|
|
|
9
9
|
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", _1.CDSName)));
|
|
10
10
|
const val = (0, combi_1.altPrio)(cds_integer_1.CDSInteger, _1.CDSFunction, _1.CDSCase, _1.CDSCast, _1.CDSString, _1.CDSAggregate, name);
|
|
11
11
|
const operator = (0, combi_1.altPrio)("+", "-", "*", "/");
|
|
12
|
+
// Support unary operators (e.g., "- field" in CASE expressions)
|
|
13
|
+
const unary = (0, combi_1.altPrio)("-", "+");
|
|
14
|
+
const unaryExpression = (0, combi_1.seq)(unary, val);
|
|
12
15
|
const operatorValue = (0, combi_1.seq)(operator, val);
|
|
13
16
|
const paren = (0, combi_1.seq)("(", val, (0, combi_1.plusPrio)(operatorValue), ")");
|
|
14
17
|
const noParen = (0, combi_1.seq)(val, (0, combi_1.plusPrio)(operatorValue));
|
|
15
18
|
// todo: this is pretty bad, it needs a rewrite
|
|
16
|
-
return (0, combi_1.altPrio)((0, combi_1.seq)(paren, (0, combi_1.starPrio)(operatorValue)), noParen);
|
|
19
|
+
return (0, combi_1.altPrio)(unaryExpression, (0, combi_1.seq)(paren, (0, combi_1.starPrio)(operatorValue)), noParen);
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
exports.CDSArithmetics = CDSArithmetics;
|
|
@@ -25,7 +25,15 @@ class RenamerHelper {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
// start with the last reference in the file first, if there are multiple refs per line
|
|
28
|
-
|
|
28
|
+
// sort refs by position descending (row desc, then col desc) so edits don't corrupt positions
|
|
29
|
+
refs.sort((a, b) => {
|
|
30
|
+
const rowDiff = b.getStart().getRow() - a.getStart().getRow();
|
|
31
|
+
if (rowDiff !== 0) {
|
|
32
|
+
return rowDiff;
|
|
33
|
+
}
|
|
34
|
+
return b.getStart().getCol() - a.getStart().getCol();
|
|
35
|
+
});
|
|
36
|
+
return this.replaceRefs(refs, oldName, newName);
|
|
29
37
|
}
|
|
30
38
|
renameDDICCodeReferences(obj, oldName, newName) {
|
|
31
39
|
const changes = [];
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.115.
|
|
3
|
+
"version": "2.115.24",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@microsoft/api-extractor": "^7.56.3",
|
|
54
54
|
"@types/chai": "^4.3.20",
|
|
55
55
|
"@types/mocha": "^10.0.10",
|
|
56
|
-
"@types/node": "^24.10.
|
|
56
|
+
"@types/node": "^24.10.13",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
58
|
"eslint": "^9.39.2",
|
|
59
59
|
"mocha": "^11.7.5",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"fast-xml-parser": "^5.3.
|
|
66
|
+
"fast-xml-parser": "^5.3.5",
|
|
67
67
|
"json5": "^2.2.3",
|
|
68
68
|
"vscode-languageserver-types": "^3.17.5"
|
|
69
69
|
}
|