@abaplint/core 2.113.181 → 2.113.183
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/statements/raise.js +1 -1
- package/build/src/abap/5_syntax/expressions/method_call_param.js +0 -1
- package/build/src/abap/5_syntax/expressions/method_parameters.js +4 -0
- package/build/src/abap/5_syntax/statements/include_type.js +21 -3
- package/build/src/abap/5_syntax/structures/data.js +38 -28
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +3 -0
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ class Raise {
|
|
|
11
11
|
const exporting = (0, combi_1.seq)("EXPORTING", expressions_1.ParameterListS);
|
|
12
12
|
const from = (0, combi_1.seq)("TYPE", expressions_1.ClassName, (0, combi_1.opt)((0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v750, (0, combi_1.alt)(mess, messid)), (0, combi_1.ver)(version_1.Version.v752, "USING MESSAGE"))), (0, combi_1.optPrio)(exporting));
|
|
13
13
|
const pre = (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("RESUMABLE"), "EXCEPTION"), "SHORTDUMP");
|
|
14
|
-
const clas = (0, combi_1.seq)(pre, (0, combi_1.altPrio)(from, (0, combi_1.ver)(version_1.Version.v752, expressions_1.Source), expressions_1.SimpleSource2));
|
|
14
|
+
const clas = (0, combi_1.seq)(pre, (0, combi_1.altPrio)(from, (0, combi_1.ver)(version_1.Version.v752, expressions_1.Source, version_1.Version.OpenABAP), expressions_1.SimpleSource2));
|
|
15
15
|
const ret = (0, combi_1.seq)("RAISE", (0, combi_1.altPrio)(clas, expressions_1.ExceptionName));
|
|
16
16
|
return ret;
|
|
17
17
|
}
|
|
@@ -88,7 +88,6 @@ class MethodCallParam {
|
|
|
88
88
|
new method_parameters_1.MethodParameters().runSyntax(child, input, method);
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
|
-
// console.dir(child);
|
|
92
91
|
const message = "MethodCallParam, unexpected child";
|
|
93
92
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
94
93
|
return;
|
|
@@ -207,9 +207,13 @@ class MethodParameters {
|
|
|
207
207
|
for (const i of method.getParameters().getImporting()) {
|
|
208
208
|
if (i.getName().toUpperCase() === name) {
|
|
209
209
|
targetType = i.getType();
|
|
210
|
+
break;
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
213
|
}
|
|
214
|
+
else {
|
|
215
|
+
targetType = method;
|
|
216
|
+
}
|
|
213
217
|
let sourceType = source_1.Source.runSyntax(source, input, targetType);
|
|
214
218
|
if (sourceType === undefined) {
|
|
215
219
|
if (method instanceof basic_1.VoidType) {
|
|
@@ -9,15 +9,22 @@ const _syntax_input_1 = require("../_syntax_input");
|
|
|
9
9
|
const assert_error_1 = require("../assert_error");
|
|
10
10
|
class IncludeType {
|
|
11
11
|
runSyntax(node, input) {
|
|
12
|
-
var _a, _b;
|
|
12
|
+
var _a, _b, _c;
|
|
13
13
|
const components = [];
|
|
14
14
|
const iname = node.findFirstExpression(Expressions.TypeName);
|
|
15
15
|
if (iname === undefined) {
|
|
16
16
|
throw new assert_error_1.AssertError("IncludeType, unexpected node structure");
|
|
17
17
|
}
|
|
18
18
|
const name = iname.getFirstToken().getStr();
|
|
19
|
+
const isStructure = node.findDirectTokenByText("STRUCTURE") !== undefined;
|
|
19
20
|
let ityp = new basic_types_1.BasicTypes(input).parseType(iname);
|
|
20
|
-
|
|
21
|
+
if (ityp instanceof basic_1.VoidType && isStructure) {
|
|
22
|
+
const found = (_a = input.scope.findVariable(name)) === null || _a === void 0 ? void 0 : _a.getType();
|
|
23
|
+
if (found) {
|
|
24
|
+
ityp = found;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const as = (_b = node.findExpressionAfterToken("AS")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
21
28
|
if (as && ityp instanceof basic_1.StructureType) {
|
|
22
29
|
ityp = new basic_1.StructureType(ityp.getComponents().concat([{
|
|
23
30
|
name: as,
|
|
@@ -25,7 +32,18 @@ class IncludeType {
|
|
|
25
32
|
asInclude: true,
|
|
26
33
|
}]));
|
|
27
34
|
}
|
|
28
|
-
|
|
35
|
+
else if (ityp instanceof basic_1.TableType && isStructure) {
|
|
36
|
+
ityp = ityp.getRowType();
|
|
37
|
+
}
|
|
38
|
+
else if (ityp instanceof basic_1.VoidType) {
|
|
39
|
+
return ityp;
|
|
40
|
+
}
|
|
41
|
+
if (!(ityp instanceof basic_1.StructureType)) {
|
|
42
|
+
const message = "not structured, " + name;
|
|
43
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, iname.getFirstToken(), message));
|
|
44
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
45
|
+
}
|
|
46
|
+
const suffix = (_c = node.findExpressionAfterToken("SUFFIX")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
29
47
|
if (suffix && ityp instanceof basic_1.StructureType) {
|
|
30
48
|
const components = [];
|
|
31
49
|
for (const c of ityp.getComponents()) {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Data = void 0;
|
|
4
|
-
const _syntax_input_1 = require("../_syntax_input");
|
|
5
4
|
const data_1 = require("../statements/data");
|
|
6
|
-
const _reference_1 = require("../_reference");
|
|
7
5
|
const nodes_1 = require("../../nodes");
|
|
8
6
|
const type_1 = require("../statements/type");
|
|
9
7
|
const _typed_identifier_1 = require("../../types/_typed_identifier");
|
|
@@ -12,9 +10,10 @@ const Basic = require("../../types/basic");
|
|
|
12
10
|
const Expressions = require("../../2_statements/expressions");
|
|
13
11
|
const Statements = require("../../2_statements/statements");
|
|
14
12
|
const Structures = require("../../3_structures/structures");
|
|
13
|
+
const include_type_1 = require("../statements/include_type");
|
|
15
14
|
class Data {
|
|
16
15
|
static runSyntax(node, input) {
|
|
17
|
-
var _a
|
|
16
|
+
var _a;
|
|
18
17
|
const fouth = (_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getChildren()[3];
|
|
19
18
|
const isCommonPart = fouth instanceof nodes_1.TokenNode && fouth.concatTokens() === "COMMON";
|
|
20
19
|
if (isCommonPart) {
|
|
@@ -49,25 +48,47 @@ class Data {
|
|
|
49
48
|
}
|
|
50
49
|
else if (c instanceof nodes_1.StatementNode && ctyp instanceof Statements.IncludeType) {
|
|
51
50
|
// INCLUDES
|
|
52
|
-
|
|
53
|
-
const
|
|
51
|
+
/*
|
|
52
|
+
const typeToken = c.findFirstExpression(Expressions.TypeName)?.getFirstToken();
|
|
53
|
+
const typeName = typeToken?.getStr();
|
|
54
|
+
|
|
54
55
|
let foundId = input.scope.findType(typeName);
|
|
55
56
|
if (foundId === undefined) {
|
|
56
|
-
|
|
57
|
+
foundId = input.scope.findVariable(typeName);
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
+
|
|
60
|
+
let found = foundId?.getType();
|
|
59
61
|
if (found === undefined) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
const f = input.scope.getDDIC().lookupTableOrView(typeName).type;
|
|
63
|
+
if (f instanceof TypedIdentifier) {
|
|
64
|
+
found = f.getType();
|
|
65
|
+
} else {
|
|
66
|
+
found = f;
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
input.scope.addReference(typeToken, foundId, ReferenceType.TypeReference, input.filename);
|
|
70
|
+
}
|
|
71
|
+
if (found instanceof Basic.VoidType) {
|
|
72
|
+
if (table === true) {
|
|
73
|
+
const ttyp = new Basic.TableType(found, {withHeader: true, keyType: Basic.TableKeyType.default});
|
|
74
|
+
return new TypedIdentifier(name, input.filename, ttyp);
|
|
75
|
+
} else {
|
|
76
|
+
return new TypedIdentifier(name, input.filename, found);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (found instanceof Basic.UnknownType) {
|
|
80
|
+
return new TypedIdentifier(name, input.filename, new Basic.UnknownType("unknown type, " + typeName));
|
|
81
|
+
}
|
|
82
|
+
if (found instanceof Basic.TableType && found.isWithHeader()) {
|
|
83
|
+
found = found.getRowType();
|
|
67
84
|
}
|
|
68
|
-
|
|
69
|
-
|
|
85
|
+
if (!(found instanceof Basic.StructureType)) {
|
|
86
|
+
const message = "not structured, " + typeName;
|
|
87
|
+
input.issues.push(syntaxIssue(input, typeToken!, message));
|
|
88
|
+
return new TypedIdentifier(name, input.filename, Basic.VoidType.get(CheckSyntaxKey));
|
|
70
89
|
}
|
|
90
|
+
*/
|
|
91
|
+
const found = new include_type_1.IncludeType().runSyntax(c, input);
|
|
71
92
|
if (found instanceof Basic.VoidType) {
|
|
72
93
|
if (table === true) {
|
|
73
94
|
const ttyp = new Basic.TableType(found, { withHeader: true, keyType: Basic.TableKeyType.default });
|
|
@@ -77,18 +98,7 @@ class Data {
|
|
|
77
98
|
return new _typed_identifier_1.TypedIdentifier(name, input.filename, found);
|
|
78
99
|
}
|
|
79
100
|
}
|
|
80
|
-
|
|
81
|
-
return new _typed_identifier_1.TypedIdentifier(name, input.filename, new Basic.UnknownType("unknown type, " + typeName));
|
|
82
|
-
}
|
|
83
|
-
if (found instanceof Basic.TableType && found.isWithHeader()) {
|
|
84
|
-
found = found.getRowType();
|
|
85
|
-
}
|
|
86
|
-
if (!(found instanceof Basic.StructureType)) {
|
|
87
|
-
const message = "not structured, " + typeName;
|
|
88
|
-
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, typeToken, message));
|
|
89
|
-
return new _typed_identifier_1.TypedIdentifier(name, input.filename, Basic.VoidType.get(_syntax_input_1.CheckSyntaxKey));
|
|
90
|
-
}
|
|
91
|
-
for (const c of found.getComponents()) {
|
|
101
|
+
for (const c of found) {
|
|
92
102
|
components.push(c);
|
|
93
103
|
}
|
|
94
104
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -2858,6 +2858,9 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
2858
2858
|
}
|
|
2859
2859
|
replaceLineFunctions(node, lowFile, highSyntax, highFile) {
|
|
2860
2860
|
var _a, _b;
|
|
2861
|
+
if (this.lowReg.getConfig().getVersion() === version_1.Version.OpenABAP) {
|
|
2862
|
+
return undefined;
|
|
2863
|
+
}
|
|
2861
2864
|
const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());
|
|
2862
2865
|
for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {
|
|
2863
2866
|
if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {
|