@abaplint/cli 2.113.240 → 2.113.242

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 +21 -18
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -29298,8 +29298,9 @@ class Target {
29298
29298
  currentIndex++;
29299
29299
  if (current.get() instanceof tokens_1.Dash) {
29300
29300
  if (context instanceof unknown_type_1.UnknownType) {
29301
- const message = "Not a structure, type unknown, target";
29302
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
29301
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
29302
+ }
29303
+ else if (context instanceof basic_1.TableType && context.isWithHeader() && context.getRowType() instanceof unknown_type_1.UnknownType) {
29303
29304
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
29304
29305
  }
29305
29306
  else if (!(context instanceof basic_1.StructureType)
@@ -32619,27 +32620,27 @@ const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/
32619
32620
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
32620
32621
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
32621
32622
  const assert_error_1 = __webpack_require__(/*! ../assert_error */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/assert_error.js");
32623
+ const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
32622
32624
  class IncludeType {
32623
32625
  runSyntax(node, input) {
32624
- var _a, _b, _c, _d, _e;
32626
+ var _a, _b;
32625
32627
  const components = [];
32626
32628
  const iname = node.findFirstExpression(Expressions.TypeName);
32627
32629
  if (iname === undefined) {
32628
32630
  throw new assert_error_1.AssertError("IncludeType, unexpected node structure");
32629
32631
  }
32630
- const name = iname.getFirstToken().getStr();
32632
+ const firstToken = iname.getFirstToken();
32633
+ const name = firstToken.getStr();
32631
32634
  const isStructure = node.findDirectTokenByText("STRUCTURE") !== undefined;
32632
32635
  let ityp = new basic_types_1.BasicTypes(input).parseType(iname);
32633
- if (ityp instanceof basic_1.VoidType && isStructure) {
32634
- const found = (_a = input.scope.findVariable(name)) === null || _a === void 0 ? void 0 : _a.getType();
32636
+ if ((ityp instanceof basic_1.VoidType && isStructure) || ityp instanceof basic_1.UnknownType) {
32637
+ const found = input.scope.findVariable(name);
32635
32638
  if (found) {
32636
- ityp = found;
32639
+ input.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, input.filename);
32640
+ ityp = found.getType();
32637
32641
  }
32638
32642
  }
32639
- else if (ityp instanceof basic_1.UnknownType) {
32640
- ityp = (_c = (_b = input.scope.findVariable(name)) === null || _b === void 0 ? void 0 : _b.getType()) !== null && _c !== void 0 ? _c : ityp;
32641
- }
32642
- const as = (_d = node.findExpressionAfterToken("AS")) === null || _d === void 0 ? void 0 : _d.concatTokens();
32643
+ const as = (_a = node.findExpressionAfterToken("AS")) === null || _a === void 0 ? void 0 : _a.concatTokens();
32643
32644
  if (as && ityp instanceof basic_1.StructureType) {
32644
32645
  ityp = new basic_1.StructureType(ityp.getComponents().concat([{
32645
32646
  name: as,
@@ -32661,7 +32662,7 @@ class IncludeType {
32661
32662
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, iname.getFirstToken(), message));
32662
32663
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
32663
32664
  }
32664
- const suffix = (_e = node.findExpressionAfterToken("SUFFIX")) === null || _e === void 0 ? void 0 : _e.concatTokens();
32665
+ const suffix = (_b = node.findExpressionAfterToken("SUFFIX")) === null || _b === void 0 ? void 0 : _b.concatTokens();
32665
32666
  if (suffix && ityp instanceof basic_1.StructureType) {
32666
32667
  const components = [];
32667
32668
  for (const c of ityp.getComponents()) {
@@ -54883,7 +54884,7 @@ class Registry {
54883
54884
  }
54884
54885
  static abaplintVersion() {
54885
54886
  // magic, see build script "version.sh"
54886
- return "2.113.240";
54887
+ return "2.113.242";
54887
54888
  }
54888
54889
  getDDICReferences() {
54889
54890
  return this.ddicReferences;
@@ -57794,6 +57795,7 @@ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./nod
57794
57795
  const include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ "./node_modules/@abaplint/core/build/src/utils/include_graph.js");
57795
57796
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
57796
57797
  const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
57798
+ const severity_1 = __webpack_require__(/*! ../severity */ "./node_modules/@abaplint/core/build/src/severity.js");
57797
57799
  class CheckIncludeConf extends _basic_rule_config_1.BasicRuleConfig {
57798
57800
  }
57799
57801
  exports.CheckIncludeConf = CheckIncludeConf;
@@ -57822,7 +57824,7 @@ class CheckInclude {
57822
57824
  }
57823
57825
  initialize(reg) {
57824
57826
  this.reg = reg;
57825
- this.graph = new include_graph_1.IncludeGraph(this.reg);
57827
+ this.graph = new include_graph_1.IncludeGraph(this.reg, this.getConfig().severity || severity_1.Severity.Error);
57826
57828
  return this;
57827
57829
  }
57828
57830
  run(obj) {
@@ -78520,10 +78522,11 @@ class Graph {
78520
78522
  }
78521
78523
  }
78522
78524
  class IncludeGraph {
78523
- constructor(reg) {
78525
+ constructor(reg, severity = severity_1.Severity.Error) {
78524
78526
  this.reg = reg;
78525
78527
  this.issues = [];
78526
78528
  this.graph = new Graph();
78529
+ this.severity = severity;
78527
78530
  this.build();
78528
78531
  }
78529
78532
  listMainForInclude(filename) {
@@ -78553,7 +78556,7 @@ class IncludeGraph {
78553
78556
  if (f === undefined) {
78554
78557
  throw new Error("findUnusedIncludes internal error");
78555
78558
  }
78556
- const issue = issue_1.Issue.atPosition(f, new position_1.Position(1, 1), "INCLUDE not used anywhere", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);
78559
+ const issue = issue_1.Issue.atPosition(f, new position_1.Position(1, 1), "INCLUDE not used anywhere", new check_include_1.CheckInclude().getMetadata().key, this.severity);
78557
78560
  ret.push(issue);
78558
78561
  }
78559
78562
  return ret;
@@ -78581,12 +78584,12 @@ class IncludeGraph {
78581
78584
  if (found === undefined) {
78582
78585
  const ifFound = s.concatTokens().toUpperCase().includes("IF FOUND");
78583
78586
  if (ifFound === false) {
78584
- const issue = issue_1.Issue.atStatement(f, s, "Include " + name + " not found", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);
78587
+ const issue = issue_1.Issue.atStatement(f, s, "Include " + name + " not found", new check_include_1.CheckInclude().getMetadata().key, this.severity);
78585
78588
  this.issues.push(issue);
78586
78589
  }
78587
78590
  }
78588
78591
  else if (found.include === false) {
78589
- const issue = issue_1.Issue.atStatement(f, s, "Not possible to INCLUDE a main program, " + name, new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);
78592
+ const issue = issue_1.Issue.atStatement(f, s, "Not possible to INCLUDE a main program, " + name, new check_include_1.CheckInclude().getMetadata().key, this.severity);
78590
78593
  this.issues.push(issue);
78591
78594
  }
78592
78595
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.240",
3
+ "version": "2.113.242",
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.240",
41
+ "@abaplint/core": "^2.113.242",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",