@abaplint/cli 2.102.3 → 2.102.4

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 +51 -9
  2. package/package.json +3 -3
package/build/cli.js CHANGED
@@ -21650,7 +21650,11 @@ class TypeUtils {
21650
21650
  /*
21651
21651
  console.dir(source);
21652
21652
  console.dir(target);
21653
+ console.dir(calculated);
21653
21654
  */
21655
+ if (calculated && source instanceof basic_1.StringType && target instanceof basic_1.XStringType) {
21656
+ return false;
21657
+ }
21654
21658
  if (calculated) {
21655
21659
  return this.isAssignable(source, target);
21656
21660
  }
@@ -21701,6 +21705,9 @@ class TypeUtils {
21701
21705
  }
21702
21706
  return false;
21703
21707
  }
21708
+ else if (target instanceof cgeneric_type_1.CGenericType) {
21709
+ return false;
21710
+ }
21704
21711
  else if (target instanceof basic_1.XSequenceType || target instanceof basic_1.XStringType) {
21705
21712
  if (((_g = source.getAbstractTypeData()) === null || _g === void 0 ? void 0 : _g.derivedFromConstant) === true) {
21706
21713
  return true;
@@ -24645,6 +24652,7 @@ class MethodCallParam {
24645
24652
  sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);
24646
24653
  }
24647
24654
  const calculated = child.findFirstExpression(Expressions.MethodCallChain) !== undefined
24655
+ || child.findFirstExpression(Expressions.StringTemplate) !== undefined
24648
24656
  || child.findFirstExpression(Expressions.ArithOperator) !== undefined;
24649
24657
  if (sourceType === undefined) {
24650
24658
  throw new Error("No source type determined, method source");
@@ -24903,6 +24911,7 @@ class MethodParameters {
24903
24911
  for (const item of items) {
24904
24912
  const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);
24905
24913
  const calculated = item.source.findFirstExpression(Expressions.MethodCallChain) !== undefined
24914
+ || item.source.findFirstExpression(Expressions.StringTemplate) !== undefined
24906
24915
  || item.source.findFirstExpression(Expressions.ArithOperator) !== undefined;
24907
24916
  if (parameter === undefined) {
24908
24917
  throw new Error("Method importing parameter \"" + item.name + "\" does not exist");
@@ -26065,9 +26074,10 @@ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/
26065
26074
  class StringTemplate {
26066
26075
  runSyntax(node, scope, filename) {
26067
26076
  const typeUtils = new _type_utils_1.TypeUtils(scope);
26077
+ const ret = basic_1.StringType.get();
26068
26078
  for (const templateSource of node.findAllExpressions(Expressions.StringTemplateSource)) {
26069
26079
  const s = templateSource.findDirectExpression(Expressions.Source);
26070
- const type = new source_1.Source().runSyntax(s, scope, filename, basic_1.StringType.get());
26080
+ const type = new source_1.Source().runSyntax(s, scope, filename, ret);
26071
26081
  if (type === undefined) {
26072
26082
  throw new Error("No target type determined");
26073
26083
  }
@@ -26091,7 +26101,7 @@ class StringTemplate {
26091
26101
  throw new Error("Cannot apply ALPHA to this type");
26092
26102
  }
26093
26103
  }
26094
- return basic_1.StringType.get();
26104
+ return ret;
26095
26105
  }
26096
26106
  }
26097
26107
  exports.StringTemplate = StringTemplate;
@@ -47328,23 +47338,52 @@ class TableType extends _abstract_object_1.AbstractObject {
47328
47338
  };
47329
47339
  }
47330
47340
  getDescription() {
47331
- // todo
47332
- return undefined;
47341
+ var _a;
47342
+ this.parseXML();
47343
+ return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.ddtext;
47333
47344
  }
47334
47345
  setDirty() {
47335
47346
  this.parsedXML = undefined;
47336
47347
  super.setDirty();
47337
47348
  }
47338
47349
  buildTableOptions() {
47339
- var _a, _b, _c;
47350
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
47351
+ let primaryKey = undefined;
47352
+ if (((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.accessmode) === "S") {
47353
+ primaryKey = {
47354
+ isUnique: ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.keykind) === "U",
47355
+ type: basic_1.TableAccessType.sorted,
47356
+ keyFields: [],
47357
+ name: "primary_key",
47358
+ };
47359
+ for (const f of ((_c = this.parsedXML) === null || _c === void 0 ? void 0 : _c.dd42v) || []) {
47360
+ if (f.keyname === "") {
47361
+ primaryKey.keyFields.push(f.keyfield);
47362
+ }
47363
+ }
47364
+ }
47365
+ else if (((_d = this.parsedXML) === null || _d === void 0 ? void 0 : _d.accessmode) === "H") {
47366
+ primaryKey = {
47367
+ isUnique: ((_e = this.parsedXML) === null || _e === void 0 ? void 0 : _e.keykind) === "U",
47368
+ type: basic_1.TableAccessType.hashed,
47369
+ keyFields: [],
47370
+ name: "primary_key",
47371
+ };
47372
+ for (const f of ((_f = this.parsedXML) === null || _f === void 0 ? void 0 : _f.dd42v) || []) {
47373
+ if (f.keyname === "") {
47374
+ primaryKey.keyFields.push(f.keyfield);
47375
+ }
47376
+ }
47377
+ }
47340
47378
  const tableOptions = {
47341
47379
  withHeader: false,
47342
47380
  keyType: Types.TableKeyType.user,
47381
+ primaryKey: primaryKey,
47343
47382
  secondary: [],
47344
47383
  };
47345
- for (const k of ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.dd43v) || []) {
47384
+ for (const k of ((_g = this.parsedXML) === null || _g === void 0 ? void 0 : _g.dd43v) || []) {
47346
47385
  const fields = [];
47347
- for (const f of ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.dd42v) || []) {
47386
+ for (const f of ((_h = this.parsedXML) === null || _h === void 0 ? void 0 : _h.dd42v) || []) {
47348
47387
  if (f.keyname === k.keyname) {
47349
47388
  fields.push(f.keyfield);
47350
47389
  }
@@ -47360,7 +47399,7 @@ class TableType extends _abstract_object_1.AbstractObject {
47360
47399
  default:
47361
47400
  break;
47362
47401
  }
47363
- (_c = tableOptions.secondary) === null || _c === void 0 ? void 0 : _c.push({
47402
+ (_j = tableOptions.secondary) === null || _j === void 0 ? void 0 : _j.push({
47364
47403
  name: k.keyname,
47365
47404
  type: accessType,
47366
47405
  keyFields: fields,
@@ -47448,6 +47487,9 @@ class TableType extends _abstract_object_1.AbstractObject {
47448
47487
  this.parsedXML.datatype = dd40v.DATATYPE;
47449
47488
  this.parsedXML.leng = dd40v.LENG;
47450
47489
  this.parsedXML.decimals = dd40v.DECIMALS;
47490
+ this.parsedXML.accessmode = dd40v.ACCESSMODE;
47491
+ this.parsedXML.keykind = dd40v.KEYKIND;
47492
+ this.parsedXML.ddtext = dd40v.DDTEXT;
47451
47493
  for (const x of (0, xml_utils_1.xmlToArray)((_a = values.DD42V) === null || _a === void 0 ? void 0 : _a.DD42V)) {
47452
47494
  this.parsedXML.dd42v.push({
47453
47495
  keyname: x.SECKEYNAME || "",
@@ -48487,7 +48529,7 @@ class Registry {
48487
48529
  }
48488
48530
  static abaplintVersion() {
48489
48531
  // magic, see build script "version.sh"
48490
- return "2.102.3";
48532
+ return "2.102.4";
48491
48533
  }
48492
48534
  getDDICReferences() {
48493
48535
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.102.3",
3
+ "version": "2.102.4",
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.3",
41
+ "@abaplint/core": "^2.102.4",
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.2",
46
+ "@types/node": "^20.4.4",
47
47
  "@types/progress": "^2.0.5",
48
48
  "chai": "^4.3.7",
49
49
  "chalk": "^5.3.0",