@abaplint/transpiler-cli 2.3.127 → 2.4.1

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 +80 -1
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -45829,7 +45829,7 @@ class Registry {
45829
45829
  }
45830
45830
  static abaplintVersion() {
45831
45831
  // magic, see build script "version.sh"
45832
- return "2.95.8";
45832
+ return "2.95.9";
45833
45833
  }
45834
45834
  getDDICReferences() {
45835
45835
  return this.references;
@@ -65326,6 +65326,9 @@ class XMLConsistency {
65326
65326
  if (name === undefined) {
65327
65327
  issues.push(issue_1.Issue.atRow(file, 1, "Name undefined in XML", this.getMetadata().key, this.conf.severity));
65328
65328
  }
65329
+ else if (obj.getDescription() && obj.getDescription().length > 60) {
65330
+ issues.push(issue_1.Issue.atRow(file, 1, "Description too long", this.getMetadata().key, this.conf.severity));
65331
+ }
65329
65332
  else if (name !== obj.getName().toUpperCase()) {
65330
65333
  issues.push(issue_1.Issue.atRow(file, 1, "Name in XML does not match object", this.getMetadata().key, this.conf.severity));
65331
65334
  }
@@ -65338,6 +65341,9 @@ class XMLConsistency {
65338
65341
  if (name === undefined) {
65339
65342
  issues.push(issue_1.Issue.atRow(file, 1, "Name undefined in XML", this.getMetadata().key, this.conf.severity));
65340
65343
  }
65344
+ else if (obj.getDescription() && obj.getDescription().length > 60) {
65345
+ issues.push(issue_1.Issue.atRow(file, 1, "Description too long", this.getMetadata().key, this.conf.severity));
65346
+ }
65341
65347
  else if (name !== obj.getName().toUpperCase()) {
65342
65348
  issues.push(issue_1.Issue.atRow(file, 1, "Name in XML does not match object", this.getMetadata().key, this.conf.severity));
65343
65349
  }
@@ -69286,6 +69292,55 @@ exports.HandleTableType = HandleTableType;
69286
69292
 
69287
69293
  /***/ }),
69288
69294
 
69295
+ /***/ "./node_modules/@abaplint/transpiler/build/src/handlers/handle_type_pool.js":
69296
+ /*!**********************************************************************************!*\
69297
+ !*** ./node_modules/@abaplint/transpiler/build/src/handlers/handle_type_pool.js ***!
69298
+ \**********************************************************************************/
69299
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
69300
+
69301
+ "use strict";
69302
+
69303
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
69304
+ exports.HandleTypePool = void 0;
69305
+ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
69306
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
69307
+ const transpile_types_1 = __webpack_require__(/*! ../transpile_types */ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js");
69308
+ const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
69309
+ class HandleTypePool {
69310
+ runObject(obj, reg) {
69311
+ var _a;
69312
+ const spaghetti = (_a = new abaplint.SyntaxLogic(reg, obj).run().spaghetti.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getFirstChild();
69313
+ const chunk = new chunk_1.Chunk();
69314
+ chunk.appendString(`const pool = {};\n`);
69315
+ for (const v in spaghetti === null || spaghetti === void 0 ? void 0 : spaghetti.getData().vars) {
69316
+ const abs = spaghetti.getData().vars[v];
69317
+ const name = `pool['${v.toLowerCase()}']`;
69318
+ chunk.appendString(`${name} = ${new transpile_types_1.TranspileTypes().toType(abs.getType())};\n`);
69319
+ chunk.appendString(traversal_1.Traversal.setValues(abs, name));
69320
+ }
69321
+ for (const t in spaghetti === null || spaghetti === void 0 ? void 0 : spaghetti.getData().types) {
69322
+ const abs = spaghetti.getData().types[t];
69323
+ chunk.appendString(`pool['${t.toLowerCase()}'] = ${new transpile_types_1.TranspileTypes().toType(abs.getType())};\n`);
69324
+ }
69325
+ chunk.appendString(`abap.TypePools['${obj.getName()}'] = pool;`);
69326
+ const output = {
69327
+ object: {
69328
+ name: obj.getName(),
69329
+ type: obj.getType(),
69330
+ },
69331
+ filename: obj.getName().toLowerCase() + "." + obj.getType().toLowerCase() + ".mjs",
69332
+ chunk: chunk,
69333
+ requires: [],
69334
+ exports: [],
69335
+ };
69336
+ return [output];
69337
+ }
69338
+ }
69339
+ exports.HandleTypePool = HandleTypePool;
69340
+ //# sourceMappingURL=handle_type_pool.js.map
69341
+
69342
+ /***/ }),
69343
+
69289
69344
  /***/ "./node_modules/@abaplint/transpiler/build/src/handlers/handle_view.js":
69290
69345
  /*!*****************************************************************************!*\
69291
69346
  !*** ./node_modules/@abaplint/transpiler/build/src/handlers/handle_view.js ***!
@@ -69352,6 +69407,7 @@ const handle_data_element_1 = __webpack_require__(/*! ./handlers/handle_data_ele
69352
69407
  const handle_table_type_1 = __webpack_require__(/*! ./handlers/handle_table_type */ "./node_modules/@abaplint/transpiler/build/src/handlers/handle_table_type.js");
