@abaplint/transpiler-cli 2.6.16 → 2.6.17

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 +58 -18
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -20454,16 +20454,24 @@ class TypeUtils {
20454
20454
  return false;
20455
20455
  }
20456
20456
  isAssignableStrict(source, target) {
20457
- var _a;
20457
+ var _a, _b;
20458
20458
  /*
20459
20459
  console.dir(source);
20460
20460
  console.dir(target);
20461
20461
  */
20462
- if (source instanceof basic_1.CharacterType && target instanceof basic_1.CharacterType) {
20463
- if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {
20464
- return source.getLength() <= target.getLength();
20462
+ if (source instanceof basic_1.CharacterType) {
20463
+ if (target instanceof basic_1.CharacterType) {
20464
+ if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {
20465
+ return source.getLength() <= target.getLength();
20466
+ }
20467
+ return source.getLength() === target.getLength();
20468
+ }
20469
+ else if (target instanceof basic_1.IntegerType) {
20470
+ if (((_b = source.getAbstractTypeData()) === null || _b === void 0 ? void 0 : _b.derivedFromConstant) === true) {
20471
+ return true;
20472
+ }
20473
+ return false;
20465
20474
  }
20466
- return source.getLength() === target.getLength();
20467
20475
  }
20468
20476
  else if (source instanceof basic_1.StringType && target instanceof basic_1.StructureType) {
20469
20477
  if (this.structureContainsString(target)) {
@@ -20471,6 +20479,19 @@ class TypeUtils {
20471
20479
  }
20472
20480
  return true;
20473
20481
  }
20482
+ else if (source instanceof basic_1.StructureType && target instanceof basic_1.StructureType) {
20483
+ const sourceComponents = source.getComponents();
20484
+ const targetComponents = target.getComponents();
20485
+ if (sourceComponents.length !== targetComponents.length) {
20486
+ return false;
20487
+ }
20488
+ for (let i = 0; i < sourceComponents.length; i++) {
20489
+ if (this.isAssignableStrict(sourceComponents[i].type, targetComponents[i].type) === false) {
20490
+ return false;
20491
+ }
20492
+ }
20493
+ return true;
20494
+ }
20474
20495
  return this.isAssignable(source, target);
20475
20496
  }
20476
20497
  isAssignable(source, target) {
@@ -20488,7 +20509,31 @@ class TypeUtils {
20488
20509
  return true;
20489
20510
  }
20490
20511
  else if (source instanceof basic_1.TableType) {
20491
- return this.isAssignableStrict(source.getRowType(), target.getRowType());
20512
+ const targetRowType = target.getRowType();
20513
+ const sourceRowType = source.getRowType();
20514
+ if (targetRowType instanceof basic_1.VoidType || targetRowType instanceof basic_1.AnyType || targetRowType instanceof basic_1.UnknownType) {
20515
+ return true;
20516
+ }
20517
+ else if (sourceRowType instanceof basic_1.VoidType || sourceRowType instanceof basic_1.AnyType || sourceRowType instanceof basic_1.UnknownType) {
20518
+ return true;
20519
+ }
20520
+ if (targetRowType instanceof basic_1.StructureType && this.structureContainsString(targetRowType)) {
20521
+ if (!(sourceRowType instanceof basic_1.StructureType)) {
20522
+ return false;
20523
+ }
20524
+ else if (!(this.structureContainsString(sourceRowType))) {
20525
+ return false;
20526
+ }
20527
+ }
20528
+ if (sourceRowType instanceof basic_1.StructureType && this.structureContainsString(sourceRowType)) {
20529
+ if (!(targetRowType instanceof basic_1.StructureType)) {
20530
+ return false;
20531
+ }
20532
+ else if (!(this.structureContainsString(targetRowType))) {
20533
+ return false;
20534
+ }
20535
+ }
20536
+ return true;
20492
20537
  }
20493
20538
  return false;
20494
20539
  }
@@ -46313,7 +46358,7 @@ class Registry {
46313
46358
  }
46314
46359
  static abaplintVersion() {
46315
46360
  // magic, see build script "version.sh"
46316
- return "2.97.10";
46361
+ return "2.97.12";
46317
46362
  }
46318
46363
  getDDICReferences() {
46319
46364
  return this.references;
@@ -67121,7 +67166,7 @@ class Chunk {
67121
67166
  const lines = this.raw.split("\n");
67122
67167
  const lineCount = lines.length;
67123
67168
  const lastLine = lines[lines.length - 1];
67124
- append.mappings.forEach(m => {
67169
+ for (const m of append.mappings) {
67125
67170
  // original stays the same, but adjust the generated positions
67126
67171
  const add = m;
67127
67172
  if (add.generated.line === 1 && this.raw.endsWith("\n") === false) {
@@ -67131,7 +67176,7 @@ class Chunk {
67131
67176
  add.generated.line += lineCount - 1;
67132
67177
  }
67133
67178
  this.mappings.push(add);
67134
- });
67179
+ }
67135
67180
  this.raw += append.getCode();
67136
67181
  return this;
67137
67182
  }
@@ -77947,7 +77992,7 @@ class Traversal {
77947
77992
  }
77948
77993
  const name = def.getName();
77949
77994
  if (def.isGlobal() === false) {
77950
- const prefix = this.buildPrefix(def);
77995
+ const prefix = this.buildPrefix();
77951
77996
  return `abap.Classes['${prefix}-${name.toUpperCase()}'] = ${Traversal.escapeNamespace(name.toLowerCase())};`;
77952
77997
  }
77953
77998
  else {
@@ -77993,7 +78038,7 @@ class Traversal {
77993
78038
  }
77994
78039
  if (def) {
77995
78040
  if (def.isGlobal() === false) {
77996
- const prefix = this.buildPrefix(def);
78041
+ const prefix = this.buildPrefix();
77997
78042
  return `abap.Classes['${prefix}-${(_a = def === null || def === void 0 ? void 0 : def.getName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()}']`;
77998
78043
  }
77999
78044
  else {
@@ -78005,13 +78050,8 @@ class Traversal {
78005
78050
  return "abap.Classes['" + name.toUpperCase() + "']";
78006
78051
  }
78007
78052
  }
78008
- buildPrefix(def) {
78009
- const file = this.reg.getFileByName(def.getFilename());
78010
- if (file === undefined) {
78011
- return "NOT_FOUND";
78012
- }
78013
- const obj = this.reg.findObjectForFile(file);
78014
- return (obj === null || obj === void 0 ? void 0 : obj.getType()) + "-" + (obj === null || obj === void 0 ? void 0 : obj.getName());
78053
+ buildPrefix() {
78054
+ return this.obj.getType() + "-" + this.obj.getName();
78015
78055
  }
78016
78056
  ////////////////////////////
78017
78057
  traverseStructure(node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.6.16",
3
+ "version": "2.6.17",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,12 +25,12 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.6.16",
28
+ "@abaplint/transpiler": "^2.6.17",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",
32
32
  "@types/node": "^18.15.11",
33
- "@abaplint/core": "^2.97.10",
33
+ "@abaplint/core": "^2.97.12",
34
34
  "progress": "^2.0.3",
35
35
  "webpack": "^5.79.0",
36
36
  "webpack-cli": "^5.0.1",