@abaplint/cli 2.113.137 → 2.113.139

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 +33 -31
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -49079,12 +49079,14 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
49079
49079
  }
49080
49080
  if ((i.startsWith("L") || namespaced) && f.getFilename().includes(search.toLowerCase() + ".")) {
49081
49081
  ret.push({ file: f, name: i });
49082
+ break;
49082
49083
  }
49083
49084
  // fix for URL encoded? Uris
49084
49085
  if (namespaced) {
49085
49086
  search = i.replace(/\//g, "%23");
49086
49087
  if (f.getFilename().includes(search.toLowerCase() + ".")) {
49087
49088
  ret.push({ file: f, name: i });
49089
+ break;
49088
49090
  }
49089
49091
  }
49090
49092
  }
@@ -54573,7 +54575,7 @@ class Registry {
54573
54575
  }
54574
54576
  static abaplintVersion() {
54575
54577
  // magic, see build script "version.sh"
54576
- return "2.113.137";
54578
+ return "2.113.139";
54577
54579
  }
54578
54580
  getDDICReferences() {
54579
54581
  return this.ddicReferences;
@@ -77836,6 +77838,7 @@ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./nod
77836
77838
  const severity_1 = __webpack_require__(/*! ../severity */ "./node_modules/@abaplint/core/build/src/severity.js");
77837
77839
  // todo, check for cycles/circular dependencies, method findTop
77838
77840
  // todo, add configurable error for multiple use includes
77841
+ const FMXXINCLUDE = /^(\/\w+\/)?L.+XX$/;
77839
77842
  function getABAPObjects(reg) {
77840
77843
  const ret = [];
77841
77844
  for (const o of reg.getObjects()) {
@@ -77847,40 +77850,35 @@ function getABAPObjects(reg) {
77847
77850
  }
77848
77851
  class Graph {
77849
77852
  constructor() {
77850
- this.vertices = [];
77851
- this.edges = [];
77853
+ this.verticesIncludenameIndex = {};
77854
+ this.verticesFilenameIndex = {};
77855
+ this.edges = {};
77852
77856
  }
77853
77857
  addVertex(vertex) {
77854
- this.vertices.push(vertex);
77855
- }
77856
- findInclude(includeName) {
77857
- for (const v of this.vertices) {
77858
- if (v.includeName.toUpperCase() === includeName.toUpperCase()) {
77859
- return v;
77860
- }
77858
+ if (vertex.includeName !== undefined) {
77859
+ this.verticesIncludenameIndex[vertex.includeName.toUpperCase()] = vertex;
77861
77860
  }
77862
- return undefined;
77861
+ this.verticesFilenameIndex[vertex.filename.toUpperCase()] = vertex;
77863
77862
  }
77864
- findVertex(filename) {
77865
- for (const v of this.vertices) {
77866
- if (v.filename.toUpperCase() === filename.toUpperCase()) {
77867
- return v;
77868
- }
77869
- }
77870
- return undefined;
77863
+ findVertexViaIncludename(includeName) {
77864
+ return this.verticesIncludenameIndex[includeName.toUpperCase()];
77865
+ }
77866
+ findVertexByFilename(filename) {
77867
+ return this.verticesFilenameIndex[filename.toUpperCase()];
77871
77868
  }
77872
77869
  addEdge(from, toFilename) {
77873
- this.edges.push({ from: from.filename, to: toFilename });
77870
+ if (this.edges[from.filename] === undefined) {
77871
+ this.edges[from.filename] = [];
77872
+ }
77873
+ this.edges[from.filename].push(toFilename);
77874
77874
  }
77875
77875
  findTop(filename) {
77876
77876
  const ret = [];
77877
- for (const e of this.edges) {
77878
- if (e.from === filename) {
77879
- ret.push(...this.findTop(e.to));
77880
- }
77877
+ for (const to of this.edges[filename] || []) {
77878
+ ret.push(...this.findTop(to));
77881
77879
  }
77882
77880
  if (ret.length === 0) {
77883
- const found = this.findVertex(filename);
77881
+ const found = this.findVertexByFilename(filename);
77884
77882
  if (found !== undefined) {
77885
77883
  ret.push(found);
77886
77884
  }
@@ -77924,19 +77922,23 @@ class IncludeGraph {
77924
77922
  this.addVertices();
77925
77923
  for (const o of getABAPObjects(this.reg)) {
77926
77924
  for (const f of o.getABAPFiles()) {
77925
+ if (f.getFilename().includes(".prog.screen_") || f.getFilename().includes(".fugr.screen_")) {
77926
+ // skip dynpro files
77927
+ continue;
77928
+ }
77927
77929
  for (const s of f.getStatements()) {
77928
77930
  if (s.get() instanceof statements_1.Include) {
77929
- const ifFound = s.concatTokens().toUpperCase().includes("IF FOUND");
77930
77931
  const iexp = s.findFirstExpression(expressions_1.IncludeName);
77931
77932
  if (iexp === undefined) {
77932
77933
  throw new Error("unexpected Include node");
77933
77934
  }
77934
77935
  const name = iexp.getFirstToken().getStr().toUpperCase();
77935
- if (name.match(/^(\/\w+\/)?L.+XX$/)) { // function module XX includes, possibily namespaced
77936
+ if (name.match(FMXXINCLUDE)) { // function module XX includes, possibily namespaced
77936
77937
  continue;
77937
77938
  }
77938
- const found = this.graph.findInclude(name);
77939
+ const found = this.graph.findVertexViaIncludename(name);
77939
77940
  if (found === undefined) {
77941
+ const ifFound = s.concatTokens().toUpperCase().includes("IF FOUND");
77940
77942
  if (ifFound === false) {
77941
77943
  const issue = issue_1.Issue.atStatement(f, s, "Include " + name + " not found", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);
77942
77944
  this.issues.push(issue);
@@ -77956,7 +77958,7 @@ class IncludeGraph {
77956
77958
  this.findUnusedIncludes();
77957
77959
  }
77958
77960
  findUnusedIncludes() {
77959
- for (const v of this.graph.vertices) {
77961
+ for (const v of Object.values(this.graph.verticesFilenameIndex)) {
77960
77962
  if (v.include === true) {
77961
77963
  if (this.listMainForInclude(v.filename).length === 0) {
77962
77964
  const f = this.reg.getFileByName(v.filename);
@@ -77986,7 +77988,7 @@ class IncludeGraph {
77986
77988
  if (file) {
77987
77989
  this.graph.addVertex({
77988
77990
  filename: file.getFilename(),
77989
- includeName: o.getName(),
77991
+ includeName: undefined,
77990
77992
  include: false
77991
77993
  });
77992
77994
  }
@@ -77995,7 +77997,7 @@ class IncludeGraph {
77995
77997
  for (const f of o.getSequencedFiles()) {
77996
77998
  this.graph.addVertex({
77997
77999
  filename: f.getFilename(),
77998
- includeName: o.getName(),
78000
+ includeName: undefined,
77999
78001
  include: false
78000
78002
  });
78001
78003
  }
@@ -78012,7 +78014,7 @@ class IncludeGraph {
78012
78014
  if (file) {
78013
78015
  this.graph.addVertex({
78014
78016
  filename: file.getFilename(),
78015
- includeName: o.getName(),
78017
+ includeName: undefined, // this is the SAPL program
78016
78018
  include: false
78017
78019
  });
78018
78020
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.137",
3
+ "version": "2.113.139",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.113.137",
41
+ "@abaplint/core": "^2.113.139",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",