@abaplint/transpiler-cli 2.7.70 → 2.7.72

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.
package/abap_transpile CHANGED
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  require("./build/bundle");
package/build/bundle.js CHANGED
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
13
13
  exports.TranspilerConfig = void 0;
14
14
  const path = __webpack_require__(/*! path */ "path");
15
15
  const fs = __webpack_require__(/*! fs */ "fs");
16
+ const transpiler_1 = __webpack_require__(/*! @abaplint/transpiler */ "./node_modules/@abaplint/transpiler/build/src/index.js");
16
17
  class TranspilerConfig {
17
18
  static find(filename) {
18
19
  if (filename !== undefined) {
@@ -47,7 +48,7 @@ class TranspilerConfig {
47
48
  addFilenames: true,
48
49
  addCommonJS: true,
49
50
  skipConstants: false,
50
- unknownTypes: "compileError",
51
+ unknownTypes: transpiler_1.UnknownTypesEnum.compileError,
51
52
  },
52
53
  };
53
54
  }
@@ -73157,12 +73158,14 @@ exports.HandleW3MI = HandleW3MI;
73157
73158
  "use strict";
73158
73159
 
73159
73160
  Object.defineProperty(exports, "__esModule", ({ value: true }));
73160
- exports.Transpiler = exports.config = void 0;
73161
+ exports.Transpiler = exports.UnknownTypesEnum = exports.config = void 0;
73161
73162
  const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
73162
73163
  const validation_1 = __webpack_require__(/*! ./validation */ "./node_modules/@abaplint/transpiler/build/src/validation.js");
73163
73164
  Object.defineProperty(exports, "config", ({ enumerable: true, get: function () { return validation_1.config; } }));
73164
73165
  const unit_test_1 = __webpack_require__(/*! ./unit_test */ "./node_modules/@abaplint/transpiler/build/src/unit_test.js");
73165
73166
  const keywords_1 = __webpack_require__(/*! ./keywords */ "./node_modules/@abaplint/transpiler/build/src/keywords.js");
73167
+ const types_1 = __webpack_require__(/*! ./types */ "./node_modules/@abaplint/transpiler/build/src/types.js");
73168
+ Object.defineProperty(exports, "UnknownTypesEnum", ({ enumerable: true, get: function () { return types_1.UnknownTypesEnum; } }));
73166
73169
  const db_1 = __webpack_require__(/*! ./db */ "./node_modules/@abaplint/transpiler/build/src/db/index.js");
73167
73170
  const handle_table_1 = __webpack_require__(/*! ./handlers/handle_table */ "./node_modules/@abaplint/transpiler/build/src/handlers/handle_table.js");
73168
73171
  const handle_abap_1 = __webpack_require__(/*! ./handlers/handle_abap */ "./node_modules/@abaplint/transpiler/build/src/handlers/handle_abap.js");
@@ -73181,7 +73184,7 @@ class Transpiler {
73181
73184
  this.options = {};
73182
73185
  }
73183
73186
  if (this.options.unknownTypes === undefined) {
73184
- this.options.unknownTypes = "compileError";
73187
+ this.options.unknownTypes = types_1.UnknownTypesEnum.compileError;
73185
73188
  }
73186
73189
  }
73187
73190
  // workaround for web/webpack
@@ -74809,6 +74812,7 @@ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abap
74809
74812
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
74810
74813
  const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
74811
74814
  const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
