@abaplint/cli 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.
Files changed (2) hide show
  1. package/build/cli.js +43 -19
  2. package/package.json +4 -4
package/build/cli.js CHANGED
@@ -20102,7 +20102,6 @@ var Visibility;
20102
20102
 
20103
20103
  Object.defineProperty(exports, "__esModule", ({ value: true }));
20104
20104
  exports.BuiltIn = exports.BuiltInMethod = void 0;
20105
- /* eslint-disable max-len */
20106
20105
  const _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
20107
20106
  const basic_1 = __webpack_require__(/*! ../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
20108
20107
  const tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
@@ -22951,7 +22950,6 @@ exports.AssertError = AssertError;
22951
22950
 
22952
22951
  Object.defineProperty(exports, "__esModule", ({ value: true }));
22953
22952
  exports.BasicTypes = void 0;
22954
- /* eslint-disable default-case */
22955
22953
  const _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
22956
22954
  const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
22957
22955
  const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
@@ -35022,6 +35020,9 @@ class FlowGraph {
35022
35020
  getStart() {
35023
35021
  return this.startNode;
35024
35022
  }
35023
+ getLabel() {
35024
+ return this.label;
35025
+ }
35025
35026
  getEnd() {
35026
35027
  return this.endNode;
35027
35028
  }
@@ -35178,22 +35179,26 @@ class StatementFlow {
35178
35179
  this.counter = 0;
35179
35180
  }
35180
35181
  build(stru) {
35181
- var _a, _b;
35182
+ var _a, _b, _c;
35182
35183
  const ret = [];
35183
- const forms = stru.findAllStructures(Structures.Form);
35184
- for (const f of forms) {
35185
- const formName = "FORM " + ((_a = f.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
35186
- this.counter = 1;
35187
- const graph = this.traverseBody(this.findBody(f), { procedureEnd: "end#1" });
35188
- graph.setLabel(formName);
35189
- ret.push(graph);
35190
- }
35191
- const methods = stru.findAllStructures(Structures.Method);
35192
- for (const f of methods) {
35193
- const methodName = "METHOD " + ((_b = f.findFirstExpression(Expressions.MethodName)) === null || _b === void 0 ? void 0 : _b.concatTokens());
35184
+ const structures = stru.findAllStructuresMulti([Structures.Form, Structures.Method, Structures.FunctionModule]);
35185
+ for (const s of structures) {
35186
+ let name = "";
35187
+ if (s.get() instanceof Structures.Form) {
35188
+ name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
35189
+ }
35190
+ else if (s.get() instanceof Structures.Method) {
35191
+ name = "METHOD " + ((_b = s.findFirstExpression(Expressions.MethodName)) === null || _b === void 0 ? void 0 : _b.concatTokens());
35192
+ }
35193
+ else if (s.get() instanceof Structures.FunctionModule) {
35194
+ name = "FUNCTION " + ((_c = s.findFirstExpression(Expressions.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens());
35195
+ }
35196
+ else {
35197
+ throw new Error("StatementFlow, unknown structure");
35198
+ }
35194
35199
  this.counter = 1;
35195
- const graph = this.traverseBody(this.findBody(f), { procedureEnd: "end#1" });
35196
- graph.setLabel(methodName);
35200
+ const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
35201
+ graph.setLabel(name);
35197
35202
  ret.push(graph);
35198
35203
  }
35199
35204
  return ret.map(f => f.reduce());
@@ -35320,6 +35325,7 @@ class StatementFlow {
35320
35325
  || type instanceof Structures.With
35321
35326
  || type instanceof Structures.Provide
35322
35327
  || type instanceof Structures.Select
35328
+ || type instanceof Structures.LoopAtScreen
35323
35329
  || type instanceof Structures.Do) {
35324
35330
  const loopName = this.buildName(n.getFirstStatement());
35325
35331
  const sub = this.traverseBody(this.findBody(n), Object.assign(Object.assign({}, context), { loopStart: loopName, loopEnd: graph.getEnd() }));
@@ -35328,6 +35334,25 @@ class StatementFlow {
35328
35334
  graph.addEdge(sub.getEnd(), loopName);
35329
35335
  graph.addEdge(loopName, graph.getEnd());
35330
35336
  }
35337
+ else if (type instanceof Structures.Data
35338
+ || type instanceof Structures.Types) {
35339
+ // these doesnt affect control flow, so just take the first statement
35340
+ const statement = n.getFirstStatement();
35341
+ const name = this.buildName(statement);
35342
+ graph.addEdge(current, name);
35343
+ graph.addEdge(name, graph.getEnd());
35344
+ }
35345
+ else if (type instanceof Structures.AtFirst
35346
+ || type instanceof Structures.AtLast
35347
+ || type instanceof Structures.At
35348
+ || type instanceof Structures.OnChange) {
35349
+ const name = this.buildName(n.getFirstStatement());
35350
+ const body = this.traverseBody(this.findBody(n), context);
35351
+ graph.addEdge(current, name);
35352
+ graph.addGraph(name, body);
35353
+ graph.addEdge(body.getEnd(), graph.getEnd());
35354
+ graph.addEdge(current, graph.getEnd());
35355
+ }
35331
35356
  else if (type instanceof Structures.Try) {
35332
35357
  const tryName = this.buildName(n.getFirstStatement());
35333
35358
  const body = this.traverseBody(this.findBody(n), context);
@@ -36624,7 +36649,7 @@ class CharacterType extends _abstract_type_1.AbstractType {
36624
36649
  this.length = length;
36625
36650
  }
36626
36651
  cloneType(input) {
36627
- const clone = Object.assign({}, this.getAbstractTypeData()) || {};
36652
+ const clone = Object.assign({}, this.getAbstractTypeData());
36628
36653
  if (input.qualifiedName) {
36629
36654
  clone.qualifiedName = input.qualifiedName;
36630
36655
  }
@@ -52488,7 +52513,7 @@ class Registry {
52488
52513
  }
52489
52514
  static abaplintVersion() {
52490
52515
  // magic, see build script "version.sh"
52491
- return "2.112.15";
52516
+ return "2.112.17";
52492
52517
  }
52493
52518
  getDDICReferences() {
52494
52519
  return this.ddicReferences;
@@ -54536,7 +54561,6 @@ class CDSLegacyView {
54536
54561
  key: "cds_legacy_view",
54537
54562
  title: "CDS Legacy View",
54538
54563
  shortDescription: `Identify CDS Legacy Views`,
54539
- // eslint-disable-next-line max-len
54540
54564
  extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54541
54565
 
54542
54566
  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/cli",
3
- "version": "2.112.15",
3
+ "version": "2.112.17",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
7
7
  "abaplint": "abaplint"
8
8
  },
9
9
  "scripts": {
10
- "lint": "eslint src/**/*.ts test/**/*.ts --format unix",
10
+ "lint": "eslint src/**/*.ts test/**/*.ts",
11
11
  "compile": "tsc",
12
12
  "test": "npm run compile && mocha && npm run lint && npm run webpack",
13
13
  "webpack": "webpack --progress",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.112.15",
41
+ "@abaplint/core": "^2.112.17",
42
42
  "@types/chai": "^4.3.17",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",
@@ -47,7 +47,7 @@
47
47
  "@types/progress": "^2.0.7",
48
48
  "chai": "^4.5.0",
49
49
  "chalk": "^5.3.0",
50
- "eslint": "^8.57.0",
50
+ "eslint": "^9.9.0",
51
51
  "glob": "^7.2.3",
52
52
  "json5": "^2.2.3",
53
53
  "memfs": "=4.9.3",