69353
69408
  const handle_view_1 = __webpack_require__(/*! ./handlers/handle_view */ "./node_modules/@abaplint/transpiler/build/src/handlers/handle_view.js");
69354
69409
  const handle_enqu_1 = __webpack_require__(/*! ./handlers/handle_enqu */ "./node_modules/@abaplint/transpiler/build/src/handlers/handle_enqu.js");
69410
+ const handle_type_pool_1 = __webpack_require__(/*! ./handlers/handle_type_pool */ "./node_modules/@abaplint/transpiler/build/src/handlers/handle_type_pool.js");
69355
69411
  class Transpiler {
69356
69412
  constructor(options) {
69357
69413
  this.options = options;
@@ -69397,6 +69453,9 @@ class Transpiler {
69397
69453
  if (obj instanceof abaplint.ABAPObject && !(obj instanceof abaplint.Objects.TypePool)) {
69398
69454
  output.objects.push(...new handle_abap_1.HandleABAP(this.options).runObject(obj, reg));
69399
69455
  }
69456
+ else if (obj instanceof abaplint.Objects.TypePool) {
69457
+ output.objects.push(...new handle_type_pool_1.HandleTypePool().runObject(obj, reg));
69458
+ }
69400
69459
  else if (obj instanceof abaplint.Objects.Table) {
69401
69460
  output.objects.push(...new handle_table_1.HandleTable().runObject(obj, reg));
69402
69461
  }
@@ -75963,6 +76022,10 @@ class Traversal {
75963
76022
  else if (this.isBuiltinVariable(t)) {
75964
76023
  name = "abap.builtin." + name;
75965
76024
  }
76025
+ else if (this.isTypePool(t)) {
76026
+ const tp = this.isTypePool(t);
76027
+ name = `abap.TypePools["${tp}"].` + name.toLowerCase();
76028
+ }
75966
76029
  return name;
75967
76030
  }
75968
76031
  isStaticClassAttribute(token) {
@@ -76038,6 +76101,18 @@ class Traversal {
76038
76101
  }
76039
76102
  return false;
76040
76103
  }
76104
+ isTypePool(token) {
76105
+ const ref = this.findReadOrWriteReference(token);
76106
+ if (ref === null || ref === void 0 ? void 0 : ref.getFilename().endsWith(".type.abap")) {
76107
+ const file = this.reg.getFileByName(ref.getFilename());
76108
+ if (file === undefined) {
76109
+ return undefined;
76110
+ }
76111
+ const obj = this.reg.findObjectForFile(file);
76112
+ return obj === null || obj === void 0 ? void 0 : obj.getName();
76113
+ }
76114
+ return undefined;
76115
+ }
76041
76116
  // returns the interface name if interfaced
76042
76117
  isInterfaceAttribute(token) {
76043
76118
  const ref = this.findReadOrWriteReference(token);
@@ -76234,6 +76309,9 @@ class Traversal {
76234
76309
  }
76235
76310
  }
76236
76311
  setValues(identifier, name) {
76312
+ return Traversal.setValues(identifier, name);
76313
+ }
76314
+ static setValues(identifier, name) {
76237
76315
  const val = identifier.getValue();
76238
76316
  let ret = "";
76239
76317
  if (typeof val === "string") {
@@ -76584,6 +76662,7 @@ run().then(() => {
76584
76662
  if (obj instanceof abaplint.Objects.Table
76585
76663
  || obj instanceof abaplint.Objects.DataElement
76586
76664
  || obj instanceof abaplint.Objects.LockObject
76665
+ || obj instanceof abaplint.Objects.TypePool
76587
76666
  || obj instanceof abaplint.Objects.TableType) {
76588
76667
  list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
76589
76668
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.3.127",
3
+ "version": "2.4.1",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,11 +25,11 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.3.127",
28
+ "@abaplint/transpiler": "^2.4.1",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",
32
- "@abaplint/core": "^2.95.8",
32
+ "@abaplint/core": "^2.95.9",
33
33
  "progress": "^2.0.3",
34
34
  "webpack": "^5.75.0",
35
35
  "webpack-cli": "^5.0.1",