@abaplint/cli 2.106.6 → 2.106.8

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 +54 -3
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -8890,9 +8890,8 @@ class Target extends combi_1.Expression {
8890
8890
  const attr = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.InstanceArrow), attribute_name_1.AttributeName);
8891
8891
  const comp = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), _1.ComponentName);
8892
8892
  const something = (0, combi_1.starPrio)((0, combi_1.altPrio)(dereference_1.Dereference, attr, comp, _1.TableExpression));
8893
- const cast = (0, combi_1.seq)((0, combi_1.altPrio)(_1.Cast, _1.NewObject), _1.Arrow, _1.FieldAll);
8894
8893
  const clas = (0, combi_1.seq)(_1.ClassName, (0, combi_1.tok)(tokens_1.StaticArrow), attribute_name_1.AttributeName);
8895
- const start = (0, combi_1.altPrio)(cast, clas, _1.TargetField, _1.TargetFieldSymbol);
8894
+ const start = (0, combi_1.altPrio)(_1.Cast, _1.NewObject, clas, _1.TargetField, _1.TargetFieldSymbol);
8896
8895
  const fields = (0, combi_1.seq)((0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength));
8897
8896
  const optional = (0, combi_1.altPrio)(_1.TableBody, fields);
8898
8897
  return (0, combi_1.altPrio)(_1.InlineData, _1.InlineFS, (0, combi_1.seq)(start, something, optional));
@@ -27458,6 +27457,7 @@ const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@a
27458
27457
  const table_expression_1 = __webpack_require__(/*! ./table_expression */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/table_expression.js");
27459
27458
  const expressions_1 = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
27460
27459
  const field_length_1 = __webpack_require__(/*! ./field_length */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_length.js");
27460
+ const cast_1 = __webpack_require__(/*! ./cast */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/cast.js");
27461
27461
  class Target {
27462
27462
  runSyntax(node, scope, filename) {
27463
27463
  const concat = node.concatTokens();
@@ -27589,6 +27589,13 @@ class Target {
27589
27589
  return new unknown_type_1.UnknownType(name + " unknown, Target");
27590
27590
  }
27591
27591
  }
27592
+ else if (node.get() instanceof Expressions.Cast && node instanceof nodes_1.ExpressionNode) {
27593
+ const ret = new cast_1.Cast().runSyntax(node, scope, undefined, filename);
27594
+ if (ret instanceof unknown_type_1.UnknownType) {
27595
+ throw new Error("CAST, uknown type");
27596
+ }
27597
+ return ret;
27598
+ }
27592
27599
  return new unknown_type_1.UnknownType("unknown target type");
27593
27600
  }
27594
27601
  }
@@ -51444,7 +51451,7 @@ class Registry {
51444
51451
  }
51445
51452
  static abaplintVersion() {
51446
51453
  // magic, see build script "version.sh"
51447
- return "2.106.6";
51454
+ return "2.106.8";
51448
51455
  }
51449
51456
  getDDICReferences() {
51450
51457
  return this.ddicReferences;
@@ -71709,6 +71716,7 @@ Skips:
71709
71716
  `,
71710
71717
  tags: [],
71711
71718
  pragma: "##CALLED",
71719
+ pseudoComment: "EC CALLED",
71712
71720
  };
71713
71721
  }
71714
71722
  getConfig() {
@@ -71785,11 +71793,32 @@ Skips:
71785
71793
  if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {
71786
71794
  continue;
71787
71795
  }
71796
+ else if (this.suppressedbyPseudo(statement, file)) {
71797
+ continue;
71798
+ }
71788
71799
  const message = "Method \"" + i.identifier.getName() + "\" not used";
71789
71800
  issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity));
71790
71801
  }
71791
71802
  return issues;
71792
71803
  }
71804
+ suppressedbyPseudo(statement, file) {
71805
+ if (statement === undefined) {
71806
+ return false;
71807
+ }
71808
+ if (file === undefined) {
71809
+ return false;
71810
+ }
71811
+ let next = false;
71812
+ for (const s of file.getStatements()) {
71813
+ if (next === true && s.get() instanceof _statement_1.Comment) {
71814
+ return s.concatTokens().includes(this.getMetadata().pseudoComment + "");
71815
+ }
71816
+ if (s === statement) {
71817
+ next = true;
71818
+ }
71819
+ }
71820
+ return false;
71821
+ }
71793
71822
  searchGlobalSubclasses(obj) {
71794
71823
  var _a, _b;
71795
71824
  if (this.wa.getLength() === 0
@@ -71900,6 +71929,7 @@ class UnusedTypes {
71900
71929
  extendedInformation: `Unused types are not reported if the object contains parser or syntax errors.`,
71901
71930
  tags: [_irule_1.RuleTag.Quickfix],
71902
71931
  pragma: "##NEEDED",
71932
+ pseudoComment: "EC NEEDED",
71903
71933
  };
71904
71934
  }
71905
71935
  getConfig() {
@@ -71967,11 +71997,32 @@ class UnusedTypes {
71967
71997
  if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {
71968
71998
  continue;
71969
71999
  }
72000
+ else if (this.suppressedbyPseudo(statement, file)) {
72001
+ continue;
72002
+ }
71970
72003
  const fix = this.buildFix(file, statement);
71971
72004
  ret.push(issue_1.Issue.atIdentifier(t, message, this.getMetadata().key, this.conf.severity, fix));
71972
72005
  }
71973
72006
  return ret;
71974
72007
  }
72008
+ suppressedbyPseudo(statement, file) {
72009
+ if (statement === undefined) {
72010
+ return false;
72011
+ }
72012
+ if (file === undefined) {
72013
+ return false;
72014
+ }
72015
+ let next = false;
72016
+ for (const s of file.getStatements()) {
72017
+ if (next === true && s.get() instanceof _statement_1.Comment) {
72018
+ return s.concatTokens().includes(this.getMetadata().pseudoComment + "");
72019
+ }
72020
+ if (s === statement) {
72021
+ next = true;
72022
+ }
72023
+ }
72024
+ return false;
72025
+ }
71975
72026
  ////////////////////////////
71976
72027
  traverse(node, obj, add) {
71977
72028
  if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.106.6",
3
+ "version": "2.106.8",
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.106.6",
41
+ "@abaplint/core": "^2.106.8",
42
42
  "@types/chai": "^4.3.14",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",