@abaplint/cli 2.102.6 → 2.102.8

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 +49 -29
  2. package/package.json +4 -4
package/build/cli.js CHANGED
@@ -19249,7 +19249,12 @@ class BuiltInMethod extends _identifier_1.Identifier {
19249
19249
  this.row = row;
19250
19250
  }
19251
19251
  getRequiredParameters() {
19252
- return [];
19252
+ const ret = [];
19253
+ for (const i in this.method.mandatory) {
19254
+ const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);
19255
+ ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));
19256
+ }
19257
+ return ret;
19253
19258
  }
19254
19259
  getOptional() {
19255
19260
  throw new Error("BuiltInMethod->Method not implemented.");
@@ -27133,7 +27138,7 @@ class Assign {
27133
27138
  const theSource = sources[sources.length - 1];
27134
27139
  let sourceType = new source_1.Source().runSyntax(theSource, scope, filename);
27135
27140
  if (sourceType === undefined || ((_b = node.findDirectExpression(Expressions.AssignSource)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Dynamic))) {
27136
- sourceType = new basic_1.VoidType("DynamicAssign");
27141
+ sourceType = new basic_1.AnyType();
27137
27142
  }
27138
27143
  for (const d of ((_c = node.findDirectExpression(Expressions.AssignSource)) === null || _c === void 0 ? void 0 : _c.findAllExpressions(Expressions.Dynamic)) || []) {
27139
27144
  new dynamic_1.Dynamic().runSyntax(d, scope, filename);
@@ -27640,10 +27645,15 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
27640
27645
  const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
27641
27646
  class ClassLocalFriends {
27642
27647
  runSyntax(node, scope, filename) {
27643
- const found = node.findDirectExpression(Expressions.ClassName);
27648
+ const classNames = node.findAllExpressions(Expressions.ClassName);
27649
+ const found = classNames[0];
27644
27650
  if (found) {
27645
27651
  const token = found.getFirstToken();
27646
27652
  const name = token.getStr();
27653
+ if (scope.getParentObj().getType() === "CLAS"
27654
+ && name.toUpperCase() !== scope.getParentObj().getName().toUpperCase()) {
27655
+ throw new Error(`Befriending must be ` + scope.getParentObj().getName().toUpperCase());
27656
+ }
27647
27657
  const def = scope.findClassDefinition(name);
27648
27658
  if (def) {
27649
27659
  scope.addReference(token, def, _reference_1.ReferenceType.ObjectOrientedReference, filename);
@@ -27652,6 +27662,14 @@ class ClassLocalFriends {
27652
27662
  throw new Error(`Class ${name.toUpperCase()} not found`);
27653
27663
  }
27654
27664
  }
27665
+ for (let i = 1; i < classNames.length; i++) {
27666
+ const className = classNames[i].concatTokens();
27667
+ // make sure to check also DEFINITION DEFERRED
27668
+ const found = scope.existsObject(className);
27669
+ if (found.found === false) {
27670
+ throw new Error(`Class ${className.toUpperCase()} not found`);
27671
+ }
27672
+ }
27655
27673
  }
27656
27674
  }
27657
27675
  exports.ClassLocalFriends = ClassLocalFriends;
@@ -47353,46 +47371,45 @@ class TableType extends _abstract_object_1.AbstractObject {
47353
47371
  this.parsedXML = undefined;
47354
47372
  super.setDirty();
47355
47373
  }
47356
- buildTableOptions() {
47357
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
47358
- let primaryKey = undefined;
47359
- if (((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.accessmode) === "S") {
47360
- primaryKey = {
47361
- isUnique: ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.keykind) === "U",
47362
- type: basic_1.TableAccessType.sorted,
47363
- keyFields: [],
47364
- name: "primary_key",
47365
- };
47374
+ buildPrimaryKey() {
47375
+ var _a, _b, _c, _d, _e;
47376
+ const primaryKey = {
47377
+ isUnique: ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.keykind) === "U",
47378
+ type: basic_1.TableAccessType.standard,
47379
+ keyFields: [],
47380
+ name: "primary_key",
47381
+ };
47382
+ if (((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.accessmode) === "S") {
47383
+ primaryKey.type = basic_1.TableAccessType.sorted;
47366
47384
  }
47367
47385
  else if (((_c = this.parsedXML) === null || _c === void 0 ? void 0 : _c.accessmode) === "H") {
47368
- primaryKey = {
47369
- isUnique: ((_d = this.parsedXML) === null || _d === void 0 ? void 0 : _d.keykind) === "U",
47370
- type: basic_1.TableAccessType.hashed,
47371
- keyFields: [],
47372
- name: "primary_key",
47373
- };
47386
+ primaryKey.type = basic_1.TableAccessType.hashed;
47374
47387
  }
47375
- for (const f of ((_e = this.parsedXML) === null || _e === void 0 ? void 0 : _e.dd42v) || []) {
47388
+ for (const f of ((_d = this.parsedXML) === null || _d === void 0 ? void 0 : _d.dd42v) || []) {
47376
47389
  if (f.keyname === "") {
47377
- primaryKey === null || primaryKey === void 0 ? void 0 : primaryKey.keyFields.push(f.keyfield);
47390
+ primaryKey.keyFields.push(f.keyfield);
47378
47391
  }
47379
47392
  }
47380
- if (((_f = this.parsedXML) === null || _f === void 0 ? void 0 : _f.keydef) === "T" && (primaryKey === null || primaryKey === void 0 ? void 0 : primaryKey.keyFields.length) === 0) {
47381
- primaryKey === null || primaryKey === void 0 ? void 0 : primaryKey.keyFields.push("table_line");
47393
+ if (((_e = this.parsedXML) === null || _e === void 0 ? void 0 : _e.keydef) === "T" && primaryKey.keyFields.length === 0) {
47394
+ primaryKey.keyFields.push("table_line");
47382
47395
  }
47396
+ return primaryKey;
47397
+ }
47398
+ buildTableOptions() {
47399
+ var _a, _b, _c, _d;
47383
47400
  let keyType = Types.TableKeyType.user;
47384
- if (((_g = this.parsedXML) === null || _g === void 0 ? void 0 : _g.keydef) === "D") {
47401
+ if (((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.keydef) === "D") {
47385
47402
  keyType = Types.TableKeyType.default;
47386
47403
  }
47387
47404
  const tableOptions = {
47388
47405
  withHeader: false,
47389
47406
  keyType: keyType,
47390
- primaryKey: primaryKey,
47407
+ primaryKey: this.buildPrimaryKey(),
47391
47408
  secondary: [],
47392
47409
  };
47393
- for (const k of ((_h = this.parsedXML) === null || _h === void 0 ? void 0 : _h.dd43v) || []) {
47410
+ for (const k of ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.dd43v) || []) {
47394
47411
  const fields = [];
47395
- for (const f of ((_j = this.parsedXML) === null || _j === void 0 ? void 0 : _j.dd42v) || []) {
47412
+ for (const f of ((_c = this.parsedXML) === null || _c === void 0 ? void 0 : _c.dd42v) || []) {
47396
47413
  if (f.keyname === k.keyname) {
47397
47414
  fields.push(f.keyfield);
47398
47415
  }
@@ -47408,7 +47425,7 @@ class TableType extends _abstract_object_1.AbstractObject {
47408
47425
  default:
47409
47426
  break;
47410
47427
  }
47411
- (_k = tableOptions.secondary) === null || _k === void 0 ? void 0 : _k.push({
47428
+ (_d = tableOptions.secondary) === null || _d === void 0 ? void 0 : _d.push({
47412
47429
  name: k.keyname,
47413
47430
  type: accessType,
47414
47431
  keyFields: fields,
@@ -48539,7 +48556,7 @@ class Registry {
48539
48556
  }
48540
48557
  static abaplintVersion() {
48541
48558
  // magic, see build script "version.sh"
48542
- return "2.102.6";
48559
+ return "2.102.8";
48543
48560
  }
48544
48561
  getDDICReferences() {
48545
48562
  return this.ddicReferences;
@@ -52458,6 +52475,9 @@ class CyclomaticComplexity {
52458
52475
  }
52459
52476
  setConfig(conf) {
52460
52477
  this.conf = conf;
52478
+ if (this.conf.max === undefined) {
52479
+ this.conf.max = new CyclomaticComplexityConf().max;
52480
+ }
52461
52481
  }
52462
52482
  initialize(_reg) {
52463
52483
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.102.6",
3
+ "version": "2.102.8",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,16 +38,16 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.102.6",
41
+ "@abaplint/core": "^2.102.8",
42
42
  "@types/chai": "^4.3.5",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.2",
45
45
  "@types/mocha": "^10.0.1",
46
- "@types/node": "^20.4.4",
46
+ "@types/node": "^20.4.5",
47
47
  "@types/progress": "^2.0.5",
48
48
  "chai": "^4.3.7",
49
49
  "chalk": "^5.3.0",
50
- "eslint": "^8.45.0",
50
+ "eslint": "^8.46.0",
51
51
  "glob": "^7.2.3",
52
52
  "json5": "^2.2.3",
53
53
  "memfs": "^4.2.0",