@abaplint/transpiler-cli 2.7.46 → 2.7.47

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/bundle.js +51 -9
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -20703,7 +20703,11 @@ class TypeUtils {
20703
20703
  /*
20704
20704
  console.dir(source);
20705
20705
  console.dir(target);
20706
+ console.dir(calculated);
20706
20707
  */
20708
+ if (calculated && source instanceof basic_1.StringType && target instanceof basic_1.XStringType) {
20709
+ return false;
20710
+ }
20707
20711
  if (calculated) {
20708
20712
  return this.isAssignable(source, target);
20709
20713
  }
@@ -20754,6 +20758,9 @@ class TypeUtils {
20754
20758
  }
20755
20759
  return false;
20756
20760
  }
20761
+ else if (target instanceof cgeneric_type_1.CGenericType) {
20762
+ return false;
20763
+ }
20757
20764
  else if (target instanceof basic_1.XSequenceType || target instanceof basic_1.XStringType) {
20758
20765
  if (((_g = source.getAbstractTypeData()) === null || _g === void 0 ? void 0 : _g.derivedFromConstant) === true) {
20759
20766
  return true;
@@ -23698,6 +23705,7 @@ class MethodCallParam {
23698
23705
  sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);
23699
23706
  }
23700
23707
  const calculated = child.findFirstExpression(Expressions.MethodCallChain) !== undefined
23708
+ || child.findFirstExpression(Expressions.StringTemplate) !== undefined
23701
23709
  || child.findFirstExpression(Expressions.ArithOperator) !== undefined;
23702
23710
  if (sourceType === undefined) {
23703
23711
  throw new Error("No source type determined, method source");
@@ -23956,6 +23964,7 @@ class MethodParameters {
23956
23964
  for (const item of items) {
23957
23965
  const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);
23958
23966
  const calculated = item.source.findFirstExpression(Expressions.MethodCallChain) !== undefined
23967
+ || item.source.findFirstExpression(Expressions.StringTemplate) !== undefined
23959
23968
  || item.source.findFirstExpression(Expressions.ArithOperator) !== undefined;
23960
23969
  if (parameter === undefined) {
23961
23970
  throw new Error("Method importing parameter \"" + item.name + "\" does not exist");
@@ -25118,9 +25127,10 @@ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/
25118
25127
  class StringTemplate {
25119
25128
  runSyntax(node, scope, filename) {
25120
25129
  const typeUtils = new _type_utils_1.TypeUtils(scope);
25130
+ const ret = basic_1.StringType.get();
25121
25131
  for (const templateSource of node.findAllExpressions(Expressions.StringTemplateSource)) {
25122
25132
  const s = templateSource.findDirectExpression(Expressions.Source);
25123
- const type = new source_1.Source().runSyntax(s, scope, filename, basic_1.StringType.get());
25133
+ const type = new source_1.Source().runSyntax(s, scope, filename, ret);
25124
25134
  if (type === undefined) {
25125
25135
  throw new Error("No target type determined");
25126
25136
  }
@@ -25144,7 +25154,7 @@ class StringTemplate {
25144
25154
  throw new Error("Cannot apply ALPHA to this type");
25145
25155
  }
25146
25156
  }
25147
- return basic_1.StringType.get();
25157
+ return ret;
25148
25158
  }
25149
25159
  }
25150
25160
  exports.StringTemplate = StringTemplate;
@@ -46381,23 +46391,52 @@ class TableType extends _abstract_object_1.AbstractObject {
46381
46391
  };
46382
46392
  }
46383
46393
  getDescription() {
46384
- // todo
46385
- return undefined;
46394
+ var _a;
46395
+ this.parseXML();
46396
+ return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.ddtext;
46386
46397
  }
46387
46398
  setDirty() {
46388
46399
  this.parsedXML = undefined;
46389
46400
  super.setDirty();
46390
46401
  }
46391
46402
  buildTableOptions() {
46392
- var _a, _b, _c;
46403
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
46404
+ let primaryKey = undefined;
46405
+ if (((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.accessmode) === "S") {
46406
+ primaryKey = {
46407
+ isUnique: ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.keykind) === "U",
46408
+ type: basic_1.TableAccessType.sorted,
46409
+ keyFields: [],
46410
+ name: "primary_key",
46411
+ };
46412
+ for (const f of ((_c = this.parsedXML) === null || _c === void 0 ? void 0 : _c.dd42v) || []) {
46413
+ if (f.keyname === "") {
46414
+ primaryKey.keyFields.push(f.keyfield);
46415
+ }
46416
+ }
46417
+ }
46418
+ else if (((_d = this.parsedXML) === null || _d === void 0 ? void 0 : _d.accessmode) === "H") {
46419
+ primaryKey = {
46420
+ isUnique: ((_e = this.parsedXML) === null || _e === void 0 ? void 0 : _e.keykind) === "U",
46421
+ type: basic_1.TableAccessType.hashed,
46422
+ keyFields: [],
46423
+ name: "primary_key",
46424
+ };
46425
+ for (const f of ((_f = this.parsedXML) === null || _f === void 0 ? void 0 : _f.dd42v) || []) {
46426
+ if (f.keyname === "") {
46427
+ primaryKey.keyFields.push(f.keyfield);
46428
+ }
46429
+ }
46430
+ }
46393
46431
  const tableOptions = {
46394
46432
  withHeader: false,
46395
46433
  keyType: Types.TableKeyType.user,
46434
+ primaryKey: primaryKey,
46396
46435
  secondary: [],
46397
46436
  };
46398
- for (const k of ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.dd43v) || []) {
46437
+ for (const k of ((_g = this.parsedXML) === null || _g === void 0 ? void 0 : _g.dd43v) || []) {
46399
46438
  const fields = [];
46400
- for (const f of ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.dd42v) || []) {
46439
+ for (const f of ((_h = this.parsedXML) === null || _h === void 0 ? void 0 : _h.dd42v) || []) {
46401
46440
  if (f.keyname === k.keyname) {
46402
46441
  fields.push(f.keyfield);
46403
46442
  }
@@ -46413,7 +46452,7 @@ class TableType extends _abstract_object_1.AbstractObject {
46413
46452
  default:
46414
46453
  break;
46415
46454
  }
46416
- (_c = tableOptions.secondary) === null || _c === void 0 ? void 0 : _c.push({
46455
+ (_j = tableOptions.secondary) === null || _j === void 0 ? void 0 : _j.push({
46417
46456
  name: k.keyname,
46418
46457
  type: accessType,
46419
46458
  keyFields: fields,
@@ -46501,6 +46540,9 @@ class TableType extends _abstract_object_1.AbstractObject {
46501
46540
  this.parsedXML.datatype = dd40v.DATATYPE;
46502
46541
  this.parsedXML.leng = dd40v.LENG;
46503
46542
  this.parsedXML.decimals = dd40v.DECIMALS;
46543
+ this.parsedXML.accessmode = dd40v.ACCESSMODE;
46544
+ this.parsedXML.keykind = dd40v.KEYKIND;
46545
+ this.parsedXML.ddtext = dd40v.DDTEXT;
46504
46546
  for (const x of (0, xml_utils_1.xmlToArray)((_a = values.DD42V) === null || _a === void 0 ? void 0 : _a.DD42V)) {
46505
46547
  this.parsedXML.dd42v.push({
46506
46548
  keyname: x.SECKEYNAME || "",
@@ -47540,7 +47582,7 @@ class Registry {
47540
47582
  }
47541
47583
  static abaplintVersion() {
47542
47584
  // magic, see build script "version.sh"
47543
- return "2.102.3";
47585
+ return "2.102.4";
47544
47586
  }
47545
47587
  getDDICReferences() {
47546
47588
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.7.46",
3
+ "version": "2.7.47",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -26,12 +26,12 @@
26
26
  "author": "abaplint",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@abaplint/transpiler": "^2.7.46",
29
+ "@abaplint/transpiler": "^2.7.47",
30
30
  "@types/glob": "^7.2.0",
31
31
  "glob": "=7.2.0",
32
32
  "@types/progress": "^2.0.5",
33
33
  "@types/node": "^20.4.4",
34
- "@abaplint/core": "^2.102.3",
34
+ "@abaplint/core": "^2.102.4",
35
35
  "progress": "^2.0.3",
36
36
  "webpack": "^5.88.2",
37
37
  "webpack-cli": "^5.1.4",