@abaplint/core 2.112.15 → 2.112.17
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/abaplint.d.ts +1 -0
- package/build/src/abap/5_syntax/_builtin.js +0 -1
- package/build/src/abap/5_syntax/basic_types.js +0 -1
- package/build/src/abap/flow/flow_graph.js +3 -0
- package/build/src/abap/flow/statement_flow.js +38 -14
- package/build/src/abap/types/basic/character_type.js +1 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/cds_legacy_view.js +0 -1
- package/package.json +5 -5
package/build/abaplint.d.ts
CHANGED
|
@@ -2522,6 +2522,7 @@ export declare class FlowGraph {
|
|
|
2522
2522
|
private label;
|
|
2523
2523
|
constructor(counter: number);
|
|
2524
2524
|
getStart(): string;
|
|
2525
|
+
getLabel(): string;
|
|
2525
2526
|
getEnd(): string;
|
|
2526
2527
|
addEdge(from: string, to: string): void;
|
|
2527
2528
|
removeEdge(from: string, to: string): void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BuiltIn = exports.BuiltInMethod = void 0;
|
|
4
|
-
/* eslint-disable max-len */
|
|
5
4
|
const _typed_identifier_1 = require("../types/_typed_identifier");
|
|
6
5
|
const basic_1 = require("../types/basic");
|
|
7
6
|
const tokens_1 = require("../1_lexer/tokens");
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BasicTypes = void 0;
|
|
4
|
-
/* eslint-disable default-case */
|
|
5
4
|
const _typed_identifier_1 = require("../types/_typed_identifier");
|
|
6
5
|
const Expressions = require("../2_statements/expressions");
|
|
7
6
|
const Statements = require("../2_statements/statements");
|
|
@@ -11,22 +11,26 @@ class StatementFlow {
|
|
|
11
11
|
this.counter = 0;
|
|
12
12
|
}
|
|
13
13
|
build(stru) {
|
|
14
|
-
var _a, _b;
|
|
14
|
+
var _a, _b, _c;
|
|
15
15
|
const ret = [];
|
|
16
|
-
const
|
|
17
|
-
for (const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
const structures = stru.findAllStructuresMulti([Structures.Form, Structures.Method, Structures.FunctionModule]);
|
|
17
|
+
for (const s of structures) {
|
|
18
|
+
let name = "";
|
|
19
|
+
if (s.get() instanceof Structures.Form) {
|
|
20
|
+
name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
|
|
21
|
+
}
|
|
22
|
+
else if (s.get() instanceof Structures.Method) {
|
|
23
|
+
name = "METHOD " + ((_b = s.findFirstExpression(Expressions.MethodName)) === null || _b === void 0 ? void 0 : _b.concatTokens());
|
|
24
|
+
}
|
|
25
|
+
else if (s.get() instanceof Structures.FunctionModule) {
|
|
26
|
+
name = "FUNCTION " + ((_c = s.findFirstExpression(Expressions.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens());
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
throw new Error("StatementFlow, unknown structure");
|
|
30
|
+
}
|
|
27
31
|
this.counter = 1;
|
|
28
|
-
const graph = this.traverseBody(this.findBody(
|
|
29
|
-
graph.setLabel(
|
|
32
|
+
const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
|
|
33
|
+
graph.setLabel(name);
|
|
30
34
|
ret.push(graph);
|
|
31
35
|
}
|
|
32
36
|
return ret.map(f => f.reduce());
|
|
@@ -153,6 +157,7 @@ class StatementFlow {
|
|
|
153
157
|
|| type instanceof Structures.With
|
|
154
158
|
|| type instanceof Structures.Provide
|
|
155
159
|
|| type instanceof Structures.Select
|
|
160
|
+
|| type instanceof Structures.LoopAtScreen
|
|
156
161
|
|| type instanceof Structures.Do) {
|
|
157
162
|
const loopName = this.buildName(n.getFirstStatement());
|
|
158
163
|
const sub = this.traverseBody(this.findBody(n), Object.assign(Object.assign({}, context), { loopStart: loopName, loopEnd: graph.getEnd() }));
|
|
@@ -161,6 +166,25 @@ class StatementFlow {
|
|
|
161
166
|
graph.addEdge(sub.getEnd(), loopName);
|
|
162
167
|
graph.addEdge(loopName, graph.getEnd());
|
|
163
168
|
}
|
|
169
|
+
else if (type instanceof Structures.Data
|
|
170
|
+
|| type instanceof Structures.Types) {
|
|
171
|
+
// these doesnt affect control flow, so just take the first statement
|
|
172
|
+
const statement = n.getFirstStatement();
|
|
173
|
+
const name = this.buildName(statement);
|
|
174
|
+
graph.addEdge(current, name);
|
|
175
|
+
graph.addEdge(name, graph.getEnd());
|
|
176
|
+
}
|
|
177
|
+
else if (type instanceof Structures.AtFirst
|
|
178
|
+
|| type instanceof Structures.AtLast
|
|
179
|
+
|| type instanceof Structures.At
|
|
180
|
+
|| type instanceof Structures.OnChange) {
|
|
181
|
+
const name = this.buildName(n.getFirstStatement());
|
|
182
|
+
const body = this.traverseBody(this.findBody(n), context);
|
|
183
|
+
graph.addEdge(current, name);
|
|
184
|
+
graph.addGraph(name, body);
|
|
185
|
+
graph.addEdge(body.getEnd(), graph.getEnd());
|
|
186
|
+
graph.addEdge(current, graph.getEnd());
|
|
187
|
+
}
|
|
164
188
|
else if (type instanceof Structures.Try) {
|
|
165
189
|
const tryName = this.buildName(n.getFirstStatement());
|
|
166
190
|
const body = this.traverseBody(this.findBody(n), context);
|
|
@@ -11,7 +11,7 @@ class CharacterType extends _abstract_type_1.AbstractType {
|
|
|
11
11
|
this.length = length;
|
|
12
12
|
}
|
|
13
13
|
cloneType(input) {
|
|
14
|
-
const clone = Object.assign({}, this.getAbstractTypeData())
|
|
14
|
+
const clone = Object.assign({}, this.getAbstractTypeData());
|
|
15
15
|
if (input.qualifiedName) {
|
|
16
16
|
clone.qualifiedName = input.qualifiedName;
|
|
17
17
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -18,7 +18,6 @@ class CDSLegacyView {
|
|
|
18
18
|
key: "cds_legacy_view",
|
|
19
19
|
title: "CDS Legacy View",
|
|
20
20
|
shortDescription: `Identify CDS Legacy Views`,
|
|
21
|
-
// eslint-disable-next-line max-len
|
|
22
21
|
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
23
22
|
|
|
24
23
|
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.112.
|
|
3
|
+
"version": "2.112.17",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
7
7
|
"funding": "https://github.com/sponsors/larshp",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"lint": "eslint src/**/*.ts test/**/*.ts
|
|
10
|
-
"lint:fix": "eslint src/**/*.ts test/**/*.ts --
|
|
9
|
+
"lint": "eslint src/**/*.ts test/**/*.ts",
|
|
10
|
+
"lint:fix": "eslint src/**/*.ts test/**/*.ts --fix",
|
|
11
11
|
"compile": "tsc && sh scripts/version.sh",
|
|
12
12
|
"test": "npm run compile && mocha --timeout 1000 && npm run lint && npm run schema && api-extractor run",
|
|
13
13
|
"test:only": "npm run compile && mocha --timeout 1000000",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://abaplint.org",
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.47.
|
|
53
|
+
"@microsoft/api-extractor": "^7.47.6",
|
|
54
54
|
"@types/chai": "^4.3.17",
|
|
55
55
|
"@types/mocha": "^10.0.7",
|
|
56
56
|
"@types/node": "^22.2.0",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
|
-
"eslint": "^
|
|
58
|
+
"eslint": "^9.9.0",
|
|
59
59
|
"mocha": "^10.7.3",
|
|
60
60
|
"c8": "^10.1.2",
|
|
61
61
|
"source-map-support": "^0.5.21",
|