@abaplint/cli 2.113.121 → 2.113.122

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 +36 -17
  2. package/package.json +3 -3
package/build/cli.js CHANGED
@@ -973,7 +973,11 @@ async function loadDependencies(config, compress, bar, base) {
973
973
  if (d.url) {
974
974
  process.stderr.write("Clone: " + d.url + "\n");
975
975
  const dir = fs.mkdtempSync(path.join(os.tmpdir(), "abaplint-"));
976
- childProcess.execSync("git clone --quiet --depth 1 " + d.url + " .", { cwd: dir, stdio: "inherit" });
976
+ let branch = "";
977
+ if (d.branch) {
978
+ branch = "-b " + d.branch + " ";
979
+ }
980
+ childProcess.execSync("git clone --quiet --depth 1 " + branch + d.url + " .", { cwd: dir, stdio: "inherit" });
977
981
  const names = file_operations_1.FileOperations.loadFileNames(dir + d.files);
978
982
  files = files.concat(await file_operations_1.FileOperations.loadFiles(compress, names, bar));
979
983
  file_operations_1.FileOperations.deleteFolderRecursive(dir);
@@ -23184,6 +23188,7 @@ exports.TypeUtils = void 0;
23184
23188
  const types_1 = __webpack_require__(/*! ../types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
23185
23189
  const basic_1 = __webpack_require__(/*! ../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
23186
23190
  const cgeneric_type_1 = __webpack_require__(/*! ../types/basic/cgeneric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js");
23191
+ const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
23187
23192
  // todo: refactor to static? for performance
23188
23193
  class TypeUtils {
23189
23194
  constructor(scope) {
@@ -23402,8 +23407,22 @@ class TypeUtils {
23402
23407
  }
23403
23408
  return false;
23404
23409
  }
23405
- isAssignableStrict(source, target, calculated = false) {
23410
+ isCalculated(node) {
23411
+ /*
23412
+ if (node.getChildren().length === 1
23413
+ && node.get() instanceof Expressions.Source
23414
+ && node.getFirstChild()?.get() instanceof Expressions.MethodCallChain) {
23415
+ return false;
23416
+ }
23417
+ */
23418
+ const calculated = node.findFirstExpression(Expressions.MethodCallChain) !== undefined
23419
+ || node.findFirstExpression(Expressions.StringTemplate) !== undefined
23420
+ || node.findFirstExpression(Expressions.ArithOperator) !== undefined;
23421
+ return calculated;
23422
+ }
23423
+ isAssignableStrict(source, target, node) {
23406
23424
  var _a, _b, _c, _d, _e, _f, _g, _h;
23425
+ const calculated = node ? this.isCalculated(node) : false;
23407
23426
  /*
23408
23427
  console.dir(source);
23409
23428
  console.dir(target);
@@ -23455,6 +23474,13 @@ class TypeUtils {
23455
23474
  else if (source instanceof basic_1.StringType) {
23456
23475
  if (target instanceof basic_1.StructureType && this.structureContainsString(target)) {
23457
23476
  return false;
23477
+ /*
23478
+ } else if (target instanceof CharacterType) {
23479
+ if (source.getAbstractTypeData()?.derivedFromConstant === true) {
23480
+ return true;
23481
+ }
23482
+ return false;
23483
+ */
23458
23484
  }
23459
23485
  else if (target instanceof basic_1.IntegerType) {
23460
23486
  if (((_f = source.getAbstractTypeData()) === null || _f === void 0 ? void 0 : _f.derivedFromConstant) === true) {
@@ -26683,15 +26709,12 @@ class MethodCallParam {
26683
26709
  if (child.get() instanceof Expressions.Source) {
26684
26710
  sourceType = new source_1.Source().runSyntax(child, input, targetType);
26685
26711
  }
26686
- const calculated = child.findFirstExpression(Expressions.MethodCallChain) !== undefined
26687
- || child.findFirstExpression(Expressions.StringTemplate) !== undefined
26688
- || child.findFirstExpression(Expressions.ArithOperator) !== undefined;
26689
26712
  if (sourceType === undefined) {
26690
26713
  const message = "No source type determined, method source";
26691
26714
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
26692
26715
  return;
26693
26716
  }
26694
- else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(sourceType, targetType, calculated) === false) {
26717
+ else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(sourceType, targetType, child) === false) {
26695
26718
  const message = "Method parameter type not compatible";
26696
26719
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
26697
26720
  return;
@@ -26982,15 +27005,12 @@ class MethodParameters {
26982
27005
  }
26983
27006
  for (const item of items) {
26984
27007
  const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);
26985
- const calculated = item.source.findFirstExpression(Expressions.MethodCallChain) !== undefined
26986
- || item.source.findFirstExpression(Expressions.StringTemplate) !== undefined
26987
- || item.source.findFirstExpression(Expressions.ArithOperator) !== undefined;
26988
27008
  if (parameter === undefined) {
26989
27009
  const message = "Method importing parameter \"" + item.name + "\" does not exist";
26990
27010
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
26991
27011
  continue;
26992
27012
  }
26993
- else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(item.sourceType, parameter.getType(), calculated) === false) {
27013
+ else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(item.sourceType, parameter.getType(), item.source) === false) {
26994
27014
  const message = "Method parameter type not compatible, " + item.name;
26995
27015
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
26996
27016
  return;
@@ -30902,16 +30922,13 @@ class CreateObject {
30902
30922
  }
30903
30923
  const source = p.findDirectExpression(Expressions.Source);
30904
30924
  const sourceType = new source_1.Source().runSyntax(source, input);
30905
- const calculated = (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.MethodCallChain)) !== undefined
30906
- || (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.StringTemplate)) !== undefined
30907
- || (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.ArithOperator)) !== undefined;
30908
30925
  const found = allImporting === null || allImporting === void 0 ? void 0 : allImporting.find(p => p.getName().toUpperCase() === name);
30909
30926
  if (found === undefined) {
30910
30927
  const message = `constructor parameter "${name}" does not exist`;
30911
30928
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30912
30929
  return;
30913
30930
  }
30914
- else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(sourceType, found.getType(), calculated) === false) {
30931
+ else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(sourceType, found.getType(), source) === false) {
30915
30932
  const message = `constructor parameter "${name}" type not compatible`;
30916
30933
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30917
30934
  return;
@@ -54213,7 +54230,7 @@ class Registry {
54213
54230
  }
54214
54231
  static abaplintVersion() {
54215
54232
  // magic, see build script "version.sh"
54216
- return "2.113.121";
54233
+ return "2.113.122";
54217
54234
  }
54218
54235
  getDDICReferences() {
54219
54236
  return this.ddicReferences;
@@ -62955,6 +62972,7 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-re
62955
62972
  else if (this.conf.allowCheck === false && get instanceof Statements.Check && stack.length === 0) {
62956
62973
  const message = "CHECK is not allowed outside of loops";
62957
62974
  let tokensString = statement.concatTokens();
62975
+ tokensString = tokensString.replace(/^check /i, "CHECK ");
62958
62976
  tokensString = tokensString.split("CHECK")[1].trim();
62959
62977
  const replacement = "IF NOT " + tokensString + "\n RETURN.\nENDIF.";
62960
62978
  const fix = edit_helper_1.EditHelper.replaceRange(file, statement.getFirstToken().getStart(), statement.getLastToken().getEnd(), replacement);
@@ -76483,8 +76501,9 @@ ENDINTERFACE.`,
76483
76501
  var _a;
76484
76502
  const issues = [];
76485
76503
  for (const s of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.MethodDef)) || []) {
76486
- if (s.findDirectExpression(Expressions.MethodDefExceptions)) {
76487
- issues.push(issue_1.Issue.atStatement(file, s, this.getMessage(), this.getMetadata().key));
76504
+ const expr = s.findDirectExpression(Expressions.MethodDefExceptions);
76505
+ if (expr) {
76506
+ issues.push(issue_1.Issue.atToken(file, expr.getFirstToken(), this.getMessage(), this.getMetadata().key));
76488
76507
  }
76489
76508
  }
76490
76509
  return issues;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.121",
3
+ "version": "2.113.122",
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.113.121",
41
+ "@abaplint/core": "^2.113.122",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",
@@ -53,7 +53,7 @@
53
53
  "json5": "^2.2.3",
54
54
  "memfs": "^4.17.2",
55
55
  "minimist": "^1.2.8",
56
- "mocha": "^11.4.0",
56
+ "mocha": "^11.5.0",
57
57
  "progress": "^2.0.3",
58
58
  "typescript": "^5.8.3",
59
59
  "webpack": "^5.99.9",