@abaplint/transpiler-cli 2.5.2 → 2.5.4

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 +38 -8
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -22546,7 +22546,7 @@ const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/
22546
22546
  const unknown_type_1 = __webpack_require__(/*! ../../types/basic/unknown_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js");
22547
22547
  const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
22548
22548
  class InlineFieldDefinition {
22549
- runSyntax(node, scope, filename) {
22549
+ runSyntax(node, scope, filename, targetType) {
22550
22550
  var _a;
22551
22551
  let type = undefined;
22552
22552
  const field = (_a = node.findDirectExpression(Expressions.Field)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
@@ -22561,6 +22561,9 @@ class InlineFieldDefinition {
22561
22561
  if (typeName) {
22562
22562
  type = new basic_types_1.BasicTypes(filename, scope).parseType(typeName);
22563
22563
  }
22564
+ if (targetType !== undefined) {
22565
+ type = targetType;
22566
+ }
22564
22567
  if (type === undefined) {
22565
22568
  type = new unknown_type_1.UnknownType("InlineFieldDefinition, fallback");
22566
22569
  }
@@ -23681,7 +23684,7 @@ const reduce_next_1 = __webpack_require__(/*! ./reduce_next */ "./node_modules/@
23681
23684
  const let_1 = __webpack_require__(/*! ./let */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/let.js");
23682
23685
  const _scope_type_1 = __webpack_require__(/*! ../_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
23683
23686
  class ReduceBody {
23684
- runSyntax(node, scope, filename) {
23687
+ runSyntax(node, scope, filename, targetType) {
23685
23688
  if (node === undefined) {
23686
23689
  return;
23687
23690
  }
@@ -23696,7 +23699,7 @@ class ReduceBody {
23696
23699
  scope.push(_scope_type_1.ScopeType.Let, "LET", node.getFirstToken().getStart(), filename);
23697
23700
  scoped = true;
23698
23701
  }
23699
- const found = new inline_field_definition_1.InlineFieldDefinition().runSyntax(i, scope, filename);
23702
+ const found = new inline_field_definition_1.InlineFieldDefinition().runSyntax(i, scope, filename, targetType);
23700
23703
  if (found && first === undefined) {
23701
23704
  first = found;
23702
23705
  }
@@ -23926,7 +23929,7 @@ class Source {
23926
23929
  case "REDUCE":
23927
23930
  {
23928
23931
  const foundType = this.determineType(node, scope, filename, targetType);
23929
- const bodyType = new reduce_body_1.ReduceBody().runSyntax(node.findDirectExpression(Expressions.ReduceBody), scope, filename);
23932
+ const bodyType = new reduce_body_1.ReduceBody().runSyntax(node.findDirectExpression(Expressions.ReduceBody), scope, filename, foundType);
23930
23933
  if (foundType === undefined) {
23931
23934
  this.addIfInferred(node, scope, filename, bodyType);
23932
23935
  }
@@ -35622,7 +35625,7 @@ const __1 = __webpack_require__(/*! ../.. */ "./node_modules/@abaplint/core/buil
35622
35625
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
35623
35626
  class CDSDefineProjection extends combi_1.Expression {
35624
35627
  getRunnable() {
35625
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), "VIEW", (0, combi_1.ver)(__1.Version.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, (0, combi_1.opt)((0, combi_1.seq)("PROVIDER CONTRACT", _1.CDSName)), "AS PROJECTION ON", _1.CDSName, (0, combi_1.str)("{"), (0, combi_1.plus)(_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
35628
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), "VIEW", (0, combi_1.ver)(__1.Version.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, (0, combi_1.opt)(_1.CDSProviderContract), "AS PROJECTION ON", _1.CDSName, (0, combi_1.opt)(_1.CDSAs), (0, combi_1.str)("{"), (0, combi_1.plus)(_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
35626
35629
  }
35627
35630
  }
35628
35631
  exports.CDSDefineProjection = CDSDefineProjection;
@@ -35672,7 +35675,7 @@ const cds_as_1 = __webpack_require__(/*! ./cds_as */ "./node_modules/@abaplint/c
35672
35675
  const cds_cast_1 = __webpack_require__(/*! ./cds_cast */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_cast.js");
35673
35676
  class CDSElement extends combi_1.Expression {
35674
35677
  getRunnable() {
35675
- return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSFunction, _1.CDSArithmetics, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)(_1.CDSParameters), (0, combi_1.star)((0, combi_1.seq)(".", _1.CDSName, (0, combi_1.opt)(_1.CDSParameters)))), (0, combi_1.regex)(/^\d+$/)), (0, combi_1.opt)(cds_as_1.CDSAs));
35678
+ return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSFunction, _1.CDSArithmetics, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)(_1.CDSName, ": REDIRECTED TO", (0, combi_1.opt)((0, combi_1.alt)("PARENT", "COMPOSITION CHILD")), _1.CDSName), (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)(_1.CDSParameters), (0, combi_1.star)((0, combi_1.seq)(".", _1.CDSName, (0, combi_1.opt)(_1.CDSParameters)))), (0, combi_1.regex)(/^\d+$/)), (0, combi_1.opt)(cds_as_1.CDSAs));
35676
35679
  }
