@abaplint/transpiler-cli 2.7.158 → 2.7.160

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 +77 -11
  2. package/package.json +5 -5
package/build/bundle.js CHANGED
@@ -6145,7 +6145,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
6145
6145
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
6146
6146
  class RaiseWith extends combi_1.Expression {
6147
6147
  getRunnable() {
6148
- const wit = (0, combi_1.seq)("WITH", _1.SimpleSource3, (0, combi_1.opt)(_1.SimpleSource3), (0, combi_1.opt)(_1.SimpleSource3), (0, combi_1.opt)(_1.SimpleSource3));
6148
+ const wit = (0, combi_1.seq)("WITH", _1.SimpleSource1, (0, combi_1.opt)(_1.SimpleSource1), (0, combi_1.opt)(_1.SimpleSource1), (0, combi_1.opt)(_1.SimpleSource1));
6149
6149
  return wit;
6150
6150
  }
6151
6151
  }
@@ -21267,6 +21267,7 @@ class TypeUtils {
21267
21267
  }
21268
21268
  else if (type instanceof basic_1.StringType
21269
21269
  || type instanceof basic_1.AnyType
21270
+ || type instanceof basic_1.DataType
21270
21271
  || type instanceof basic_1.CharacterType
21271
21272
  || type instanceof basic_1.SimpleType
21272
21273
  || type instanceof cgeneric_type_1.CGenericType
@@ -21315,6 +21316,7 @@ class TypeUtils {
21315
21316
  || type instanceof basic_1.CSequenceType
21316
21317
  || type instanceof cgeneric_type_1.CGenericType
21317
21318
  || type instanceof basic_1.DateType
21319
+ || type instanceof basic_1.DataType
21318
21320
  || type instanceof basic_1.CLikeType
21319
21321
  || type instanceof basic_1.PackedType
21320
21322
  || type instanceof basic_1.TimeType) {
@@ -21545,7 +21547,9 @@ class TypeUtils {
21545
21547
  else if (target instanceof basic_1.CLikeType) {
21546
21548
  return this.isCharLikeStrict(source);
21547
21549
  }
21548
- else if (target instanceof basic_1.VoidType || target instanceof basic_1.AnyType) {
21550
+ else if (target instanceof basic_1.VoidType
21551
+ || target instanceof basic_1.AnyType
21552
+ || target instanceof basic_1.DataType) {
21549
21553
  return true;
21550
21554
  }
21551
21555
  return false;
@@ -21607,6 +21611,7 @@ class TypeUtils {
21607
21611
  }
21608
21612
  if (source instanceof basic_1.VoidType
21609
21613
  || source instanceof basic_1.AnyType
21614
+ || source instanceof basic_1.DataType
21610
21615
  || source instanceof basic_1.UnknownType) {
21611
21616
  return true;
21612
21617
  }
@@ -21651,6 +21656,7 @@ class TypeUtils {
21651
21656
  if (source instanceof basic_1.ObjectReferenceType
21652
21657
  || source instanceof basic_1.GenericObjectReferenceType
21653
21658
  || source instanceof basic_1.VoidType
21659
+ || source instanceof basic_1.DataType
21654
21660
  || source instanceof basic_1.AnyType
21655
21661
  || source instanceof basic_1.UnknownType) {
21656
21662
  return true;
@@ -21660,6 +21666,7 @@ class TypeUtils {
21660
21666
  else if (target instanceof basic_1.DataReference) {
21661
21667
  if (source instanceof basic_1.DataReference
21662
21668
  || source instanceof basic_1.VoidType
21669
+ || source instanceof basic_1.DataType
21663
21670
  || source instanceof basic_1.AnyType
21664
21671
  || source instanceof basic_1.UnknownType) {
21665
21672
  return true;
@@ -21672,6 +21679,7 @@ class TypeUtils {
21672
21679
  }
21673
21680
  else if (source instanceof basic_1.VoidType
21674
21681
  || source instanceof basic_1.AnyType
21682
+ || source instanceof basic_1.DataType
21675
21683
  || source instanceof basic_1.UnknownType) {
21676
21684
  return true;
21677
21685
  }
@@ -22568,7 +22576,7 @@ class BasicTypes {
22568
22576
  return new Types.DataReference(found);
22569
22577
  }
22570
22578
  else if (chain.concatTokens().toUpperCase() === "DATA") {
22571
- return new Types.DataReference(new Types.AnyType());
22579
+ return new Types.DataReference(new Types.DataType());
22572
22580
  }
22573
22581
  if (this.scope.isBadiDef(name) === true) {
22574
22582
  return new Types.VoidType(name);
@@ -23466,6 +23474,7 @@ class Dereference {
23466
23474
  runSyntax(type) {
23467
23475
  if (type instanceof basic_1.VoidType
23468
23476
  || type instanceof basic_1.AnyType
23477
+ || type instanceof basic_1.DataType
23469
23478
  || type === undefined
23470
23479
  || type instanceof basic_1.UnknownType) {
23471
23480
  return type;
@@ -25215,7 +25224,7 @@ class NewObject {
25215
25224
  new method_parameters_1.MethodParameters().checkExporting(parameters, scope, method, filename);
25216
25225
  }
25217
25226
  else if (requiredParameters.length > 0) {
25218
- throw new Error(`constructor parameter "${requiredParameters[0].getName()}" must be supplied` + name);
25227
+ throw new Error(`constructor parameter "${requiredParameters[0].getName()}" must be supplied, ` + name);
25219
25228
  }
25220
25229
  }
25221
25230
  defaultImportingType(method) {
@@ -25251,7 +25260,7 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
25251
25260
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
25252
25261
  class RaiseWith {
25253
25262
  runSyntax(node, scope, filename) {
25254
- for (const f of node.findDirectExpressions(Expressions.SimpleSource3)) {
25263
+ for (const f of node.findDirectExpressions(Expressions.SimpleSource1)) {
25255
25264
  new source_1.Source().runSyntax(f, scope, filename);
25256
25265
  }
25257
25266
  }
@@ -28336,6 +28345,7 @@ class CreateObject {
28336
28345
  }
28337
28346
  else if (!(found instanceof basic_1.ObjectReferenceType)
28338
28347
  && !(found instanceof basic_1.AnyType)
28348
+ && !(found instanceof basic_1.DataType)
28339
28349
  && !(found instanceof basic_1.GenericObjectReferenceType)) {
28340
28350
  throw new Error("Target must be an object reference, " + t.concatTokens());
28341
28351
  }
@@ -29657,6 +29667,7 @@ class Loop {
29657
29667
  }
29658
29668
  else if (!(sourceType instanceof basic_1.TableType)
29659
29669
  && !(sourceType instanceof basic_1.AnyType)
29670
+ && !(sourceType instanceof basic_1.DataType)
29660
29671
  && !(sourceType instanceof basic_1.VoidType)
29661
29672
  && concat.startsWith("LOOP AT GROUP ") === false) {
29662
29673
  throw new Error("Loop, not a table type");
@@ -34874,6 +34885,7 @@ exports.CSequenceType = CSequenceType;
34874
34885
  Object.defineProperty(exports, "__esModule", ({ value: true }));
34875
34886
  exports.DataReference = void 0;
34876
34887
  const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
34888
+ const any_type_1 = __webpack_require__(/*! ./any_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/any_type.js");
34877
34889
  class DataReference extends _abstract_type_1.AbstractType {
34878
34890
  constructor(type, qualifiedName) {
34879
34891
  super({ qualifiedName: qualifiedName });
@@ -34893,7 +34905,9 @@ class DataReference extends _abstract_type_1.AbstractType {
34893
34905
  return "REF TO " + this.type.toABAP();
34894
34906
  }
34895
34907
  isGeneric() {
34896
- // a DATA definition can be "REF TO data", so its not generic
34908
+ if (this.type instanceof any_type_1.AnyType) {
34909
+ return true;
34910
+ }
34897
34911
  return false;
34898
34912
  }
34899
34913
  containsVoid() {
@@ -34908,6 +34922,39 @@ exports.DataReference = DataReference;
34908
34922
 
34909
34923
  /***/ }),
34910
34924
 
34925
+ /***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/data_type.js":
34926
+ /*!*****************************************************************************!*\
34927
+ !*** ./node_modules/@abaplint/core/build/src/abap/types/basic/data_type.js ***!
34928
+ \*****************************************************************************/
34929
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
34930
+
34931
+ "use strict";
34932
+
34933
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
34934
+ exports.DataType = void 0;
34935
+ const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
34936
+ class DataType extends _abstract_type_1.AbstractType {
34937
+ toText() {
34938
+ return "```data```";
34939
+ }
34940
+ toABAP() {
34941
+ return "data";
34942
+ }
34943
+ isGeneric() {
34944
+ return true;
34945
+ }
34946
+ containsVoid() {
34947
+ return false;
34948
+ }
34949
+ toCDS() {
34950
+ return "abap.TODO_DATA";
34951
+ }
34952
+ }
34953
+ exports.DataType = DataType;
34954
+ //# sourceMappingURL=data_type.js.map
34955
+
34956
+ /***/ }),
34957
+
34911
34958
  /***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/date_type.js":
34912
34959
  /*!*****************************************************************************!*\
34913
34960
  !*** ./node_modules/@abaplint/core/build/src/abap/types/basic/date_type.js ***!
@@ -35258,6 +35305,7 @@ __exportStar(__webpack_require__(/*! ./character_type */ "./node_modules/@abapli
35258
35305
  __exportStar(__webpack_require__(/*! ./clike_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/clike_type.js"), exports);
35259
35306
  __exportStar(__webpack_require__(/*! ./csequence_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/csequence_type.js"), exports);
35260
35307
  __exportStar(__webpack_require__(/*! ./data_reference_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/data_reference_type.js"), exports);
35308
+ __exportStar(__webpack_require__(/*! ./data_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/data_type.js"), exports);
35261
35309
  __exportStar(__webpack_require__(/*! ./date_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/date_type.js"), exports);
35262
35310
  __exportStar(__webpack_require__(/*! ./decfloat_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat_type.js"), exports);
35263
35311
  __exportStar(__webpack_require__(/*! ./decfloat16_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat16_type.js"), exports);
@@ -38899,7 +38947,7 @@ class DDIC {
38899
38947
  case "TABLE":
38900
38948
  return new Types.TableType(new Types.AnyType(), { withHeader: false, keyType: Types.TableKeyType.default });
38901
38949
  case "DATA":
38902
- return new Types.AnyType({ qualifiedName: qualifiedName });
38950
+ return new Types.DataType({ qualifiedName: qualifiedName });
38903
38951
  case "NUMERIC":
38904
38952
  return new Types.NumericGenericType({ qualifiedName: qualifiedName });
38905
38953
  case "UTCLONG": // todo, take version into account
@@ -49126,7 +49174,7 @@ class TableType extends _abstract_object_1.AbstractObject {
49126
49174
  type = new Types.TableType(new basic_1.GenericObjectReferenceType(), tableOptions, this.getName());
49127
49175
  }
49128
49176
  else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype === "DATA") {
49129
- type = new Types.TableType(new basic_1.DataReference(new basic_1.AnyType()), tableOptions, this.getName());
49177
+ type = new Types.TableType(new basic_1.DataReference(new Types.DataType()), tableOptions, this.getName());
49130
49178
  }
49131
49179
  else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype !== undefined) {
49132
49180
  const lookup = ddic.lookupObject(this.parsedXML.rowtype);
@@ -50198,7 +50246,7 @@ class Registry {
50198
50246
  }
50199
50247
  static abaplintVersion() {
50200
50248
  // magic, see build script "version.sh"
50201
- return "2.105.18";
50249
+ return "2.105.21";
50202
50250
  }
50203
50251
  getDDICReferences() {
50204
50252
  return this.ddicReferences;
@@ -56008,7 +56056,7 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
56008
56056
  }
56009
56057
  startToken = node.getFirstToken();
56010
56058
  }
56011
- const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.SimpleSource3)) || [];
56059
+ const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.SimpleSource1)) || [];
56012
56060
  const className = ((_g = node.findDirectExpression(Expressions.ClassName)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "ERROR";
56013
56061
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56014
56062
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
@@ -58096,6 +58144,7 @@ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ ".
58096
58144
  const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
58097
58145
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
58098
58146
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
58147
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
58099
58148
  class EmptyStructureConf extends _basic_rule_config_1.BasicRuleConfig {
58100
58149
  constructor() {
58101
58150
  super(...arguments);
@@ -58150,6 +58199,11 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
58150
58199
  if (stru === undefined) {
58151
58200
  return [];
58152
58201
  }
58202
+ for (const statement of file.getStatements()) {
58203
+ if (statement.get() instanceof _statement_1.Unknown) {
58204
+ return []; // contains parser errors
58205
+ }
58206
+ }
58153
58207
  const candidates = [];
58154
58208
  if (this.getConfig().loop === true) {
58155
58209
  candidates.push(...stru.findAllStructuresRecursive(Structures.Loop));
@@ -59559,6 +59613,7 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
59559
59613
  const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
59560
59614
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
59561
59615
  const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
59616
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
59562
59617
  class IdenticalContentsConf extends _basic_rule_config_1.BasicRuleConfig {
59563
59618
  }
59564
59619
  exports.IdenticalContentsConf = IdenticalContentsConf;
@@ -59604,6 +59659,11 @@ WRITE 'world'.`,
59604
59659
  if (structure === undefined) {
59605
59660
  return [];
59606
59661
  }
59662
+ for (const statement of file.getStatements()) {
59663
+ if (statement.get() instanceof _statement_1.Unknown) {
59664
+ return []; // contains parser errors
59665
+ }
59666
+ }
59607
59667
  for (const i of structure.findAllStructuresRecursive(Structures.If)) {
59608
59668
  issues = issues.concat(this.analyzeIf(file, i));
59609
59669
  }
@@ -60989,6 +61049,11 @@ class KeepSingleParameterCallsOnOneLine extends _abap_rule_1.ABAPRule {
60989
61049
  }
60990
61050
  isSingleParameter(c) {
60991
61051
  if (c.findDirectExpression(Expressions.Source)) {
61052
+ for (const params of c.findAllExpressions(Expressions.ParameterListS)) {
61053
+ if (params.getChildren().length > 1) {
61054
+ return false;
61055
+ }
61056
+ }
60992
61057
  return true;
60993
61058
  }
60994
61059
  const list = c.findDirectExpression(Expressions.ParameterListS);
@@ -83900,7 +83965,8 @@ class TranspileTypes {
83900
83965
  // if not supplied its a Character(1)
83901
83966
  resolved = "Character";
83902
83967
  }
83903
- else if (type instanceof abaplint.BasicTypes.AnyType) {
83968
+ else if (type instanceof abaplint.BasicTypes.AnyType
83969
+ || type instanceof abaplint.BasicTypes.DataType) {
83904
83970
  // if not supplied its a Character(4)
83905
83971
  resolved = "Character";
83906
83972
  extra = "4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.7.158",
3
+ "version": "2.7.160",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -26,14 +26,14 @@
26
26
  "author": "abaplint",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@abaplint/transpiler": "^2.7.158",
29
+ "@abaplint/transpiler": "^2.7.160",
30
30
  "@types/glob": "^8.1.0",
31
31
  "glob": "=7.2.0",
32
32
  "@types/progress": "^2.0.7",
33
- "@types/node": "^20.11.19",
34
- "@abaplint/core": "^2.105.18",
33
+ "@types/node": "^20.11.20",
34
+ "@abaplint/core": "^2.105.21",
35
35
  "progress": "^2.0.3",
36
- "webpack": "^5.90.2",
36
+ "webpack": "^5.90.3",
37
37
  "webpack-cli": "^5.1.4",
38
38
  "typescript": "^5.3.3"
39
39
  }