@abaplint/cli 2.102.5 → 2.102.7

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 +32 -29
  2. package/package.json +3 -3
package/build/cli.js CHANGED
@@ -27133,7 +27133,7 @@ class Assign {
27133
27133
  const theSource = sources[sources.length - 1];
27134
27134
  let sourceType = new source_1.Source().runSyntax(theSource, scope, filename);
27135
27135
  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");
27136
+ sourceType = new basic_1.AnyType();
27137
27137
  }
27138
27138
  for (const d of ((_c = node.findDirectExpression(Expressions.AssignSource)) === null || _c === void 0 ? void 0 : _c.findAllExpressions(Expressions.Dynamic)) || []) {
27139
27139
  new dynamic_1.Dynamic().runSyntax(d, scope, filename);
@@ -28181,16 +28181,16 @@ const data_definition_1 = __webpack_require__(/*! ../expressions/data_definition
28181
28181
  const unknown_type_1 = __webpack_require__(/*! ../../types/basic/unknown_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js");
28182
28182
  class Data {
28183
28183
  runSyntax(node, scope, filename) {
28184
+ const name = node.findFirstExpression(Expressions.DefinitionName);
28184
28185
  const dd = node.findFirstExpression(Expressions.DataDefinition);
28185
28186
  if (dd) {
28186
28187
  const id = new data_definition_1.DataDefinition().runSyntax(dd, scope, filename);
28187
28188
  if ((id === null || id === void 0 ? void 0 : id.getType().isGeneric()) === true
28188
28189
  && (id === null || id === void 0 ? void 0 : id.getType().containsVoid()) === false) {
28189
- throw new Error("DATA definition cannot be generic");
28190
+ throw new Error("DATA definition cannot be generic, " + name);
28190
28191
  }
28191
28192
  return id;
28192
28193
  }
28193
- const name = node.findFirstExpression(Expressions.DefinitionName);
28194
28194
  if (name) {
28195
28195
  return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new unknown_type_1.UnknownType("data, fallback"));
28196
28196
  }
@@ -47353,42 +47353,45 @@ class TableType extends _abstract_object_1.AbstractObject {
47353
47353
  this.parsedXML = undefined;
47354
47354
  super.setDirty();
47355
47355
  }
47356
- buildTableOptions() {
47357
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
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
- };
47356
+ buildPrimaryKey() {
47357
+ var _a, _b, _c, _d, _e;
47358
+ const primaryKey = {
47359
+ isUnique: ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.keykind) === "U",
47360
+ type: basic_1.TableAccessType.standard,
47361
+ keyFields: [],
47362
+ name: "primary_key",
47363
+ };
47364
+ if (((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.accessmode) === "S") {
47365
+ primaryKey.type = basic_1.TableAccessType.sorted;
47366
47366
  }
47367
47367
  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
- };
47368
+ primaryKey.type = basic_1.TableAccessType.hashed;
47374
47369
  }
47375
- for (const f of ((_e = this.parsedXML) === null || _e === void 0 ? void 0 : _e.dd42v) || []) {
47370
+ for (const f of ((_d = this.parsedXML) === null || _d === void 0 ? void 0 : _d.dd42v) || []) {
47376
47371
  if (f.keyname === "") {
47377
- primaryKey === null || primaryKey === void 0 ? void 0 : primaryKey.keyFields.push(f.keyfield);
47372
+ primaryKey.keyFields.push(f.keyfield);
47378
47373
  }
47379
47374
  }
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");
47375
+ if (((_e = this.parsedXML) === null || _e === void 0 ? void 0 : _e.keydef) === "T" && primaryKey.keyFields.length === 0) {
47376
+ primaryKey.keyFields.push("table_line");
47377
+ }
47378
+ return primaryKey;
47379
+ }
47380
+ buildTableOptions() {
47381
+ var _a, _b, _c, _d;
47382
+ let keyType = Types.TableKeyType.user;
47383
+ if (((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.keydef) === "D") {
47384
+ keyType = Types.TableKeyType.default;
47382
47385
  }
47383
47386
  const tableOptions = {
47384
47387
  withHeader: false,
47385
- keyType: Types.TableKeyType.user,
47386
- primaryKey: primaryKey,
47388
+ keyType: keyType,
47389
+ primaryKey: this.buildPrimaryKey(),
47387
47390
  secondary: [],
47388
47391
  };
47389
- for (const k of ((_g = this.parsedXML) === null || _g === void 0 ? void 0 : _g.dd43v) || []) {
47392
+ for (const k of ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.dd43v) || []) {
47390
47393
  const fields = [];
47391
- for (const f of ((_h = this.parsedXML) === null || _h === void 0 ? void 0 : _h.dd42v) || []) {
47394
+ for (const f of ((_c = this.parsedXML) === null || _c === void 0 ? void 0 : _c.dd42v) || []) {
47392
47395
  if (f.keyname === k.keyname) {
47393
47396
  fields.push(f.keyfield);
47394
47397
  }
@@ -47404,7 +47407,7 @@ class TableType extends _abstract_object_1.AbstractObject {
47404
47407
  default:
47405
47408
  break;
47406
47409
  }
47407
- (_j = tableOptions.secondary) === null || _j === void 0 ? void 0 : _j.push({
47410
+ (_d = tableOptions.secondary) === null || _d === void 0 ? void 0 : _d.push({
47408
47411
  name: k.keyname,
47409
47412
  type: accessType,
47410
47413
  keyFields: fields,
@@ -48535,7 +48538,7 @@ class Registry {
48535
48538
  }
48536
48539
  static abaplintVersion() {
48537
48540
  // magic, see build script "version.sh"
48538
- return "2.102.5";
48541
+ return "2.102.7";
48539
48542
  }
48540
48543
  getDDICReferences() {
48541
48544
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.102.5",
3
+ "version": "2.102.7",
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.102.5",
41
+ "@abaplint/core": "^2.102.7",
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",