@abaplint/transpiler-cli 2.7.157 → 2.7.159

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 +69 -10
  2. package/package.json +4 -4
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
  }
@@ -21315,6 +21315,7 @@ class TypeUtils {
21315
21315
  || type instanceof basic_1.CSequenceType
21316
21316
  || type instanceof cgeneric_type_1.CGenericType
21317
21317
  || type instanceof basic_1.DateType
21318
+ || type instanceof basic_1.DataType
21318
21319
  || type instanceof basic_1.CLikeType
21319
21320
  || type instanceof basic_1.PackedType
21320
21321
  || type instanceof basic_1.TimeType) {
@@ -21545,7 +21546,9 @@ class TypeUtils {
21545
21546
  else if (target instanceof basic_1.CLikeType) {
21546
21547
  return this.isCharLikeStrict(source);
21547
21548
  }
21548
- else if (target instanceof basic_1.VoidType || target instanceof basic_1.AnyType) {
21549
+ else if (target instanceof basic_1.VoidType
21550
+ || target instanceof basic_1.AnyType
21551
+ || target instanceof basic_1.DataType) {
21549
21552
  return true;
21550
21553
  }
21551
21554
  return false;
@@ -21607,6 +21610,7 @@ class TypeUtils {
21607
21610
  }
21608
21611
  if (source instanceof basic_1.VoidType
21609
21612
  || source instanceof basic_1.AnyType
21613
+ || source instanceof basic_1.DataType
21610
21614
  || source instanceof basic_1.UnknownType) {
21611
21615
  return true;
21612
21616
  }
@@ -21651,6 +21655,7 @@ class TypeUtils {
21651
21655
  if (source instanceof basic_1.ObjectReferenceType
21652
21656
  || source instanceof basic_1.GenericObjectReferenceType
21653
21657
  || source instanceof basic_1.VoidType
21658
+ || source instanceof basic_1.DataType
21654
21659
  || source instanceof basic_1.AnyType
21655
21660
  || source instanceof basic_1.UnknownType) {
21656
21661
  return true;
@@ -21660,6 +21665,7 @@ class TypeUtils {
21660
21665
  else if (target instanceof basic_1.DataReference) {
21661
21666
  if (source instanceof basic_1.DataReference
21662
21667
  || source instanceof basic_1.VoidType
21668
+ || source instanceof basic_1.DataType
21663
21669
  || source instanceof basic_1.AnyType
21664
21670
  || source instanceof basic_1.UnknownType) {
21665
21671
  return true;
@@ -21672,6 +21678,7 @@ class TypeUtils {
21672
21678
  }
21673
21679
  else if (source instanceof basic_1.VoidType
21674
21680
  || source instanceof basic_1.AnyType
21681
+ || source instanceof basic_1.DataType
21675
21682
  || source instanceof basic_1.UnknownType) {
21676
21683
  return true;
21677
21684
  }
@@ -22568,7 +22575,7 @@ class BasicTypes {
22568
22575
  return new Types.DataReference(found);
22569
22576
  }
22570
22577
  else if (chain.concatTokens().toUpperCase() === "DATA") {
22571
- return new Types.DataReference(new Types.AnyType());
22578
+ return new Types.DataReference(new Types.DataType());
22572
22579
  }
22573
22580
  if (this.scope.isBadiDef(name) === true) {
22574
22581
  return new Types.VoidType(name);
@@ -23466,6 +23473,7 @@ class Dereference {
23466
23473
  runSyntax(type) {
23467
23474
  if (type instanceof basic_1.VoidType
23468
23475
  || type instanceof basic_1.AnyType
23476
+ || type instanceof basic_1.DataType
23469
23477
  || type === undefined
23470
23478
  || type instanceof basic_1.UnknownType) {
23471
23479
  return type;
@@ -25251,7 +25259,7 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
25251
25259
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
25252
25260
  class RaiseWith {
25253
25261
  runSyntax(node, scope, filename) {
25254
- for (const f of node.findDirectExpressions(Expressions.SimpleSource3)) {
25262
+ for (const f of node.findDirectExpressions(Expressions.SimpleSource1)) {
25255
25263
  new source_1.Source().runSyntax(f, scope, filename);
25256
25264
  }
25257
25265
  }
@@ -29657,6 +29665,7 @@ class Loop {
29657
29665
  }
29658
29666
  else if (!(sourceType instanceof basic_1.TableType)
29659
29667
  && !(sourceType instanceof basic_1.AnyType)
29668
+ && !(sourceType instanceof basic_1.DataType)
29660
29669
  && !(sourceType instanceof basic_1.VoidType)
29661
29670
  && concat.startsWith("LOOP AT GROUP ") === false) {
29662
29671
  throw new Error("Loop, not a table type");
@@ -34874,6 +34883,7 @@ exports.CSequenceType = CSequenceType;
34874
34883
  Object.defineProperty(exports, "__esModule", ({ value: true }));
34875
34884
  exports.DataReference = void 0;
34876
34885
  const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
34886
+ const any_type_1 = __webpack_require__(/*! ./any_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/any_type.js");
34877
34887
  class DataReference extends _abstract_type_1.AbstractType {
34878
34888
  constructor(type, qualifiedName) {
34879
34889
  super({ qualifiedName: qualifiedName });
@@ -34893,7 +34903,9 @@ class DataReference extends _abstract_type_1.AbstractType {
34893
34903
  return "REF TO " + this.type.toABAP();
34894
34904
  }
34895
34905
  isGeneric() {
34896
- // a DATA definition can be "REF TO data", so its not generic
34906
+ if (this.type instanceof any_type_1.AnyType) {
34907
+ return true;
34908
+ }
34897
34909
  return false;
34898
34910
  }
34899
34911
  containsVoid() {
@@ -34908,6 +34920,39 @@ exports.DataReference = DataReference;
34908
34920
 
34909
34921
  /***/ }),
34910
34922
 
34923
+ /***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/data_type.js":
34924
+ /*!*****************************************************************************!*\
34925
+ !*** ./node_modules/@abaplint/core/build/src/abap/types/basic/data_type.js ***!
34926
+ \*****************************************************************************/
34927
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
34928
+
34929
+ "use strict";
34930
+
34931
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
34932
+ exports.DataType = void 0;
34933
+ const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
34934
+ class DataType extends _abstract_type_1.AbstractType {
34935
+ toText() {
34936
+ return "```data```";
34937
+ }
34938
+ toABAP() {
34939
+ return "data";
34940
+ }
34941
+ isGeneric() {
34942
+ return true;
34943
+ }
34944
+ containsVoid() {
34945
+ return false;
34946
+ }
34947
+ toCDS() {
34948
+ return "abap.TODO_DATA";
34949
+ }
34950
+ }
34951
+ exports.DataType = DataType;
34952
+ //# sourceMappingURL=data_type.js.map
34953
+
34954
+ /***/ }),
34955
+
34911
34956
  /***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/date_type.js":
34912
34957
  /*!*****************************************************************************!*\
34913
34958
  !*** ./node_modules/@abaplint/core/build/src/abap/types/basic/date_type.js ***!
@@ -35258,6 +35303,7 @@ __exportStar(__webpack_require__(/*! ./character_type */ "./node_modules/@abapli
35258
35303
  __exportStar(__webpack_require__(/*! ./clike_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/clike_type.js"), exports);
35259
35304
  __exportStar(__webpack_require__(/*! ./csequence_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/csequence_type.js"), exports);
35260
35305
  __exportStar(__webpack_require__(/*! ./data_reference_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/data_reference_type.js"), exports);
35306
+ __exportStar(__webpack_require__(/*! ./data_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/data_type.js"), exports);
35261
35307
  __exportStar(__webpack_require__(/*! ./date_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/date_type.js"), exports);
35262
35308
  __exportStar(__webpack_require__(/*! ./decfloat_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat_type.js"), exports);
35263
35309
  __exportStar(__webpack_require__(/*! ./decfloat16_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat16_type.js"), exports);
@@ -38899,7 +38945,7 @@ class DDIC {
38899
38945
  case "TABLE":
38900
38946
  return new Types.TableType(new Types.AnyType(), { withHeader: false, keyType: Types.TableKeyType.default });
38901
38947
  case "DATA":
38902
- return new Types.AnyType({ qualifiedName: qualifiedName });
38948
+ return new Types.DataType({ qualifiedName: qualifiedName });
38903
38949
  case "NUMERIC":
38904
38950
  return new Types.NumericGenericType({ qualifiedName: qualifiedName });
38905
38951
  case "UTCLONG": // todo, take version into account
@@ -49126,7 +49172,7 @@ class TableType extends _abstract_object_1.AbstractObject {
49126
49172
  type = new Types.TableType(new basic_1.GenericObjectReferenceType(), tableOptions, this.getName());
49127
49173
  }
49128
49174
  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());
49175
+ type = new Types.TableType(new basic_1.DataReference(new Types.DataType()), tableOptions, this.getName());
49130
49176
  }
49131
49177
  else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype !== undefined) {
49132
49178
  const lookup = ddic.lookupObject(this.parsedXML.rowtype);
@@ -50198,7 +50244,7 @@ class Registry {
50198
50244
  }
50199
50245
  static abaplintVersion() {
50200
50246
  // magic, see build script "version.sh"
50201
- return "2.105.18";
50247
+ return "2.105.20";
50202
50248
  }
50203
50249
  getDDICReferences() {
50204
50250
  return this.ddicReferences;
@@ -56008,7 +56054,7 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
56008
56054
  }
56009
56055
  startToken = node.getFirstToken();
56010
56056
  }
56011
- const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.SimpleSource3)) || [];
56057
+ const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.SimpleSource1)) || [];
56012
56058
  const className = ((_g = node.findDirectExpression(Expressions.ClassName)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "ERROR";
56013
56059
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56014
56060
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
@@ -58096,6 +58142,7 @@ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ ".
58096
58142
  const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
58097
58143
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
58098
58144
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
58145
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
58099
58146
  class EmptyStructureConf extends _basic_rule_config_1.BasicRuleConfig {
58100
58147
  constructor() {
58101
58148
  super(...arguments);
@@ -58150,6 +58197,11 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
58150
58197
  if (stru === undefined) {
58151
58198
  return [];
58152
58199
  }
58200
+ for (const statement of file.getStatements()) {
58201
+ if (statement.get() instanceof _statement_1.Unknown) {
58202
+ return []; // contains parser errors
58203
+ }
58204
+ }
58153
58205
  const candidates = [];
58154
58206
  if (this.getConfig().loop === true) {
58155
58207
  candidates.push(...stru.findAllStructuresRecursive(Structures.Loop));
@@ -59559,6 +59611,7 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
59559
59611
  const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
59560
59612
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
59561
59613
  const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
59614
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
59562
59615
  class IdenticalContentsConf extends _basic_rule_config_1.BasicRuleConfig {
59563
59616
  }
59564
59617
  exports.IdenticalContentsConf = IdenticalContentsConf;
@@ -59604,6 +59657,11 @@ WRITE 'world'.`,
59604
59657
  if (structure === undefined) {
59605
59658
  return [];
59606
59659
  }
59660
+ for (const statement of file.getStatements()) {
59661
+ if (statement.get() instanceof _statement_1.Unknown) {
59662
+ return []; // contains parser errors
59663
+ }
59664
+ }
59607
59665
  for (const i of structure.findAllStructuresRecursive(Structures.If)) {
59608
59666
  issues = issues.concat(this.analyzeIf(file, i));
59609
59667
  }
@@ -83900,7 +83958,8 @@ class TranspileTypes {
83900
83958
  // if not supplied its a Character(1)
83901
83959
  resolved = "Character";
83902
83960
  }
83903
- else if (type instanceof abaplint.BasicTypes.AnyType) {
83961
+ else if (type instanceof abaplint.BasicTypes.AnyType
83962
+ || type instanceof abaplint.BasicTypes.DataType) {
83904
83963
  // if not supplied its a Character(4)
83905
83964
  resolved = "Character";
83906
83965
  extra = "4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.7.157",
3
+ "version": "2.7.159",
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.157",
29
+ "@abaplint/transpiler": "^2.7.159",
30
30
  "@types/glob": "^8.1.0",
31
31
  "glob": "=7.2.0",
32
32
  "@types/progress": "^2.0.7",
33
33
  "@types/node": "^20.11.19",
34
- "@abaplint/core": "^2.105.18",
34
+ "@abaplint/core": "^2.105.20",
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
  }