@abaplint/cli 2.101.4 → 2.101.6

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 +28 -6
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -25923,7 +25923,6 @@ const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/c
25923
25923
  const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
25924
25924
  class StringTemplate {
25925
25925
  runSyntax(node, scope, filename) {
25926
- var _a;
25927
25926
  const typeUtils = new _type_utils_1.TypeUtils(scope);
25928
25927
  for (const templateSource of node.findAllExpressions(Expressions.StringTemplateSource)) {
25929
25928
  const s = templateSource.findDirectExpression(Expressions.Source);
@@ -25934,9 +25933,22 @@ class StringTemplate {
25934
25933
  else if (typeUtils.isCharLike(type) === false && typeUtils.isHexLike(type) === false) {
25935
25934
  throw new Error("Not character like, " + type.constructor.name);
25936
25935
  }
25937
- for (const formatSource of ((_a = templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Source)) || []) {
25936
+ const format = templateSource.findDirectExpression(Expressions.StringTemplateFormatting);
25937
+ const formatConcat = format === null || format === void 0 ? void 0 : format.concatTokens();
25938
+ for (const formatSource of (format === null || format === void 0 ? void 0 : format.findAllExpressions(Expressions.Source)) || []) {
25938
25939
  new source_1.Source().runSyntax(formatSource, scope, filename);
25939
25940
  }
25941
+ if ((formatConcat === null || formatConcat === void 0 ? void 0 : formatConcat.includes("ALPHA = "))
25942
+ && !(type instanceof basic_1.UnknownType)
25943
+ && !(type instanceof basic_1.VoidType)
25944
+ && !(type instanceof basic_1.StringType)
25945
+ && !(type instanceof basic_1.CLikeType)
25946
+ && !(type instanceof basic_1.CharacterType)
25947
+ && !(type instanceof basic_1.NumericGenericType)
25948
+ && !(type instanceof basic_1.NumericType)
25949
+ && !(type instanceof basic_1.AnyType)) {
25950
+ throw new Error("Cannot apply ALPHA to this type");
25951
+ }
25940
25952
  }
25941
25953
  return new basic_1.StringType({ qualifiedName: "STRING" });
25942
25954
  }
@@ -29834,6 +29846,9 @@ class Raise {
29834
29846
  else {
29835
29847
  throw new Error("RAISE, unknown class " + className);
29836
29848
  }
29849
+ if (method === undefined) {
29850
+ method = new basic_1.VoidType(className);
29851
+ }
29837
29852
  }
29838
29853
  const c = node.findExpressionAfterToken("EXCEPTION");
29839
29854
  if (c instanceof nodes_1.ExpressionNode && (c.get() instanceof Expressions.SimpleSource2 || c.get() instanceof Expressions.Source)) {
@@ -29849,6 +29864,9 @@ class Raise {
29849
29864
  throw new Error("RAISE EXCEPTION, must be object reference, got " + type.constructor.name);
29850
29865
  }
29851
29866
  }
29867
+ if (method === undefined) {
29868
+ method = new basic_1.VoidType("Exception");
29869
+ }
29852
29870
  // check parameters vs constructor
29853
29871
  const param = node.findDirectExpression(Expressions.ParameterListS);
29854
29872
  if (param) {
@@ -48014,7 +48032,7 @@ class Registry {
48014
48032
  }
48015
48033
  static abaplintVersion() {
48016
48034
  // magic, see build script "version.sh"
48017
- return "2.101.4";
48035
+ return "2.101.6";
48018
48036
  }
48019
48037
  getDDICReferences() {
48020
48038
  return this.ddicReferences;
@@ -60447,14 +60465,18 @@ class ModifyOnlyOwnDBTables {
60447
60465
  }
60448
60466
  const concat = databaseTable.concatTokens().toUpperCase();
60449
60467
  if (regExp.test(concat) === false) {
60450
- // must contain a ReferenceType.TableVoidReference
60468
+ // must contain a ReferenceType.TableVoidReference or a ReferenceType.TableReference if its a dependency
60451
60469
  if (spaghetti === undefined) {
60452
60470
  spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;
60453
60471
  }
60454
60472
  const start = databaseTable.getFirstToken().getStart();
60455
60473
  const scope = spaghetti.lookupPosition(start, file.getFilename());
60456
- const found = scope === null || scope === void 0 ? void 0 : scope.findTableVoidReference(start);
60457
- if (found) {
60474
+ const found1 = scope === null || scope === void 0 ? void 0 : scope.findTableVoidReference(start);
60475
+ if (found1) {
60476
+ output.push(issue_1.Issue.atStatement(file, s, this.getMetadata().title, this.getMetadata().key, this.getConfig().severity));
60477
+ }
60478
+ const found2 = scope === null || scope === void 0 ? void 0 : scope.findTableReference(start);
60479
+ if (found2) {
60458
60480
  output.push(issue_1.Issue.atStatement(file, s, this.getMetadata().title, this.getMetadata().key, this.getConfig().severity));
60459
60481
  }
60460
60482
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.101.4",
3
+ "version": "2.101.6",
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.101.4",
41
+ "@abaplint/core": "^2.101.6",
42
42
  "@types/chai": "^4.3.5",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.2",