@abaplint/cli 2.102.54 → 2.102.56

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 +29 -6
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -1467,6 +1467,11 @@ class Lexer {
1467
1467
  this.add();
1468
1468
  this.m = this.ModeNormal;
1469
1469
  }
1470
+ else if (this.m === this.ModeTemplate
1471
+ && ahead === "}"
1472
+ && current !== "\\") {
1473
+ this.add();
1474
+ }
1470
1475
  else if (this.m === this.ModeStr
1471
1476
  && current === "'"
1472
1477
  && buf.length > 1
@@ -16493,9 +16498,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
16493
16498
  exports.TruncateDataset = void 0;
16494
16499
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
16495
16500
  const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
16501
+ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
16496
16502
  class TruncateDataset {
16497
16503
  getMatcher() {
16498
- return (0, combi_1.seq)("TRUNCATE DATASET", expressions_1.Source, "AT CURRENT POSITION");
16504
+ return (0, combi_1.verNot)(version_1.Version.Cloud, (0, combi_1.seq)("TRUNCATE DATASET", expressions_1.Source, "AT CURRENT POSITION"));
16499
16505
  }
16500
16506
  }
16501
16507
  exports.TruncateDataset = TruncateDataset;
@@ -21868,6 +21874,7 @@ class TypeUtils {
21868
21874
  else if (source instanceof basic_1.XStringType) {
21869
21875
  if (target instanceof basic_1.CLikeType
21870
21876
  || target instanceof basic_1.IntegerType
21877
+ || target instanceof basic_1.StringType
21871
21878
  || target instanceof basic_1.ObjectReferenceType
21872
21879
  || target instanceof basic_1.HexType) {
21873
21880
  return false;
@@ -24667,6 +24674,7 @@ class MethodCallChain {
24667
24674
  if (first.get() instanceof Expressions.MethodCall) {
24668
24675
  children.unshift(first);
24669
24676
  }
24677
+ let previous = "";
24670
24678
  while (children.length > 0) {
24671
24679
  const current = children.shift();
24672
24680
  if (current === undefined) {
@@ -24687,6 +24695,9 @@ class MethodCallChain {
24687
24695
  }
24688
24696
  }
24689
24697
  else {
24698
+ if (previous === "=>" && (method === null || method === void 0 ? void 0 : method.isStatic()) === false) {
24699
+ throw new Error("Method \"" + methodName + "\" not static");
24700
+ }
24690
24701
  const extra = {
24691
24702
  ooName: foundDef === null || foundDef === void 0 ? void 0 : foundDef.getName(),
24692
24703
  ooType: foundDef instanceof class_definition_1.ClassDefinition ? "CLAS" : "INTF"
@@ -24724,6 +24735,7 @@ class MethodCallChain {
24724
24735
  else if (current instanceof nodes_1.ExpressionNode && current.get() instanceof Expressions.AttributeName) {
24725
24736
  context = new attribute_name_1.AttributeName().runSyntax(context, current, scope, filename);
24726
24737
  }
24738
+ previous = current.concatTokens();
24727
24739
  }
24728
24740
  return context;
24729
24741
  }
@@ -26384,7 +26396,8 @@ class StringTemplate {
26384
26396
  if (type === undefined) {
26385
26397
  throw new Error("No target type determined");
26386
26398
  }
26387
- else if (typeUtils.isCharLike(type) === false && typeUtils.isHexLike(type) === false) {
26399
+ else if ((typeUtils.isCharLike(type) === false && typeUtils.isHexLike(type) === false)
26400
+ || type instanceof basic_1.StructureType) {
26388
26401
  throw new Error("Not character like, " + type.constructor.name);
26389
26402
  }
26390
26403
  const format = templateSource.findDirectExpression(Expressions.StringTemplateFormatting);
@@ -27431,9 +27444,10 @@ const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_module
27431
27444
  const fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js");
27432
27445
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
27433
27446
  const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
27447
+ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
27434
27448
  class Assign {
27435
27449
  runSyntax(node, scope, filename) {
27436
- var _a, _b;
27450
+ var _a;
27437
27451
  const assignSource = node.findDirectExpression(Expressions.AssignSource);
27438
27452
  const sources = (assignSource === null || assignSource === void 0 ? void 0 : assignSource.findDirectExpressions(Expressions.Source)) || [];
27439
27453
  const theSource = sources[sources.length - 1];
@@ -27452,10 +27466,18 @@ class Assign {
27452
27466
  else {
27453
27467
  sourceType = new source_1.Source().runSyntax(theSource, scope, filename);
27454
27468
  }
27455
- if (sourceType === undefined || ((_a = node.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Dynamic))) {
27469
+ if ((assignSource === null || assignSource === void 0 ? void 0 : assignSource.getChildren().length) === 5
27470
+ && ((_a = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getFirstChild()) === null || _a === void 0 ? void 0 : _a.concatTokens()) === "COMPONENT") {
27471
+ const componentSource = sources[sources.length - 2];
27472
+ const componentType = new source_1.Source().runSyntax(componentSource, scope, filename);
27473
+ if (new _type_utils_1.TypeUtils(scope).isAssignable(componentType, new basic_1.CharacterType(30)) === false) {
27474
+ throw new Error("component name must be charlike");
27475
+ }
27476
+ }
27477
+ if (sourceType === undefined || (assignSource === null || assignSource === void 0 ? void 0 : assignSource.findDirectExpression(Expressions.Dynamic))) {
27456
27478
  sourceType = new basic_1.AnyType();
27457
27479
  }
27458
- for (const d of ((_b = node.findDirectExpression(Expressions.AssignSource)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(Expressions.Dynamic)) || []) {
27480
+ for (const d of (assignSource === null || assignSource === void 0 ? void 0 : assignSource.findAllExpressions(Expressions.Dynamic)) || []) {
27459
27481
  new dynamic_1.Dynamic().runSyntax(d, scope, filename);
27460
27482
  }
27461
27483
  const target = node.findDirectExpression(Expressions.FSTarget);
@@ -49182,7 +49204,7 @@ class Registry {
49182
49204
  }
49183
49205
  static abaplintVersion() {
49184
49206
  // magic, see build script "version.sh"
49185
- return "2.102.54";
49207
+ return "2.102.56";
49186
49208
  }
49187
49209
  getDDICReferences() {
49188
49210
  return this.ddicReferences;
@@ -68585,6 +68607,7 @@ class UnreachableCode extends _abap_rule_1.ABAPRule {
68585
68607
  || s instanceof Statements.EndMethod
68586
68608
  || s instanceof Statements.EndModule
68587
68609
  || s instanceof Statements.EndForm
68610
+ || s instanceof Statements.EndTestSeam
68588
68611
  || s instanceof Statements.EndAt
68589
68612
  || s instanceof Statements.EndSelect
68590
68613
  || s instanceof Statements.AtSelectionScreen
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.102.54",
3
+ "version": "2.102.56",
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.102.54",
41
+ "@abaplint/core": "^2.102.56",
42
42
  "@types/chai": "^4.3.6",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.3",