@abaplint/cli 2.105.23 → 2.105.25

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 +34 -9
  2. package/package.json +3 -3
package/build/cli.js CHANGED
@@ -22577,7 +22577,8 @@ class TypeUtils {
22577
22577
  }
22578
22578
  return false;
22579
22579
  }
22580
- else if (target instanceof cgeneric_type_1.CGenericType) {
22580
+ else if (target instanceof cgeneric_type_1.CGenericType
22581
+ || target instanceof basic_1.GenericObjectReferenceType) {
22581
22582
  return false;
22582
22583
  }
22583
22584
  else if (target instanceof basic_1.XSequenceType || target instanceof basic_1.XStringType) {
@@ -22767,8 +22768,14 @@ class TypeUtils {
22767
22768
  if (source instanceof basic_1.TableType && source.isWithHeader() === false) {
22768
22769
  return false;
22769
22770
  }
22771
+ else if (target instanceof basic_1.StringType
22772
+ && source instanceof basic_1.StructureType
22773
+ && this.isCharLike(source)) {
22774
+ return true;
22775
+ }
22770
22776
  else if (source instanceof basic_1.DataReference
22771
22777
  || source instanceof basic_1.ObjectReferenceType
22778
+ || source instanceof basic_1.StructureType
22772
22779
  || source instanceof basic_1.GenericObjectReferenceType) {
22773
22780
  return false;
22774
22781
  }
@@ -24347,19 +24354,22 @@ const let_1 = __webpack_require__(/*! ./let */ "./node_modules/@abaplint/core/bu
24347
24354
  class ConvBody {
24348
24355
  runSyntax(node, scope, filename) {
24349
24356
  if (node === undefined) {
24350
- return;
24357
+ throw new Error("ConvBody, node undefined");
24351
24358
  }
24352
24359
  let scoped = false;
24353
24360
  const l = node.findDirectExpression(Expressions.Let);
24354
24361
  if (l) {
24355
24362
  scoped = new let_1.Let().runSyntax(l, scope, filename);
24356
24363
  }
24357
- for (const s of node.findDirectExpressions(Expressions.Source)) {
24358
- new source_1.Source().runSyntax(s, scope, filename);
24364
+ const s = node.findDirectExpression(Expressions.Source);
24365
+ if (s === undefined) {
24366
+ throw new Error("ConvBody, no source found");
24359
24367
  }
24368
+ const sourceType = new source_1.Source().runSyntax(s, scope, filename);
24360
24369
  if (scoped === true) {
24361
24370
  scope.pop(node.getLastToken().getEnd());
24362
24371
  }
24372
+ return sourceType;
24363
24373
  }
24364
24374
  }
24365
24375
  exports.ConvBody = ConvBody;
@@ -26705,6 +26715,7 @@ const _builtin_1 = __webpack_require__(/*! ../_builtin */ "./node_modules/@abapl
26705
26715
  const attribute_chain_1 = __webpack_require__(/*! ./attribute_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/attribute_chain.js");
26706
26716
  const dereference_1 = __webpack_require__(/*! ./dereference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dereference.js");
26707
26717
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
26718
+ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
26708
26719
  /*
26709
26720
  * Type interference, valid scenarios:
26710
26721
  * typed = VALUE #( ... ). right hand side must follow left hand type
@@ -26788,7 +26799,10 @@ class Source {
26788
26799
  case "CONV":
26789
26800
  {
26790
26801
  const foundType = this.determineType(node, scope, filename, targetType);
26791
- new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), scope, filename);
26802
+ const bodyType = new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), scope, filename);
26803
+ if (new _type_utils_1.TypeUtils(scope).isAssignable(foundType, bodyType) === false) {
26804
+ throw new Error("CONV: Types not compatible");
26805
+ }
26792
26806
  this.addIfInferred(node, scope, filename, foundType);
26793
26807
  return foundType;
26794
26808
  }
@@ -28234,6 +28248,7 @@ const target_1 = __webpack_require__(/*! ../expressions/target */ "./node_module
28234
28248
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
28235
28249
  const fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js");
28236
28250
  const inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js");
28251
+ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
28237
28252
  // todo: issue error for short APPEND if the source is without header line
28238
28253
  class Append {
28239
28254
  runSyntax(node, scope, filename) {
@@ -28276,7 +28291,17 @@ class Append {
28276
28291
  else if (targetType instanceof basic_1.VoidType) {
28277
28292
  rowType = targetType;
28278
28293
  }
28279
- new source_1.Source().runSyntax(source, scope, filename, rowType);
28294
+ const sourceType = new source_1.Source().runSyntax(source, scope, filename, rowType);
28295
+ if (node.findDirectTokenByText("LINES")) {
28296
+ if (new _type_utils_1.TypeUtils(scope).isAssignable(sourceType, targetType) === false) {
28297
+ throw new Error("Incompatible types");
28298
+ }
28299
+ }
28300
+ else {
28301
+ if (new _type_utils_1.TypeUtils(scope).isAssignable(sourceType, rowType) === false) {
28302
+ throw new Error("Incompatible types");
28303
+ }
28304
+ }
28280
28305
  }
28281
28306
  const from = node.findExpressionAfterToken("FROM");
28282
28307
  if (from && from.get() instanceof Expressions.Source) {
@@ -31648,8 +31673,8 @@ class ReadTable {
31648
31673
  const fromSource = node.findExpressionAfterToken("FROM");
31649
31674
  if (fromSource) {
31650
31675
  const fromType = new source_1.Source().runSyntax(fromSource, scope, filename);
31651
- if (new _type_utils_1.TypeUtils(scope).isAssignable(fromType, basic_1.IntegerType.get()) === false) {
31652
- throw new Error("READ TABLE, FROM must be simple");
31676
+ if (new _type_utils_1.TypeUtils(scope).isAssignable(fromType, rowType) === false) {
31677
+ throw new Error("READ TABLE, FROM must be compatible");
31653
31678
  }
31654
31679
  }
31655
31680
  for (const s of sources) {
@@ -51311,7 +51336,7 @@ class Registry {
51311
51336
  }
51312
51337
  static abaplintVersion() {
51313
51338
  // magic, see build script "version.sh"
51314
- return "2.105.23";
51339
+ return "2.105.25";
51315
51340
  }
51316
51341
  getDDICReferences() {
51317
51342
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.105.23",
3
+ "version": "2.105.25",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,12 +38,12 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.105.23",
41
+ "@abaplint/core": "^2.105.25",
42
42
  "@types/chai": "^4.3.12",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.6",
46
- "@types/node": "^20.11.20",
46
+ "@types/node": "^20.11.22",
47
47
  "@types/progress": "^2.0.7",
48
48
  "chai": "^4.4.1",
49
49
  "chalk": "^5.3.0",