35677
35680
  }
35678
35681
  exports.CDSElement = CDSElement;
@@ -35862,6 +35865,27 @@ exports.CDSParametersSelect = CDSParametersSelect;
35862
35865
 
35863
35866
  /***/ }),
35864
35867
 
35868
+ /***/ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_provider_contract.js":
35869
+ /*!****************************************************************************************!*\
35870
+ !*** ./node_modules/@abaplint/core/build/src/cds/expressions/cds_provider_contract.js ***!
35871
+ \****************************************************************************************/
35872
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
35873
+
35874
+ "use strict";
35875
+
35876
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
35877
+ exports.CDSProviderContract = void 0;
35878
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
35879
+ class CDSProviderContract extends combi_1.Expression {
35880
+ getRunnable() {
35881
+ return (0, combi_1.seq)("PROVIDER CONTRACT", (0, combi_1.alt)("TRANSACTIONAL_QUERY", "TRANSACTIONAL_INTERFACE", "ANALYTICAL_QUERY"));
35882
+ }
35883
+ }
35884
+ exports.CDSProviderContract = CDSProviderContract;
35885
+ //# sourceMappingURL=cds_provider_contract.js.map
35886
+
35887
+ /***/ }),
35888
+
35865
35889
  /***/ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_relation.js":
35866
35890
  /*!*******************************************************************************!*\
35867
35891
  !*** ./node_modules/@abaplint/core/build/src/cds/expressions/cds_relation.js ***!
@@ -36065,6 +36089,7 @@ __exportStar(__webpack_require__(/*! ./cds_define_view */ "./node_modules/@abapl
36065
36089
  __exportStar(__webpack_require__(/*! ./cds_element */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_element.js"), exports);
36066
36090
  __exportStar(__webpack_require__(/*! ./cds_function */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_function.js"), exports);
36067
36091
  __exportStar(__webpack_require__(/*! ./cds_group_by */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_group_by.js"), exports);
36092
+ __exportStar(__webpack_require__(/*! ./cds_provider_contract */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_provider_contract.js"), exports);
36068
36093
  __exportStar(__webpack_require__(/*! ./cds_integer */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_integer.js"), exports);
36069
36094
  __exportStar(__webpack_require__(/*! ./cds_join */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_join.js"), exports);
36070
36095
  __exportStar(__webpack_require__(/*! ./cds_name */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_name.js"), exports);
@@ -40977,7 +41002,12 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
40977
41002
  let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);
40978
41003
  if (found === undefined) {
40979
41004
  const list = e.findDirectExpressions(expressions_1.CDSName);
40980
- found = list[list.length - 1];
41005
+ if (e.concatTokens().toUpperCase().includes(" REDIRECTED TO ")) {
41006
+ found = list[0];
41007
+ }
41008
+ else {
41009
+ found = list[list.length - 1];
41010
+ }
40981
41011
  }
40982
41012
  if (found === undefined) {
40983
41013
  continue;
@@ -45986,7 +46016,7 @@ class Registry {
45986
46016
  }
45987
46017
  static abaplintVersion() {
45988
46018
  // magic, see build script "version.sh"
45989
- return "2.95.19";
46019
+ return "2.95.23";
45990
46020
  }
45991
46021
  getDDICReferences() {
45992
46022
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
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.5.2",
28
+ "@abaplint/transpiler": "^2.5.4",
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.19",
32
+ "@abaplint/core": "^2.95.23",
33
33
  "progress": "^2.0.3",
34
34
  "webpack": "^5.75.0",
35
35
  "webpack-cli": "^5.0.1",