@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.
@@ -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,6 +11,9 @@ class FlowGraph {
11
11
  getStart() {
12
12
  return this.startNode;
13
13
  }
14
+ getLabel() {
15
+ return this.label;
16
+ }
14
17
  getEnd() {
15
18
  return this.endNode;
16
19
  }
@@ -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 forms = stru.findAllStructures(Structures.Form);
17
- for (const f of forms) {
18
- const formName = "FORM " + ((_a = f.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
19
- this.counter = 1;
20
- const graph = this.traverseBody(this.findBody(f), { procedureEnd: "end#1" });
21
- graph.setLabel(formName);
22
- ret.push(graph);
23
- }
24
- const methods = stru.findAllStructures(Structures.Method);
25
- for (const f of methods) {
26
- const methodName = "METHOD " + ((_b = f.findFirstExpression(Expressions.MethodName)) === null || _b === void 0 ? void 0 : _b.concatTokens());
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(f), { procedureEnd: "end#1" });
29
- graph.setLabel(methodName);
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
  }
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.112.15";
70
+ return "2.112.17";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -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.15",
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 --format unix",
10
- "lint:fix": "eslint src/**/*.ts test/**/*.ts --format unix --fix",
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.5",
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": "^8.57.0",
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",