@abaplint/cli 2.102.3 → 2.102.5

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 +59 -11
  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;
@@ -21732,6 +21739,13 @@ class TypeUtils {
21732
21739
  return false;
21733
21740
  }
21734
21741
  }
21742
+ else if (source instanceof basic_1.ObjectReferenceType) {
21743
+ if (target instanceof basic_1.XSequenceType
21744
+ || target instanceof basic_1.IntegerType
21745
+ || target instanceof basic_1.XStringType) {
21746
+ return false;
21747
+ }
21748
+ }
21735
21749
  else if (source instanceof basic_1.XStringType) {
21736
21750
  if (target instanceof basic_1.CLikeType
21737
21751
  || target instanceof basic_1.IntegerType
@@ -24645,6 +24659,7 @@ class MethodCallParam {
24645
24659
  sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);
24646
24660
  }
24647
24661
  const calculated = child.findFirstExpression(Expressions.MethodCallChain) !== undefined
24662
+ || child.findFirstExpression(Expressions.StringTemplate) !== undefined
24648
24663
  || child.findFirstExpression(Expressions.ArithOperator) !== undefined;
24649
24664
  if (sourceType === undefined) {
24650
24665
  throw new Error("No source type determined, method source");
@@ -24903,6 +24918,7 @@ class MethodParameters {
24903
24918
  for (const item of items) {
24904
24919
  const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);
24905
24920
  const calculated = item.source.findFirstExpression(Expressions.MethodCallChain) !== undefined
24921
+ || item.source.findFirstExpression(Expressions.StringTemplate) !== undefined
24906
24922
  || item.source.findFirstExpression(Expressions.ArithOperator) !== undefined;
24907
24923
  if (parameter === undefined) {
24908
24924
  throw new Error("Method importing parameter \"" + item.name + "\" does not exist");
@@ -26065,9 +26081,10 @@ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/
26065
26081
  class StringTemplate {
26066
26082
  runSyntax(node, scope, filename) {
26067
26083
  const typeUtils = new _type_utils_1.TypeUtils(scope);
26084
+ const ret = basic_1.StringType.get();
26068
26085
  for (const templateSource of node.findAllExpressions(Expressions.StringTemplateSource)) {
26069
26086
  const s = templateSource.findDirectExpression(Expressions.Source);
26070
- const type = new source_1.Source().runSyntax(s, scope, filename, basic_1.StringType.get());
26087
+ const type = new source_1.Source().runSyntax(s, scope, filename, ret);
26071
26088
  if (type === undefined) {
26072
26089
  throw new Error("No target type determined");
26073
26090
  }
@@ -26091,7 +26108,7 @@ class StringTemplate {
26091
26108
  throw new Error("Cannot apply ALPHA to this type");
26092
26109
  }
26093
26110
  }
26094
- return basic_1.StringType.get();
26111
+ return ret;
26095
26112
  }
26096
26113
  }
26097
26114
  exports.StringTemplate = StringTemplate;
@@ -34736,10 +34753,10 @@ class FloatingPointType extends _abstract_type_1.AbstractType {
34736
34753
  return this.length;
34737
34754
  }
34738
34755
  toText() {
34739
- return "```n LENGTH " + this.getLength() + "```";
34756
+ return "```f LENGTH " + this.getLength() + "```";
34740
34757
  }
34741
34758
  toABAP() {
34742
- return "n LENGTH " + this.getLength();
34759
+ return "f LENGTH " + this.getLength();
34743
34760
  }
34744
34761
  isGeneric() {
34745
34762
  return false;
@@ -47328,23 +47345,50 @@ class TableType extends _abstract_object_1.AbstractObject {
47328
47345
  };
47329
47346
  }
47330
47347
  getDescription() {
47331
- // todo
47332
- return undefined;
47348
+ var _a;
47349
+ this.parseXML();
47350
+ return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.ddtext;
47333
47351
  }
47334
47352
  setDirty() {
47335
47353
  this.parsedXML = undefined;
47336
47354
  super.setDirty();
47337
47355
  }
47338
47356
  buildTableOptions() {
47339
- var _a, _b, _c;
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
+ };
47366
+ }
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
+ };
47374
+ }
47375
+ for (const f of ((_e = this.parsedXML) === null || _e === void 0 ? void 0 : _e.dd42v) || []) {
47376
+ if (f.keyname === "") {
47377
+ primaryKey === null || primaryKey === void 0 ? void 0 : primaryKey.keyFields.push(f.keyfield);
47378
+ }
47379
+ }
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");
47382
+ }
47340
47383
  const tableOptions = {
47341
47384
  withHeader: false,
47342
47385
  keyType: Types.TableKeyType.user,
47386
+ primaryKey: primaryKey,
47343
47387
  secondary: [],
47344
47388
  };
47345
- for (const k of ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.dd43v) || []) {
47389
+ for (const k of ((_g = this.parsedXML) === null || _g === void 0 ? void 0 : _g.dd43v) || []) {
47346
47390
  const fields = [];
47347
- for (const f of ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.dd42v) || []) {
47391
+ for (const f of ((_h = this.parsedXML) === null || _h === void 0 ? void 0 : _h.dd42v) || []) {
47348
47392
  if (f.keyname === k.keyname) {
47349
47393
  fields.push(f.keyfield);
47350
47394
  }
@@ -47360,7 +47404,7 @@ class TableType extends _abstract_object_1.AbstractObject {
47360
47404
  default:
47361
47405
  break;
47362
47406
  }
47363
- (_c = tableOptions.secondary) === null || _c === void 0 ? void 0 : _c.push({
47407
+ (_j = tableOptions.secondary) === null || _j === void 0 ? void 0 : _j.push({
47364
47408
  name: k.keyname,
47365
47409
  type: accessType,
47366
47410
  keyFields: fields,
@@ -47448,6 +47492,10 @@ class TableType extends _abstract_object_1.AbstractObject {
47448
47492
  this.parsedXML.datatype = dd40v.DATATYPE;
47449
47493
  this.parsedXML.leng = dd40v.LENG;
47450
47494
  this.parsedXML.decimals = dd40v.DECIMALS;
47495
+ this.parsedXML.accessmode = dd40v.ACCESSMODE;
47496
+ this.parsedXML.keykind = dd40v.KEYKIND;
47497
+ this.parsedXML.ddtext = dd40v.DDTEXT;
47498
+ this.parsedXML.keydef = dd40v.KEYDEF;
47451
47499
  for (const x of (0, xml_utils_1.xmlToArray)((_a = values.DD42V) === null || _a === void 0 ? void 0 : _a.DD42V)) {
47452
47500
  this.parsedXML.dd42v.push({
47453
47501
  keyname: x.SECKEYNAME || "",
@@ -48487,7 +48535,7 @@ class Registry {
48487
48535
  }
48488
48536
  static abaplintVersion() {
48489
48537
  // magic, see build script "version.sh"
48490
- return "2.102.3";
48538
+ return "2.102.5";
48491
48539
  }
48492
48540
  getDDICReferences() {
48493
48541
  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.5",
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.5",
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",