@abaplint/cli 2.120.47 → 2.120.48

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 +19 -3
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -27471,6 +27471,13 @@ class TypeUtils {
27471
27471
  || type instanceof basic_1.UnknownType
27472
27472
  || type instanceof basic_1.VoidType;
27473
27473
  }
27474
+ isCharLikeForCompare(type) {
27475
+ return type === undefined
27476
+ || type instanceof basic_1.StringType
27477
+ || type instanceof basic_1.CLikeType
27478
+ || type instanceof basic_1.CSequenceType
27479
+ || this.isCharLikeField(type);
27480
+ }
27474
27481
  isCharLike(type) {
27475
27482
  if (type === undefined) {
27476
27483
  return false;
@@ -29812,6 +29819,7 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/
29812
29819
  const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "../core/build/src/abap/5_syntax/_type_utils.js");
29813
29820
  class Compare {
29814
29821
  static runSyntax(node, input) {
29822
+ var _a;
29815
29823
  const sourceTypes = [];
29816
29824
  const sources = node.findDirectExpressions(Expressions.Source);
29817
29825
  for (const t of sources) {
@@ -29823,8 +29831,16 @@ class Compare {
29823
29831
  for (const t of node.findDirectExpressions(Expressions.MethodCallChain)) {
29824
29832
  method_call_chain_1.MethodCallChain.runSyntax(t, input);
29825
29833
  }
29826
- if (node.findDirectExpression(Expressions.CompareOperator)
29827
- && new _type_utils_1.TypeUtils(input.scope).isCompareable(sourceTypes[0], sourceTypes[1], sources[0], sources[1]) === false
29834
+ const typeUtils = new _type_utils_1.TypeUtils(input.scope);
29835
+ const compareOperator = (_a = node.findDirectExpression(Expressions.CompareOperator)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
29836
+ if (compareOperator === "CS"
29837
+ && sourceTypes.length === 2
29838
+ && sourceTypes.some((type) => typeUtils.isCharLikeForCompare(type) === false)) {
29839
+ const message = "CS operands must be character-like (data type C, N, D, T, or STRING)";
29840
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
29841
+ }
29842
+ else if (node.findDirectExpression(Expressions.CompareOperator)
29843
+ && typeUtils.isCompareable(sourceTypes[0], sourceTypes[1], sources[0], sources[1]) === false
29828
29844
  && sourceTypes.length === 2) {
29829
29845
  let message = "Incompatible types for comparison";
29830
29846
  if ((sourceTypes[0] instanceof basic_1.DateType
@@ -70392,7 +70408,7 @@ class Registry {
70392
70408
  }
70393
70409
  static abaplintVersion() {
70394
70410
  // magic, see build script "version.js"
70395
- return "2.120.47";
70411
+ return "2.120.48";
70396
70412
  }
70397
70413
  getDDICReferences() {
70398
70414
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.47",
3
+ "version": "2.120.48",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.120.47",
42
+ "@abaplint/core": "^2.120.48",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",