74815
+ const types_1 = __webpack_require__(/*! ../types */ "./node_modules/@abaplint/transpiler/build/src/types.js");
74812
74816
  class CreateObjectTranspiler {
74813
74817
  transpile(node, traversal) {
74814
74818
  var _a, _b;
@@ -74870,7 +74874,7 @@ class CreateObjectTranspiler {
74870
74874
  return "object";
74871
74875
  }
74872
74876
  else if (!(type instanceof abaplint.BasicTypes.ObjectReferenceType)) {
74873
- if (((_a = traversal.options) === null || _a === void 0 ? void 0 : _a.unknownTypes) !== "runtimeError") {
74877
+ if (((_a = traversal.options) === null || _a === void 0 ? void 0 : _a.unknownTypes) !== types_1.UnknownTypesEnum.runtimeError) {
74874
74878
  throw new Error(`CreateObjectTranspiler, target variable "${target === null || target === void 0 ? void 0 : target.concatTokens()}" not a object reference`);
74875
74879
  }
74876
74880
  else {
@@ -79904,7 +79908,7 @@ class TryTranspiler {
79904
79908
  const catchNames = catchStatement.findDirectExpressions(abaplint.Expressions.ClassName).map(e => traversal.lookupClassOrInterface(e.concatTokens(), e.getFirstToken()));
79905
79909
  ret += first ? "" : " else ";
79906
79910
  first = false;
79907
- ret += "if (" + (catchNames === null || catchNames === void 0 ? void 0 : catchNames.map(n => "e instanceof " + n).join(" || ")) + ") {\n";
79911
+ ret += "if (" + (catchNames === null || catchNames === void 0 ? void 0 : catchNames.map(n => "(" + n + " && e instanceof " + n + ")").join(" || ")) + ") {\n";
79908
79912
  const intoNode = catchStatement.findExpressionAfterToken("INTO");
79909
79913
  if (intoNode) {
79910
79914
  ret += traversal.traverse(intoNode).getCode() + ".set(e);\n";
@@ -80099,11 +80103,15 @@ class TranspileTypes {
80099
80103
  else if (type instanceof abaplint.BasicTypes.StructureType) {
80100
80104
  resolved = "Structure";
80101
80105
  const list = [];
80102
- const renamingSuffix = {};
80106
+ const suffix = {};
80107
+ const asInclude = {};
80103
80108
  for (const c of type.getComponents()) {
80104
80109
  list.push(`"` + c.name.toLowerCase() + `": ` + this.toType(c.type));
80105
80110
  if (c.suffix) {
80106
- renamingSuffix[c.name.toLowerCase()] = c.suffix;
80111
+ suffix[c.name.toLowerCase()] = c.suffix;
80112
+ }
80113
+ if (c.asInclude) {
80114
+ asInclude[c.name.toLowerCase()] = true;
80107
80115
  }
80108
80116
  }
80109
80117
  extra = "{" + list.join(", ") + "}";
@@ -80119,7 +80127,8 @@ class TranspileTypes {
80119
80127
  else {
80120
80128
  extra += ", undefined";
80121
80129
  }
80122
- extra += ", " + JSON.stringify(renamingSuffix);
80130
+ extra += ", " + JSON.stringify(suffix);
80131
+ extra += ", " + JSON.stringify(asInclude);
80123
80132
  }
80124
80133
  else if (type instanceof abaplint.BasicTypes.CLikeType
80125
80134
  || type instanceof abaplint.BasicTypes.CGenericType
@@ -80851,6 +80860,25 @@ exports.Traversal = Traversal;
80851
80860
 
80852
80861
  /***/ }),
80853
80862
 
80863
+ /***/ "./node_modules/@abaplint/transpiler/build/src/types.js":
80864
+ /*!**************************************************************!*\
80865
+ !*** ./node_modules/@abaplint/transpiler/build/src/types.js ***!
80866
+ \**************************************************************/
80867
+ /***/ ((__unused_webpack_module, exports) => {
80868
+
80869
+ "use strict";
80870
+
80871
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
80872
+ exports.UnknownTypesEnum = void 0;
80873
+ var UnknownTypesEnum;
80874
+ (function (UnknownTypesEnum) {
80875
+ UnknownTypesEnum[UnknownTypesEnum["compileError"] = 0] = "compileError";
80876
+ UnknownTypesEnum[UnknownTypesEnum["runtimeError"] = 1] = "runtimeError";
80877
+ })(UnknownTypesEnum || (exports.UnknownTypesEnum = UnknownTypesEnum = {}));
80878
+ //# sourceMappingURL=types.js.map
80879
+
80880
+ /***/ }),
80881
+
80854
80882
  /***/ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js":
80855
80883
  /*!**************************************************************************!*\
80856
80884
  !*** ./node_modules/@abaplint/transpiler/build/src/unique_identifier.js ***!
@@ -81277,6 +81305,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
81277
81305
  exports.Validation = exports.config = void 0;
81278
81306
  const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
81279
81307
  const keywords_1 = __webpack_require__(/*! ./keywords */ "./node_modules/@abaplint/transpiler/build/src/keywords.js");
81308
+ const types_1 = __webpack_require__(/*! ./types */ "./node_modules/@abaplint/transpiler/build/src/types.js");
81280
81309
  exports.config = {
81281
81310
  "global": {
81282
81311
  "files": "/**/*.*",
@@ -81377,7 +81406,7 @@ class Validation {
81377
81406
  exports.config.rules["forbidden_identifier"]["check"].push(add);
81378
81407
  }
81379
81408
  }
81380
- if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.unknownTypes) === "runtimeError") {
81409
+ if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.unknownTypes) === types_1.UnknownTypesEnum.runtimeError) {
81381
81410
  // this is not a constant, just a regex that happens to not match anything
81382
81411
  exports.config.syntax.errorNamespace = "VOID_EVERYTHING";
81383
81412
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.7.70",
3
+ "version": "2.7.72",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -26,11 +26,11 @@
26
26
  "author": "abaplint",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@abaplint/transpiler": "^2.7.70",
29
+ "@abaplint/transpiler": "^2.7.72",
30
30
  "@types/glob": "^7.2.0",
31
31
  "glob": "=7.2.0",
32
32
  "@types/progress": "^2.0.5",
33
- "@types/node": "^20.4.8",
33
+ "@types/node": "^20.4.9",
34
34
  "@abaplint/core": "^2.102.17",
35
35
  "progress": "^2.0.3",
36
36
  "webpack": "^5.88.2",