@abaplint/transpiler-cli 2.12.35 → 2.13.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 +49 -15
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -24893,7 +24893,9 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
24893
24893
  class DatabaseTable {
24894
24894
  static runSyntax(node, input) {
24895
24895
  const token = node.getFirstToken();
24896
- const name = token.getStr();
24896
+ const rawName = token.getStr();
24897
+ const starPrefixed = rawName.startsWith("*");
24898
+ const name = starPrefixed ? rawName.substring(1) : rawName;
24897
24899
  if (name === "(") {
24898
24900
  // dynamic
24899
24901
  return undefined;
@@ -25112,6 +25114,7 @@ class FieldChain {
25112
25114
  let context = undefined;
25113
25115
  const children = node.getChildren();
25114
25116
  context = this.findTop(children[0], input, refType);
25117
+ let prev = children[0].concatTokens();
25115
25118
  for (let i = 1; i < children.length; i++) {
25116
25119
  const current = children[i];
25117
25120
  if (current === undefined) {
@@ -25152,7 +25155,7 @@ class FieldChain {
25152
25155
  }
25153
25156
  }
25154
25157
  else {
25155
- const message = "Not a structure, FieldChain, " + (context === null || context === void 0 ? void 0 : context.constructor.name) + ", " + current.concatTokens();
25158
+ const message = prev.toUpperCase() + " is not structured (" + (context === null || context === void 0 ? void 0 : context.constructor.name) + ")";
25156
25159
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, current.getFirstToken(), message));
25157
25160
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
25158
25161
  }
@@ -25219,6 +25222,7 @@ class FieldChain {
25219
25222
  }
25220
25223
  }
25221
25224
  }
25225
+ prev = current.concatTokens();
25222
25226
  }
25223
25227
  return context;
25224
25228
  }
@@ -54792,7 +54796,7 @@ class Registry {
54792
54796
  }
54793
54797
  static abaplintVersion() {
54794
54798
  // magic, see build script "version.sh"
54795
- return "2.118.1";
54799
+ return "2.118.2";
54796
54800
  }
54797
54801
  getDDICReferences() {
54798
54802
  return this.ddicReferences;
@@ -55390,12 +55394,12 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
55390
55394
  issues.push(issue);
55391
55395
  }
55392
55396
  if (rowText.trim().match(regexEmptyAbapdoc) === null && previousRowsTexts.indexOf(rowText) === previousRowsTexts.length - 1) {
55393
- const message = "Missing ABAP Doc for method " + method.identifier.getToken().getStr() + " (" + rowText + ")";
55397
+ const message = "Missing ABAP Doc for method " + method.identifier.getToken().getStr();
55394
55398
  const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);
55395
55399
  issues.push(issue);
55396
55400
  }
55397
55401
  if (rowText.trim().match(regexEmptyParameterName) !== null) {
55398
- const message = "Missing ABAP Doc parameter name for method " + method.identifier.getToken().getStr() + " (" + rowText + ")";
55402
+ const message = "Missing ABAP Doc parameter name for method " + method.identifier.getToken().getStr();
55399
55403
  const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);
55400
55404
  issues.push(issue);
55401
55405
  }
@@ -85033,7 +85037,7 @@ class HandleDataElement {
85033
85037
  }
85034
85038
  const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
85035
85039
  "objectType": "DTEL",
85036
- "type": ${transpile_types_1.TranspileTypes.toType(type)},
85040
+ "type": ${transpile_types_1.TranspileTypes.toTypeFunction(type)},
85037
85041
  "domain": ${JSON.stringify(obj.getDomainName())},
85038
85042
  "fixedValues": ${JSON.stringify(fixedValues)},
85039
85043
  "description": ${JSON.stringify(obj.getDescription())},
