@abaplint/core 2.113.127 → 2.113.128
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/3_structures/structures/dynpro_loop.js +1 -1
- package/build/src/abap/5_syntax/_type_utils.js +3 -0
- package/build/src/abap/5_syntax/expressions/attribute_chain.js +1 -2
- package/build/src/abap/5_syntax/expressions/method_call_chain.js +7 -5
- package/build/src/abap/5_syntax/expressions/source.js +42 -39
- package/build/src/abap/5_syntax/expressions/target.js +6 -4
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +2 -1
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ const _combi_1 = require("./_combi");
|
|
|
6
6
|
const chain_1 = require("./chain");
|
|
7
7
|
class DynproLoop {
|
|
8
8
|
getMatcher() {
|
|
9
|
-
return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.DynproLoop), (0, _combi_1.star)((0, _combi_1.alt)((0, _combi_1.sta)(Statements.Module), (0, _combi_1.sub)(chain_1.Chain))), (0, _combi_1.sta)(Statements.EndLoop));
|
|
9
|
+
return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.DynproLoop), (0, _combi_1.star)((0, _combi_1.alt)((0, _combi_1.sta)(Statements.Module), (0, _combi_1.sta)(Statements.Field), (0, _combi_1.sub)(chain_1.Chain))), (0, _combi_1.sta)(Statements.EndLoop));
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.DynproLoop = DynproLoop;
|
|
@@ -524,6 +524,9 @@ class TypeUtils {
|
|
|
524
524
|
else if ((target instanceof basic_1.StringType || target instanceof basic_1.CharacterType)
|
|
525
525
|
&& source instanceof basic_1.StructureType
|
|
526
526
|
&& this.isCharLike(source)) {
|
|
527
|
+
if (this.structureContainsString(source) === true) {
|
|
528
|
+
return false;
|
|
529
|
+
}
|
|
527
530
|
return true;
|
|
528
531
|
}
|
|
529
532
|
else if (source instanceof basic_1.StructureType) {
|
|
@@ -15,8 +15,7 @@ class AttributeChain {
|
|
|
15
15
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), "Not an object reference(AttributeChain)"));
|
|
16
16
|
return void_type_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
const first = children[0];
|
|
18
|
+
const first = node.getChildren()[0];
|
|
20
19
|
if (!(first.get() instanceof expressions_1.AttributeName)) {
|
|
21
20
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), "AttributeChain, unexpected first child"));
|
|
22
21
|
return void_type_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
@@ -18,23 +18,25 @@ class MethodCallChain {
|
|
|
18
18
|
static runSyntax(node, input, targetType) {
|
|
19
19
|
var _a, _b;
|
|
20
20
|
const helper = new _object_oriented_1.ObjectOriented(input.scope);
|
|
21
|
-
const children = node.getChildren()
|
|
22
|
-
const first = children
|
|
21
|
+
const children = node.getChildren();
|
|
22
|
+
const first = children[0];
|
|
23
23
|
if (first === undefined) {
|
|
24
24
|
const message = "MethodCallChain, first child expected";
|
|
25
25
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
26
26
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
27
27
|
}
|
|
28
|
+
let currentIndex = 1;
|
|
28
29
|
let context = this.findTop(first, input, targetType);
|
|
29
30
|
if (first.get() instanceof Expressions.MethodCall) {
|
|
30
|
-
|
|
31
|
+
currentIndex--;
|
|
31
32
|
}
|
|
32
33
|
let previous = undefined;
|
|
33
|
-
while (children.length
|
|
34
|
-
const current = children
|
|
34
|
+
while (currentIndex <= children.length) {
|
|
35
|
+
const current = children[currentIndex];
|
|
35
36
|
if (current === undefined) {
|
|
36
37
|
break;
|
|
37
38
|
}
|
|
39
|
+
currentIndex++;
|
|
38
40
|
if (current instanceof nodes_1.ExpressionNode && current.get() instanceof Expressions.MethodCall) {
|
|
39
41
|
// for built-in methods set className to undefined
|
|
40
42
|
const className = context instanceof basic_1.ObjectReferenceType ? context.getIdentifierName() : undefined;
|
|
@@ -189,46 +189,49 @@ class Source {
|
|
|
189
189
|
let hexExpected = false;
|
|
190
190
|
let hexNext = false;
|
|
191
191
|
while (children.length >= 0) {
|
|
192
|
-
if (first instanceof nodes_1.ExpressionNode
|
|
193
|
-
|
|
194
|
-
if (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
if (first instanceof nodes_1.ExpressionNode) {
|
|
193
|
+
const get = first.get();
|
|
194
|
+
if (get instanceof Expressions.MethodCallChain) {
|
|
195
|
+
context = method_call_chain_1.MethodCallChain.runSyntax(first, input, targetType);
|
|
196
|
+
if (context === undefined) {
|
|
197
|
+
const message = "Method has no RETURNING value";
|
|
198
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
199
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
200
|
+
}
|
|
198
201
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
context = field_chain_1.FieldChain.runSyntax(first, input, type);
|
|
202
|
-
}
|
|
203
|
-
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.StringTemplate) {
|
|
204
|
-
context = string_template_1.StringTemplate.runSyntax(first, input);
|
|
205
|
-
}
|
|
206
|
-
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Source) {
|
|
207
|
-
const found = Source.runSyntax(first, input);
|
|
208
|
-
context = this.infer(context, found);
|
|
209
|
-
}
|
|
210
|
-
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Constant) {
|
|
211
|
-
const found = constant_1.Constant.runSyntax(first);
|
|
212
|
-
context = this.infer(context, found);
|
|
213
|
-
}
|
|
214
|
-
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Dereference) {
|
|
215
|
-
context = dereference_1.Dereference.runSyntax(first, context, input);
|
|
216
|
-
}
|
|
217
|
-
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ComponentChain) {
|
|
218
|
-
context = component_chain_1.ComponentChain.runSyntax(context, first, input);
|
|
219
|
-
}
|
|
220
|
-
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ArithOperator) {
|
|
221
|
-
if (first.concatTokens() === "**") {
|
|
222
|
-
context = new basic_1.FloatType();
|
|
202
|
+
else if (get instanceof Expressions.FieldChain) {
|
|
203
|
+
context = field_chain_1.FieldChain.runSyntax(first, input, type);
|
|
223
204
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
205
|
+
else if (get instanceof Expressions.StringTemplate) {
|
|
206
|
+
context = string_template_1.StringTemplate.runSyntax(first, input);
|
|
207
|
+
}
|
|
208
|
+
else if (get instanceof Expressions.Source) {
|
|
209
|
+
const found = Source.runSyntax(first, input);
|
|
210
|
+
context = this.infer(context, found);
|
|
211
|
+
}
|
|
212
|
+
else if (get instanceof Expressions.Constant) {
|
|
213
|
+
const found = constant_1.Constant.runSyntax(first);
|
|
214
|
+
context = this.infer(context, found);
|
|
215
|
+
}
|
|
216
|
+
else if (get instanceof Expressions.Dereference) {
|
|
217
|
+
context = dereference_1.Dereference.runSyntax(first, context, input);
|
|
218
|
+
}
|
|
219
|
+
else if (get instanceof Expressions.ComponentChain) {
|
|
220
|
+
context = component_chain_1.ComponentChain.runSyntax(context, first, input);
|
|
221
|
+
}
|
|
222
|
+
else if (get instanceof Expressions.ArithOperator) {
|
|
223
|
+
if (first.concatTokens() === "**") {
|
|
224
|
+
context = new basic_1.FloatType();
|
|
225
|
+
}
|
|
226
|
+
const operator = first.concatTokens().toUpperCase();
|
|
227
|
+
if (operator === "BIT-OR" || operator === "BIT-AND" || operator === "BIT-XOR") {
|
|
228
|
+
hexExpected = true;
|
|
229
|
+
hexNext = true;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
else if (get instanceof Expressions.AttributeChain) {
|
|
233
|
+
context = attribute_chain_1.AttributeChain.runSyntax(context, first, input, type);
|
|
228
234
|
}
|
|
229
|
-
}
|
|
230
|
-
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.AttributeChain) {
|
|
231
|
-
context = attribute_chain_1.AttributeChain.runSyntax(context, first, input, type);
|
|
232
235
|
}
|
|
233
236
|
if (hexExpected === true) {
|
|
234
237
|
if (!(context instanceof basic_1.VoidType)
|
|
@@ -273,7 +276,7 @@ class Source {
|
|
|
273
276
|
}
|
|
274
277
|
static addIfInferred(node, input, inferredType) {
|
|
275
278
|
const basic = new basic_types_1.BasicTypes(input);
|
|
276
|
-
const typeExpression = node.
|
|
279
|
+
const typeExpression = node.findDirectExpression(Expressions.TypeNameOrInfer);
|
|
277
280
|
const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();
|
|
278
281
|
const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
|
|
279
282
|
if (typeName === "#" && inferredType && typeToken) {
|
|
@@ -297,7 +300,7 @@ class Source {
|
|
|
297
300
|
}
|
|
298
301
|
static determineType(node, input, targetType) {
|
|
299
302
|
const basic = new basic_types_1.BasicTypes(input);
|
|
300
|
-
const typeExpression = node.
|
|
303
|
+
const typeExpression = node.findDirectExpression(Expressions.TypeNameOrInfer);
|
|
301
304
|
const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();
|
|
302
305
|
const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
|
|
303
306
|
if (typeExpression === undefined) {
|
|
@@ -26,8 +26,8 @@ class Target {
|
|
|
26
26
|
return found.getType();
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
const children = node.getChildren()
|
|
30
|
-
const first = children
|
|
29
|
+
const children = node.getChildren();
|
|
30
|
+
const first = children[0];
|
|
31
31
|
if (first === undefined || !(first instanceof nodes_1.ExpressionNode)) {
|
|
32
32
|
return undefined;
|
|
33
33
|
}
|
|
@@ -37,11 +37,13 @@ class Target {
|
|
|
37
37
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
38
38
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
let currentIndex = 1;
|
|
41
|
+
while (currentIndex <= children.length) {
|
|
42
|
+
const current = children[currentIndex];
|
|
42
43
|
if (current === undefined) {
|
|
43
44
|
break;
|
|
44
45
|
}
|
|
46
|
+
currentIndex++;
|
|
45
47
|
if (current.get() instanceof tokens_1.Dash) {
|
|
46
48
|
if (context instanceof unknown_type_1.UnknownType) {
|
|
47
49
|
const message = "Not a structure, type unknown, target";
|
package/build/src/registry.js
CHANGED
|
@@ -1239,7 +1239,8 @@ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
|
1239
1239
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
1240
1240
|
}
|
|
1241
1241
|
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
1242
|
-
${indentation}CREATE OBJECT ${uniqueName2}
|
|
1242
|
+
${indentation}CREATE OBJECT ${uniqueName2}.
|
|
1243
|
+
${indentation}${uniqueName2}->if_t100_message~t100key = ${uniqueName1}.\n`;
|
|
1243
1244
|
if (withs.length > 0) {
|
|
1244
1245
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
1245
1246
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.128",
|
|
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.52.8",
|
|
54
54
|
"@types/chai": "^4.3.20",
|
|
55
55
|
"@types/mocha": "^10.0.10",
|
|
56
|
-
"@types/node": "^24.0.
|
|
56
|
+
"@types/node": "^24.0.1",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
|
-
"eslint": "^9.
|
|
58
|
+
"eslint": "^9.29.0",
|
|
59
59
|
"mocha": "^11.6.0",
|
|
60
60
|
"c8": "^10.1.3",
|
|
61
61
|
"source-map-support": "^0.5.21",
|