@abaplint/cli 2.115.13 → 2.115.15

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 +109 -4
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -23308,8 +23308,25 @@ class Procedural {
23308
23308
  }
23309
23309
  return undefined;
23310
23310
  }
23311
+ findFunctionGroupScope(fg) {
23312
+ var _a, _b, _c;
23313
+ for (const module of fg.getModules()) {
23314
+ if (module.isGlobalParameters() === false) {
23315
+ continue;
23316
+ }
23317
+ // console.dir(fg.getSequencedFiles());
23318
+ const fmFile = fg.getSequencedFiles().find((f) => { return f.getFilename().endsWith(".fugr." + module.getName().toLowerCase().replace(/\//g, "#") + ".abap"); });
23319
+ if (fmFile === undefined) {
23320
+ continue;
23321
+ }
23322
+ const nameToken = (_c = (_b = (_a = fmFile.getStructure()) === null || _a === void 0 ? void 0 : _a.findFirstStatement(Statements.FunctionModule)) === null || _b === void 0 ? void 0 : _b.findFirstExpression(Expressions.Field)) === null || _c === void 0 ? void 0 : _c.getFirstToken();
23323
+ if (nameToken === undefined) {
23324
+ continue;
23325
+ }
23326
+ this.addFunctionScope(module, nameToken, fmFile.getFilename(), true);
23327
+ }
23328
+ }
23311
23329
  findFunctionScope(obj, node, filename) {
23312
- var _a, _b, _c, _d, _e;
23313
23330
  if (!(obj instanceof objects_1.FunctionGroup)) {
23314
23331
  throw new Error("findFunctionScope, expected function group input");
23315
23332
  }
@@ -23320,6 +23337,13 @@ class Procedural {
23320
23337
  if (definition === undefined) {
23321
23338
  throw new Error("Function module definition \"" + name + "\" not found");
23322
23339
  }
23340
+ if (definition.isGlobalParameters() === true) {
23341
+ return; // already added at global level
23342
+ }
23343
+ this.addFunctionScope(definition, nameToken, filename);
23344
+ }
23345
+ addFunctionScope(definition, nameToken, filename, ignoreIfAlreadyExists = false) {
23346
+ var _a, _b, _c, _d, _e;
23323
23347
  const ddic = new ddic_1.DDIC(this.reg);
23324
23348
  const allNames = new Set();
23325
23349
  for (const param of definition.getParameters()) {
@@ -23405,7 +23429,15 @@ class Procedural {
23405
23429
  }
23406
23430
  else {
23407
23431
  const type = new _typed_identifier_1.TypedIdentifier(nameToken, filename, found);
23408
- this.scope.addNamedIdentifier(param.name, type);
23432
+ if (ignoreIfAlreadyExists === true) {
23433
+ const exists = this.scope.findVariable(param.name);
23434
+ if (exists === undefined) {
23435
+ this.scope.addNamedIdentifier(param.name, type);
23436
+ }
23437
+ }
23438
+ else {
23439
+ this.scope.addNamedIdentifier(param.name, type);
23440
+ }
23409
23441
  allNames.add(param.name.toUpperCase());
23410
23442
  }
23411
23443
  }
@@ -28726,6 +28758,9 @@ class Source {
28726
28758
  if (context instanceof basic_1.FloatType && found instanceof basic_1.IntegerType) {
28727
28759
  return context;
28728
28760
  }
28761
+ else if (context instanceof basic_1.IntegerType && (found === null || found === void 0 ? void 0 : found.isGeneric())) {
28762
+ return context;
28763
+ }
28729
28764
  else {
28730
28765
  return found;
28731
28766
  }
@@ -36531,6 +36566,9 @@ class SyntaxLogic {
36531
36566
  stype = _scope_type_1.ScopeType.FunctionGroup;
36532
36567
  }
36533
36568
  this.scope.push(stype, this.object.getName(), new position_1.Position(1, 1), main.getFilename());
36569
+ if (this.object instanceof objects_1.FunctionGroup) {
36570
+ this.helpers.proc.findFunctionGroupScope(this.object);
36571
+ }
36534
36572
  }
36535
36573
  }
36536
36574
  else if (this.object instanceof objects_1.TypePool) {
@@ -40227,6 +40265,9 @@ class FunctionModuleDefinition {
40227
40265
  getName() {
40228
40266
  return this.name;
40229
40267
  }
40268
+ isGlobalParameters() {
40269
+ return this.globalParameters;
40270
+ }
40230
40271
  ///////////////
40231
40272
  parse(data) {
40232
40273
  if (data.FUNCNAME === undefined) {
@@ -40235,6 +40276,7 @@ class FunctionModuleDefinition {
40235
40276
  this.name = data.FUNCNAME;
40236
40277
  this.description = data.SHORT_TEXT;
40237
40278
  this.parameters = [];
40279
+ this.globalParameters = data.GLOBAL_FLAG === "X";
40238
40280
  this.moduleType = FunctionModuleType.regular;
40239
40281
  if (data.REMOTE_CALL === "R") {
40240
40282
  this.moduleType = FunctionModuleType.remote;
@@ -55332,7 +55374,7 @@ class Registry {
55332
55374
  }
55333
55375
  static abaplintVersion() {
55334
55376
  // magic, see build script "version.sh"
55335
- return "2.115.13";
55377
+ return "2.115.15";
55336
55378
  }
55337
55379
  getDDICReferences() {
55338
55380
  return this.ddicReferences;
@@ -64386,6 +64428,68 @@ exports.Exporting = Exporting;
64386
64428
 
64387
64429
  /***/ },
64388
64430
 
64431
+ /***/ "./node_modules/@abaplint/core/build/src/rules/fm_global_parameters_obsolete.js"
64432
+ /*!**************************************************************************************!*\
64433
+ !*** ./node_modules/@abaplint/core/build/src/rules/fm_global_parameters_obsolete.js ***!
64434
+ \**************************************************************************************/
64435
+ (__unused_webpack_module, exports, __webpack_require__) {
64436
+
64437
+ "use strict";
64438
+
64439
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
64440
+ exports.FMGlobalParametersObsolete = exports.FMGlobalParametersObsoleteConf = void 0;
64441
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
64442
+ const Objects = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
64443
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
64444
+ const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
64445
+ class FMGlobalParametersObsoleteConf extends _basic_rule_config_1.BasicRuleConfig {
64446
+ }
64447
+ exports.FMGlobalParametersObsoleteConf = FMGlobalParametersObsoleteConf;
64448
+ class FMGlobalParametersObsolete {
64449
+ constructor() {
64450
+ this.conf = new FMGlobalParametersObsoleteConf();
64451
+ }
64452
+ getMetadata() {
64453
+ return {
64454
+ key: "fm_global_parameters_obsolete",
64455
+ title: "FM Global Parameters Obsolete",
64456
+ shortDescription: `Check for function modules with global parameteers`,
64457
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenglobal_parameters_obsolete.htm`,
64458
+ tags: [],
64459
+ };
64460
+ }
64461
+ initialize(_reg) {
64462
+ return this;
64463
+ }
64464
+ getConfig() {
64465
+ return this.conf;
64466
+ }
64467
+ setConfig(conf) {
64468
+ this.conf = conf;
64469
+ }
64470
+ run(obj) {
64471
+ if (!(obj instanceof Objects.FunctionGroup)) {
64472
+ return [];
64473
+ }
64474
+ const issues = [];
64475
+ for (const module of obj.getModules()) {
64476
+ if (module.isGlobalParameters() === true) {
64477
+ const file = obj.getMainABAPFile();
64478
+ if (file === undefined) {
64479
+ continue;
64480
+ }
64481
+ const message = `Function Module "${module.getName()}" uses obsolete global parameters`;
64482
+ issues.push(issue_1.Issue.atPosition(file, new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity));
64483
+ }
64484
+ }
64485
+ return issues;
64486
+ }
64487
+ }
64488
+ exports.FMGlobalParametersObsolete = FMGlobalParametersObsolete;
64489
+ //# sourceMappingURL=fm_global_parameters_obsolete.js.map
64490
+
64491
+ /***/ },
64492
+
64389
64493
  /***/ "./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js"
64390
64494
  /*!*****************************************************************************!*\
64391
64495
  !*** ./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js ***!
@@ -66756,6 +66860,7 @@ __exportStar(__webpack_require__(/*! ./empty_structure */ "./node_modules/@abapl
66756
66860
  __exportStar(__webpack_require__(/*! ./exit_or_check */ "./node_modules/@abaplint/core/build/src/rules/exit_or_check.js"), exports);
66757
66861
  __exportStar(__webpack_require__(/*! ./expand_macros */ "./node_modules/@abaplint/core/build/src/rules/expand_macros.js"), exports);
66758
66862
  __exportStar(__webpack_require__(/*! ./exporting */ "./node_modules/@abaplint/core/build/src/rules/exporting.js"), exports);
66863
+ __exportStar(__webpack_require__(/*! ./fm_global_parameters_obsolete */ "./node_modules/@abaplint/core/build/src/rules/fm_global_parameters_obsolete.js"), exports);
66759
66864
  __exportStar(__webpack_require__(/*! ./forbidden_identifier */ "./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js"), exports);
66760
66865
  __exportStar(__webpack_require__(/*! ./forbidden_pseudo_and_pragma */ "./node_modules/@abaplint/core/build/src/rules/forbidden_pseudo_and_pragma.js"), exports);
66761
66866
  __exportStar(__webpack_require__(/*! ./forbidden_void_type */ "./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js"), exports);
@@ -66769,6 +66874,7 @@ __exportStar(__webpack_require__(/*! ./identical_conditions */ "./node_modules/@
66769
66874
  __exportStar(__webpack_require__(/*! ./identical_contents */ "./node_modules/@abaplint/core/build/src/rules/identical_contents.js"), exports);
66770
66875
  __exportStar(__webpack_require__(/*! ./identical_descriptions */ "./node_modules/@abaplint/core/build/src/rules/identical_descriptions.js"), exports);
66771
66876
  __exportStar(__webpack_require__(/*! ./identical_form_names */ "./node_modules/@abaplint/core/build/src/rules/identical_form_names.js"), exports);
66877
+ __exportStar(__webpack_require__(/*! ./identical_move */ "./node_modules/@abaplint/core/build/src/rules/identical_move.js"), exports);
66772
66878
  __exportStar(__webpack_require__(/*! ./if_in_if */ "./node_modules/@abaplint/core/build/src/rules/if_in_if.js"), exports);
66773
66879
  __exportStar(__webpack_require__(/*! ./implement_methods */ "./node_modules/@abaplint/core/build/src/rules/implement_methods.js"), exports);
66774
66880
  __exportStar(__webpack_require__(/*! ./implicit_start_of_selection */ "./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js"), exports);
@@ -66780,7 +66886,6 @@ __exportStar(__webpack_require__(/*! ./intf_referencing_clas */ "./node_modules/
66780
66886
  __exportStar(__webpack_require__(/*! ./invalid_table_index */ "./node_modules/@abaplint/core/build/src/rules/invalid_table_index.js"), exports);
66781
66887
  __exportStar(__webpack_require__(/*! ./keep_single_parameter_on_one_line */ "./node_modules/@abaplint/core/build/src/rules/keep_single_parameter_on_one_line.js"), exports);
66782
66888
  __exportStar(__webpack_require__(/*! ./keyword_case */ "./node_modules/@abaplint/core/build/src/rules/keyword_case.js"), exports);
66783
- __exportStar(__webpack_require__(/*! ./identical_move */ "./node_modules/@abaplint/core/build/src/rules/identical_move.js"), exports);
66784
66889
  __exportStar(__webpack_require__(/*! ./line_break_multiple_parameters */ "./node_modules/@abaplint/core/build/src/rules/line_break_multiple_parameters.js"), exports);
66785
66890
  __exportStar(__webpack_require__(/*! ./line_break_style */ "./node_modules/@abaplint/core/build/src/rules/line_break_style.js"), exports);
66786
66891
  __exportStar(__webpack_require__(/*! ./line_length */ "./node_modules/@abaplint/core/build/src/rules/line_length.js"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.115.13",
3
+ "version": "2.115.15",
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.115.13",
41
+ "@abaplint/core": "^2.115.15",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",