@@ -85328,7 +85332,7 @@ class HandleTable {
85328
85332
  const type = obj.parseType(reg);
85329
85333
  const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
85330
85334
  "objectType": "TABL",
85331
- "type": ${transpile_types_1.TranspileTypes.toType(type)},
85335
+ "type": ${transpile_types_1.TranspileTypes.toTypeFunction(type)},
85332
85336
  "keyFields": ${JSON.stringify(obj.listKeys(reg))},
85333
85337
  "description": ${JSON.stringify(obj.getDescription())},
85334
85338
  };`);
@@ -85371,7 +85375,7 @@ class HandleTableType {
85371
85375
  const type = obj.parseType(reg);
85372
85376
  const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
85373
85377
  "objectType": "TTYP",
85374
- "type": ${transpile_types_1.TranspileTypes.toType(type)},
85378
+ "type": ${transpile_types_1.TranspileTypes.toTypeFunction(type)},
85375
85379
  "description": ${JSON.stringify(obj.getDescription())},
85376
85380
  };`);
85377
85381
  const output = {
@@ -85478,7 +85482,7 @@ class HandleView {
85478
85482
  const type = obj.parseType(reg);
85479
85483
  const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
85480
85484
  "objectType": "VIEW",
85481
- "type": ${transpile_types_1.TranspileTypes.toType(type)},
85485
+ "type": ${transpile_types_1.TranspileTypes.toTypeFunction(type)},
85482
85486
  };`);
85483
85487
  // todo, "keyFields": ${JSON.stringify(obj.listKeys())},
85484
85488
  const output = {
@@ -89224,6 +89228,7 @@ __exportStar(__webpack_require__(/*! ./select */ "./node_modules/@abaplint/trans
89224
89228
  __exportStar(__webpack_require__(/*! ./selection_screen */ "./node_modules/@abaplint/transpiler/build/src/statements/selection_screen.js"), exports);
89225
89229
  __exportStar(__webpack_require__(/*! ./set_bit */ "./node_modules/@abaplint/transpiler/build/src/statements/set_bit.js"), exports);
89226
89230
  __exportStar(__webpack_require__(/*! ./set_dataset */ "./node_modules/@abaplint/transpiler/build/src/statements/set_dataset.js"), exports);
89231
+ __exportStar(__webpack_require__(/*! ./set_extended_check */ "./node_modules/@abaplint/transpiler/build/src/statements/set_extended_check.js"), exports);
89227
89232
  __exportStar(__webpack_require__(/*! ./set_handler */ "./node_modules/@abaplint/transpiler/build/src/statements/set_handler.js"), exports);
89228
89233
  __exportStar(__webpack_require__(/*! ./set_language */ "./node_modules/@abaplint/transpiler/build/src/statements/set_language.js"), exports);
89229
89234
  __exportStar(__webpack_require__(/*! ./set_locale */ "./node_modules/@abaplint/transpiler/build/src/statements/set_locale.js"), exports);
@@ -91055,7 +91060,7 @@ exports.RetryTranspiler = void 0;
91055
91060
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
91056
91061
  class RetryTranspiler {
91057
91062
  transpile(_node, _traversal) {
91058
- return new chunk_1.Chunk(`throw new Error("Retry, not supported, transpiler");`);
91063
+ return new chunk_1.Chunk(`throw new Error("RETRY, not supported, transpiler");`);
91059
91064
  }
91060
91065
  }
91061
91066
  exports.RetryTranspiler = RetryTranspiler;
@@ -91456,6 +91461,27 @@ exports.SetDatasetTranspiler = SetDatasetTranspiler;
91456
91461
 
91457
91462
  /***/ },
91458
91463
 
91464
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/set_extended_check.js"
91465
+ /*!**************************************************************************************!*\
91466
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/set_extended_check.js ***!
91467
+ \**************************************************************************************/
91468
+ (__unused_webpack_module, exports, __webpack_require__) {
91469
+
91470
+ "use strict";
91471
+
91472
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
91473
+ exports.SetExtendedCheckTranspiler = void 0;
91474
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
91475
+ class SetExtendedCheckTranspiler {
91476
+ transpile(_node, _traversal) {
91477
+ return new chunk_1.Chunk(`throw new Error("SET EXTENDED CHECK, not supported, transpiler");`);
91478
+ }
91479
+ }
91480
+ exports.SetExtendedCheckTranspiler = SetExtendedCheckTranspiler;
91481
+ //# sourceMappingURL=set_extended_check.js.map
91482
+
91483
+ /***/ },
91484
+
91459
91485
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/set_handler.js"
91460
91486
  /*!*******************************************************************************!*\
91461
91487
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/set_handler.js ***!
@@ -91878,7 +91904,7 @@ exports.StopTranspiler = void 0;
91878
91904
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
91879
91905
  class StopTranspiler {
91880
91906
  transpile(_node, _traversal) {
91881
- return new chunk_1.Chunk(`throw new Error("Stop, not supported, transpiler");`);
91907
+ return new chunk_1.Chunk(`throw new Error("STOP, not supported, transpiler");`);
91882
91908
  }
91883
91909
  }
91884
91910
  exports.StopTranspiler = StopTranspiler;
@@ -93567,7 +93593,7 @@ class SelectTranspiler {
93567
93593
  // note: this implementation SELECTs everything into memory, which might be bad, and sometimes not correct
93568
93594
  const targetName = unique_identifier_1.UniqueIdentifier.get();
93569
93595
  const loopName = unique_identifier_1.UniqueIdentifier.get();
93570
- ret.appendString(`let ${targetName} = new abap.types.Table(abap.DDIC["${from}"].type);\n`);
93596
+ ret.appendString(`let ${targetName} = new abap.types.Table(abap.DDIC["${from}"].type());\n`);
93571
93597
  ret.appendChunk(new select_1.SelectTranspiler().transpile(selectStatement, traversal, targetName));
93572
93598
  // todo: optimize, it should do real streaming?
93573
93599
  const packageSize = node.findFirstExpression(abaplint.Expressions.SelectLoop)?.findExpressionAfterToken("SIZE");
@@ -93792,6 +93818,17 @@ class TranspileTypes {
93792
93818
  }
93793
93819
  return pre + t.getName().toLowerCase() + " = " + code + ";\n";
93794
93820
  }
93821
+ /** this returns a function, so it doesnt throw when loading the code, only when running */
93822
+ static toTypeFunction(type) {
93823
+ if (type instanceof abaplint.BasicTypes.UnknownType) {
93824
+ return `() => { throw new Error("Unknown type: ${type.getError()}") }`;
93825
+ }
93826
+ else if (type instanceof abaplint.BasicTypes.VoidType) {
93827
+ return `() => { throw new Error("Void type: ${type.getVoided()}") }`;
93828
+ }
93829
+ // return singleton,
93830
+ return "(() => { let _t; return () => (_t ??= " + this.toType(type) + "); })()";
93831
+ }
93795
93832
  static toType(type) {
93796
93833
  let resolved = "";
93797
93834
  let extra = "";
@@ -95241,9 +95278,6 @@ exports.config = {
95241
95278
  "begin_end_names": true,
95242
95279
  "check_syntax": true,
95243
95280
  "form_no_dash": true,
95244
- "obsolete_statement": {
95245
- "setExtended": true,
95246
- },
95247
95281
  "forbidden_identifier": {
95248
95282
  "check": [],
95249
95283
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.12.35",
3
+ "version": "2.13.1",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -27,8 +27,8 @@
27
27
  "author": "abaplint",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@abaplint/core": "^2.118.1",
31
- "@abaplint/transpiler": "^2.12.35",
30
+ "@abaplint/core": "^2.118.2",
31
+ "@abaplint/transpiler": "^2.13.1",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.12.0",
34
34
  "@types/progress": "^2.0.7",