@abaplint/transpiler-cli 2.7.94 → 2.7.96

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 +276 -37
  2. package/package.json +4 -4
package/build/bundle.js CHANGED
@@ -9230,7 +9230,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
9230
9230
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
9231
9231
  class CloseCursor {
9232
9232
  getMatcher() {
9233
- const ret = (0, combi_1.seq)("CLOSE CURSOR", expressions_1.SQLSource);
9233
+ const ret = (0, combi_1.seq)("CLOSE CURSOR", expressions_1.SQLSourceSimple);
9234
9234
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
9235
9235
  }
9236
9236
  }
@@ -11046,8 +11046,8 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
11046
11046
  const sql_into_structure_1 = __webpack_require__(/*! ../expressions/sql_into_structure */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_into_structure.js");
11047
11047
  class FetchNextCursor {
11048
11048
  getMatcher() {
11049
- const size = (0, combi_1.seq)("PACKAGE SIZE", expressions_1.SQLSource);
11050
- const ret = (0, combi_1.seq)("FETCH NEXT CURSOR", expressions_1.SQLSource, (0, combi_1.alt)(sql_into_structure_1.SQLIntoStructure, expressions_1.SQLIntoTable), (0, combi_1.opt)(size));
11049
+ const size = (0, combi_1.seq)("PACKAGE SIZE", expressions_1.SQLSourceSimple);
11050
+ const ret = (0, combi_1.seq)("FETCH NEXT CURSOR", expressions_1.SQLSourceSimple, (0, combi_1.alt)(sql_into_structure_1.SQLIntoStructure, expressions_1.SQLIntoTable), (0, combi_1.optPrio)(size));
11051
11051
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
11052
11052
  }
11053
11053
  }
@@ -12705,10 +12705,11 @@ class Loop {
12705
12705
  getMatcher() {
12706
12706
  const where = (0, combi_1.seq)("WHERE", (0, combi_1.alt)(expressions_1.ComponentCond, expressions_1.Dynamic));
12707
12707
  const group = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)("GROUP BY", loop_group_by_1.LoopGroupBy));
12708
+ const step = (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)("STEP", expressions_1.Source));
12708
12709
  const from = (0, combi_1.seq)("FROM", expressions_1.Source);
12709
12710
  const to = (0, combi_1.seq)("TO", expressions_1.Source);
12710
12711
  const usingKey = (0, combi_1.seq)("USING KEY", (0, combi_1.altPrio)(expressions_1.SimpleName, expressions_1.Dynamic));
12711
- const options = (0, combi_1.per)(expressions_1.LoopTarget, from, to, where, usingKey, group);
12712
+ const options = (0, combi_1.per)(expressions_1.LoopTarget, from, to, where, usingKey, group, step);
12712
12713
  const at = (0, combi_1.seq)("AT", (0, combi_1.opt)((0, combi_1.seq)("SCREEN", (0, combi_1.failCombinator)())), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp08, "GROUP")), (0, combi_1.alt)(simple_source2_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(options));
12713
12714
  return (0, combi_1.seq)("LOOP", (0, combi_1.opt)(at));
12714
12715
  }
@@ -13220,7 +13221,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
13220
13221
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
13221
13222
  class OpenCursor {
13222
13223
  getMatcher() {
13223
- const ret = (0, combi_1.seq)("OPEN CURSOR", (0, combi_1.optPrio)("WITH HOLD"), expressions_1.SQLTarget, "FOR", expressions_1.Select, (0, combi_1.optPrio)(expressions_1.SQLHints));
13224
+ const ret = (0, combi_1.seq)("OPEN CURSOR", (0, combi_1.optPrio)("WITH HOLD"), expressions_1.SQLTarget, "FOR", expressions_1.Select, (0, combi_1.optPrio)(expressions_1.DatabaseConnection), (0, combi_1.optPrio)(expressions_1.SQLHints));
13224
13225
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
13225
13226
  }
13226
13227
  }
@@ -13812,7 +13813,7 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
13812
13813
  class ReadTextpool {
13813
13814
  getMatcher() {
13814
13815
  const language = (0, combi_1.seq)("LANGUAGE", expressions_1.Source);
13815
- const into = (0, combi_1.seq)("INTO", expressions_1.Target);
13816
+ const into = (0, combi_1.seq)("INTO", expressions_1.SimpleTarget);
13816
13817
  const state = (0, combi_1.seq)("STATE", expressions_1.Source);
13817
13818
  const ret = (0, combi_1.seq)("READ TEXTPOOL", expressions_1.Source, (0, combi_1.per)(into, language, state));
13818
13819
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
@@ -18438,8 +18439,14 @@ class BuiltIn {
18438
18439
  }
18439
18440
  getTypes() {
18440
18441
  const ret = this.buildSY();
18441
- const id = new tokens_1.Identifier(new position_1.Position(1, 1), "abap_bool");
18442
- ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" })));
18442
+ {
18443
+ const id = new tokens_1.Identifier(new position_1.Position(1, 1), "abap_bool");
18444
+ ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" })));
18445
+ }
18446
+ {
18447
+ const id = new tokens_1.Identifier(new position_1.Position(1, 1), "cursor");
18448
+ ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, basic_1.IntegerType.get({ qualifiedName: "CURSOR", ddicName: "CURSOR" })));
18449
+ }
18443
18450
  return ret;
18444
18451
  }
18445
18452
  get(extras) {
@@ -20815,18 +20822,23 @@ class TypeUtils {
20815
20822
  }
20816
20823
  return true;
20817
20824
  }
20818
- else if (source instanceof basic_1.StructureType && target instanceof basic_1.StructureType) {
20819
- const sourceComponents = source.getComponents();
20820
- const targetComponents = target.getComponents();
20821
- if (sourceComponents.length !== targetComponents.length) {
20822
- return false;
20823
- }
20824
- for (let i = 0; i < sourceComponents.length; i++) {
20825
- if (this.isAssignableStrict(sourceComponents[i].type, targetComponents[i].type) === false) {
20825
+ else if (source instanceof basic_1.StructureType) {
20826
+ if (target instanceof basic_1.StructureType) {
20827
+ const sourceComponents = source.getComponents();
20828
+ const targetComponents = target.getComponents();
20829
+ if (sourceComponents.length !== targetComponents.length) {
20826
20830
  return false;
20827
20831
  }
20832
+ for (let i = 0; i < sourceComponents.length; i++) {
20833
+ if (this.isAssignableStrict(sourceComponents[i].type, targetComponents[i].type) === false) {
20834
+ return false;
20835
+ }
20836
+ }
20837
+ return true;
20838
+ }
20839
+ else if (target instanceof basic_1.CharacterType) {
20840
+ return false;
20828
20841
  }
20829
- return true;
20830
20842
  }
20831
20843
  else if (source instanceof basic_1.Integer8Type) {
20832
20844
  if (target instanceof basic_1.IntegerType || target instanceof basic_1.StringType) {
@@ -20954,6 +20966,9 @@ class TypeUtils {
20954
20966
  else if (target.containsVoid() === true) {
20955
20967
  return true;
20956
20968
  }
20969
+ else if (source instanceof basic_1.StringType && this.structureContainsString(target)) {
20970
+ return false;
20971
+ }
20957
20972
  else if (source instanceof basic_1.IntegerType) {
20958
20973
  return false;
20959
20974
  }
@@ -29567,7 +29582,7 @@ class ReadTextpool {
29567
29582
  for (const s of node.findDirectExpressions(Expressions.Source)) {
29568
29583
  new source_1.Source().runSyntax(s, scope, filename);
29569
29584
  }
29570
- for (const t of node.findDirectExpressions(Expressions.Target)) {
29585
+ for (const t of node.findDirectExpressions(Expressions.SimpleTarget)) {
29571
29586
  new target_1.Target().runSyntax(t, scope, filename);
29572
29587
  }
29573
29588
  }
@@ -38727,8 +38742,12 @@ class AbstractFile {
38727
38742
  // handle additional escaping
38728
38743
  split[0] = split[0].replace(/%3e/g, ">");
38729
38744
  split[0] = split[0].replace(/%3c/g, "<");
38730
- // handle namespace
38731
- return split[0].toUpperCase().replace(/#/g, "/");
38745
+ // handle abapGit namespace
38746
+ split[0] = split[0].toUpperCase().replace(/#/g, "/");
38747
+ // handle AFF namespace
38748
+ split[0] = split[0].replace("(", "/");
38749
+ split[0] = split[0].replace(")", "/");
38750
+ return split[0];
38732
38751
  }
38733
38752
  }
38734
38753
  exports.AbstractFile = AbstractFile;
@@ -41482,6 +41501,68 @@ exports.APIReleaseState = APIReleaseState;
41482
41501
 
41483
41502
  /***/ }),
41484
41503
 
41504
+ /***/ "./node_modules/@abaplint/core/build/src/objects/application_job_catalog_entry.js":
41505
+ /*!****************************************************************************************!*\
41506
+ !*** ./node_modules/@abaplint/core/build/src/objects/application_job_catalog_entry.js ***!
41507
+ \****************************************************************************************/
41508
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
41509
+
41510
+ "use strict";
41511
+
41512
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
41513
+ exports.ApplicationJobCatalogEntry = void 0;
41514
+ const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
41515
+ class ApplicationJobCatalogEntry extends _abstract_object_1.AbstractObject {
41516
+ getType() {
41517
+ return "SAJC";
41518
+ }
41519
+ getAllowedNaming() {
41520
+ return {
41521
+ maxLength: 30,
41522
+ allowNamespace: true,
41523
+ };
41524
+ }
41525
+ getDescription() {
41526
+ // todo
41527
+ return undefined;
41528
+ }
41529
+ }
41530
+ exports.ApplicationJobCatalogEntry = ApplicationJobCatalogEntry;
41531
+ //# sourceMappingURL=application_job_catalog_entry.js.map
41532
+
41533
+ /***/ }),
41534
+
41535
+ /***/ "./node_modules/@abaplint/core/build/src/objects/application_job_template.js":
41536
+ /*!***********************************************************************************!*\
41537
+ !*** ./node_modules/@abaplint/core/build/src/objects/application_job_template.js ***!
41538
+ \***********************************************************************************/
41539
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
41540
+
41541
+ "use strict";
41542
+
41543
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
41544
+ exports.ApplicationJobTemplate = void 0;
41545
+ const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
41546
+ class ApplicationJobTemplate extends _abstract_object_1.AbstractObject {
41547
+ getType() {
41548
+ return "SAJT";
41549
+ }
41550
+ getAllowedNaming() {
41551
+ return {
41552
+ maxLength: 30,
41553
+ allowNamespace: true,
41554
+ };
41555
+ }
41556
+ getDescription() {
41557
+ // todo
41558
+ return undefined;
41559
+ }
41560
+ }
41561
+ exports.ApplicationJobTemplate = ApplicationJobTemplate;
41562
+ //# sourceMappingURL=application_job_template.js.map
41563
+
41564
+ /***/ }),
41565
+
41485
41566
  /***/ "./node_modules/@abaplint/core/build/src/objects/assignment_service_to_authorization_group.js":
41486
41567
  /*!****************************************************************************************************!*\
41487
41568
  !*** ./node_modules/@abaplint/core/build/src/objects/assignment_service_to_authorization_group.js ***!
@@ -44314,6 +44395,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
44314
44395
  Object.defineProperty(exports, "__esModule", ({ value: true }));
44315
44396
  __exportStar(__webpack_require__(/*! ./activation_variant */ "./node_modules/@abaplint/core/build/src/objects/activation_variant.js"), exports);
44316
44397
  __exportStar(__webpack_require__(/*! ./api_release_state */ "./node_modules/@abaplint/core/build/src/objects/api_release_state.js"), exports);
44398
+ __exportStar(__webpack_require__(/*! ./application_job_catalog_entry */ "./node_modules/@abaplint/core/build/src/objects/application_job_catalog_entry.js"), exports);
44399
+ __exportStar(__webpack_require__(/*! ./application_job_template */ "./node_modules/@abaplint/core/build/src/objects/application_job_template.js"), exports);
44317
44400
  __exportStar(__webpack_require__(/*! ./assignment_service_to_authorization_group */ "./node_modules/@abaplint/core/build/src/objects/assignment_service_to_authorization_group.js"), exports);
44318
44401
  __exportStar(__webpack_require__(/*! ./atc_check_category */ "./node_modules/@abaplint/core/build/src/objects/atc_check_category.js"), exports);
44319
44402
  __exportStar(__webpack_require__(/*! ./atc_check_object */ "./node_modules/@abaplint/core/build/src/objects/atc_check_object.js"), exports);
@@ -44393,6 +44476,7 @@ __exportStar(__webpack_require__(/*! ./mime_object */ "./node_modules/@abaplint/
44393
44476
  __exportStar(__webpack_require__(/*! ./namespace */ "./node_modules/@abaplint/core/build/src/objects/namespace.js"), exports);
44394
44477
  __exportStar(__webpack_require__(/*! ./number_range */ "./node_modules/@abaplint/core/build/src/objects/number_range.js"), exports);
44395
44478
  __exportStar(__webpack_require__(/*! ./object_characteristic */ "./node_modules/@abaplint/core/build/src/objects/object_characteristic.js"), exports);
44479
+ __exportStar(__webpack_require__(/*! ./outbound_service */ "./node_modules/@abaplint/core/build/src/objects/outbound_service.js"), exports);
44396
44480
  __exportStar(__webpack_require__(/*! ./package_interface */ "./node_modules/@abaplint/core/build/src/objects/package_interface.js"), exports);
44397
44481
  __exportStar(__webpack_require__(/*! ./package */ "./node_modules/@abaplint/core/build/src/objects/package.js"), exports);
44398
44482
  __exportStar(__webpack_require__(/*! ./parameter */ "./node_modules/@abaplint/core/build/src/objects/parameter.js"), exports);
@@ -45045,6 +45129,37 @@ exports.ObjectCharacteristic = ObjectCharacteristic;
45045
45129
 
45046
45130
  /***/ }),
45047
45131
 
45132
+ /***/ "./node_modules/@abaplint/core/build/src/objects/outbound_service.js":
45133
+ /*!***************************************************************************!*\
45134
+ !*** ./node_modules/@abaplint/core/build/src/objects/outbound_service.js ***!
45135
+ \***************************************************************************/
45136
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
45137
+
45138
+ "use strict";
45139
+
45140
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
45141
+ exports.OutboundService = void 0;
45142
+ const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
45143
+ class OutboundService extends _abstract_object_1.AbstractObject {
45144
+ getType() {
45145
+ return "SCO3";
45146
+ }
45147
+ getAllowedNaming() {
45148
+ return {
45149
+ maxLength: 200,
45150
+ allowNamespace: true,
45151
+ };
45152
+ }
45153
+ getDescription() {
45154
+ // todo
45155
+ return undefined;
45156
+ }
45157
+ }
45158
+ exports.OutboundService = OutboundService;
45159
+ //# sourceMappingURL=outbound_service.js.map
45160
+
45161
+ /***/ }),
45162
+
45048
45163
  /***/ "./node_modules/@abaplint/core/build/src/objects/package.js":
45049
45164
  /*!******************************************************************!*\
45050
45165
  !*** ./node_modules/@abaplint/core/build/src/objects/package.js ***!
@@ -45824,9 +45939,10 @@ class RenamerHelper {
45824
45939
  renameFiles(obj, oldName, name) {
45825
45940
  const list = [];
45826
45941
  const newName = name.toLowerCase().replace(/\//g, "#");
45942
+ oldName = oldName.toLowerCase().replace(/\//g, "#");
45827
45943
  for (const f of obj.getFiles()) {
45828
45944
  // todo, this is not completely correct, ie. if the URI contains the same directory name as the object name
45829
- const newFilename = f.getFilename().replace(oldName.toLowerCase(), newName.toLowerCase());
45945
+ const newFilename = f.getFilename().replace(oldName, newName);
45830
45946
  list.push(vscode_languageserver_types_1.RenameFile.create(f.getFilename(), newFilename));
45831
45947
  }
45832
45948
  return list;
@@ -47831,7 +47947,7 @@ class Registry {
47831
47947
  }
47832
47948
  static abaplintVersion() {
47833
47949
  // magic, see build script "version.sh"
47834
- return "2.102.34";
47950
+ return "2.102.40";
47835
47951
  }
47836
47952
  getDDICReferences() {
47837
47953
  return this.ddicReferences;
@@ -51043,6 +51159,9 @@ class CloudTypes {
51043
51159
  || obj instanceof Objects.CDSMetadataExtension
51044
51160
  || obj instanceof Objects.RestrictionField
51045
51161
  || obj instanceof Objects.Class
51162
+ || obj instanceof Objects.OutboundService
51163
+ || obj instanceof Objects.ApplicationJobCatalogEntry
51164
+ || obj instanceof Objects.ApplicationJobTemplate
51046
51165
  || obj instanceof Objects.CommunicationScenario
51047
51166
  || obj instanceof Objects.DataControl
51048
51167
  || obj instanceof Objects.DataDefinition
@@ -59935,7 +60054,7 @@ class MessageExistsRule {
59935
60054
  const msag = this.reg.getObject("MSAG", ref.messageClass);
59936
60055
  if (msag === undefined) {
59937
60056
  if (new ddic_1.DDIC(this.reg).inErrorNamespace(ref.messageClass) === true) {
59938
- const message = "Message class \"" + ref.token.getStr() + "\" not found";
60057
+ const message = "Message class \"" + ref.messageClass + "\" not found";
59939
60058
  issues.push(issue_1.Issue.atToken(file, ref.token, message, this.getMetadata().key, this.conf.severity));
59940
60059
  }
59941
60060
  continue;
@@ -71274,6 +71393,7 @@ __exportStar(__webpack_require__(/*! ./source */ "./node_modules/@abaplint/trans
71274
71393
  __exportStar(__webpack_require__(/*! ./sql_arithmetic_operator */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_arithmetic_operator.js"), exports);
71275
71394
  __exportStar(__webpack_require__(/*! ./sql_cond */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_cond.js"), exports);
71276
71395
  __exportStar(__webpack_require__(/*! ./sql_field_and_value */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_field_and_value.js"), exports);
71396
+ __exportStar(__webpack_require__(/*! ./sql_field_list */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_field_list.js"), exports);
71277
71397
  __exportStar(__webpack_require__(/*! ./sql_field_name */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_field_name.js"), exports);
71278
71398
  __exportStar(__webpack_require__(/*! ./sql_field */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_field.js"), exports);
71279
71399
  __exportStar(__webpack_require__(/*! ./sql_from_source */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_from_source.js"), exports);
@@ -72392,6 +72512,44 @@ exports.SQLFieldAndValueTranspiler = SQLFieldAndValueTranspiler;
72392
72512
 
72393
72513
  /***/ }),
72394
72514
 
72515
+ /***/ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_field_list.js":
72516
+ /*!***********************************************************************************!*\
72517
+ !*** ./node_modules/@abaplint/transpiler/build/src/expressions/sql_field_list.js ***!
72518
+ \***********************************************************************************/
72519
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
72520
+
72521
+ "use strict";
72522
+
72523
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
72524
+ exports.SQLFieldListTranspiler = void 0;
72525
+ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
72526
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
72527
+ const sql_field_1 = __webpack_require__(/*! ./sql_field */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_field.js");
72528
+ const sql_field_name_1 = __webpack_require__(/*! ./sql_field_name */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_field_name.js");
72529
+ class SQLFieldListTranspiler {
72530
+ transpile(node, traversal) {
72531
+ const fields = [];
72532
+ for (const f of node.getChildren() || []) {
72533
+ if (f instanceof abaplint.Nodes.ExpressionNode && f.get() instanceof abaplint.Expressions.SQLField) {
72534
+ const code = new sql_field_1.SQLFieldTranspiler().transpile(f, traversal).getCode();
72535
+ fields.push(code);
72536
+ }
72537
+ else if (f instanceof abaplint.Nodes.ExpressionNode && f.get() instanceof abaplint.Expressions.SQLFieldName) {
72538
+ const code = new sql_field_name_1.SQLFieldNameTranspiler().transpile(f, traversal).getCode();
72539
+ fields.push(code);
72540
+ }
72541
+ else {
72542
+ fields.push(f.concatTokens());
72543
+ }
72544
+ }
72545
+ return new chunk_1.Chunk().append(fields.join(", "), node, traversal);
72546
+ }
72547
+ }
72548
+ exports.SQLFieldListTranspiler = SQLFieldListTranspiler;
72549
+ //# sourceMappingURL=sql_field_list.js.map
72550
+
72551
+ /***/ }),
72552
+
72395
72553
  /***/ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_field_name.js":
72396
72554
  /*!***********************************************************************************!*\
72397
72555
  !*** ./node_modules/@abaplint/transpiler/build/src/expressions/sql_field_name.js ***!
@@ -74809,6 +74967,29 @@ exports.ClearTranspiler = ClearTranspiler;
74809
74967
 
74810
74968
  /***/ }),
74811
74969
 
74970
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/close_cursor.js":
74971
+ /*!********************************************************************************!*\
74972
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/close_cursor.js ***!
74973
+ \********************************************************************************/
74974
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
74975
+
74976
+ "use strict";
74977
+
74978
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
74979
+ exports.CloseCursorTranspiler = void 0;
74980
+ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
74981
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
74982
+ class CloseCursorTranspiler {
74983
+ transpile(node, traversal) {
74984
+ const cursor = traversal.traverse(node.findFirstExpression(abaplint.Expressions.SQLSourceSimple)).getCode();
74985
+ return new chunk_1.Chunk().append(`await abap.statements.closeCursor(${cursor});`, node, traversal);
74986
+ }
74987
+ }
74988
+ exports.CloseCursorTranspiler = CloseCursorTranspiler;
74989
+ //# sourceMappingURL=close_cursor.js.map
74990
+
74991
+ /***/ }),
74992
+
74812
74993
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/close_dataset.js":
74813
74994
  /*!*********************************************************************************!*\
74814
74995
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/close_dataset.js ***!
@@ -76023,6 +76204,36 @@ exports.ExportTranspiler = ExportTranspiler;
76023
76204
 
76024
76205
  /***/ }),
76025
76206
 
76207
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/fetch_next_cursor.js":
76208
+ /*!*************************************************************************************!*\
76209
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/fetch_next_cursor.js ***!
76210
+ \*************************************************************************************/
76211
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
76212
+
76213
+ "use strict";
76214
+
76215
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
76216
+ exports.FetchNextCursorTranspiler = void 0;
76217
+ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
76218
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
76219
+ class FetchNextCursorTranspiler {
76220
+ transpile(node, traversal) {
76221
+ const cursor = traversal.traverse(node.findFirstExpression(abaplint.Expressions.SQLSourceSimple)).getCode();
76222
+ // todo: APPENDING and CORRESPONDING FIELDS
76223
+ const target = traversal.traverse(node.findFirstExpression(abaplint.Expressions.SQLTarget)).getCode();
76224
+ let packageSize = "";
76225
+ const siz = node.findExpressionAfterToken("SIZE");
76226
+ if (siz) {
76227
+ packageSize = ", " + traversal.traverse(siz).getCode();
76228
+ }
76229
+ return new chunk_1.Chunk().append(`await abap.statements.fetchNextCursor(${cursor}, ${target}${packageSize});`, node, traversal);
76230
+ }
76231
+ }
76232
+ exports.FetchNextCursorTranspiler = FetchNextCursorTranspiler;
76233
+ //# sourceMappingURL=fetch_next_cursor.js.map
76234
+
76235
+ /***/ }),
76236
+
76026
76237
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/field_symbol.js":
76027
76238
  /*!********************************************************************************!*\
76028
76239
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/field_symbol.js ***!
@@ -76572,6 +76783,9 @@ __exportStar(__webpack_require__(/*! ./class_definition_load */ "./node_modules/
76572
76783
  __exportStar(__webpack_require__(/*! ./class_implementation */ "./node_modules/@abaplint/transpiler/build/src/statements/class_implementation.js"), exports);
76573
76784
  __exportStar(__webpack_require__(/*! ./class_local_friends */ "./node_modules/@abaplint/transpiler/build/src/statements/class_local_friends.js"), exports);
76574
76785
  __exportStar(__webpack_require__(/*! ./clear */ "./node_modules/@abaplint/transpiler/build/src/statements/clear.js"), exports);
76786
+ __exportStar(__webpack_require__(/*! ./open_cursor */ "./node_modules/@abaplint/transpiler/build/src/statements/open_cursor.js"), exports);
76787
+ __exportStar(__webpack_require__(/*! ./close_cursor */ "./node_modules/@abaplint/transpiler/build/src/statements/close_cursor.js"), exports);
76788
+ __exportStar(__webpack_require__(/*! ./fetch_next_cursor */ "./node_modules/@abaplint/transpiler/build/src/statements/fetch_next_cursor.js"), exports);
76575
76789
  __exportStar(__webpack_require__(/*! ./close_dataset */ "./node_modules/@abaplint/transpiler/build/src/statements/close_dataset.js"), exports);
76576
76790
  __exportStar(__webpack_require__(/*! ./collect */ "./node_modules/@abaplint/transpiler/build/src/statements/collect.js"), exports);
76577
76791
  __exportStar(__webpack_require__(/*! ./commit */ "./node_modules/@abaplint/transpiler/build/src/statements/commit.js"), exports);
@@ -77548,6 +77762,41 @@ exports.MoveCorrespondingTranspiler = MoveCorrespondingTranspiler;
77548
77762
 
77549
77763
  /***/ }),
77550
77764
 
77765
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/open_cursor.js":
77766
+ /*!*******************************************************************************!*\
77767
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/open_cursor.js ***!
77768
+ \*******************************************************************************/
77769
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
77770
+
77771
+ "use strict";
77772
+
77773
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
77774
+ exports.OpenCursorTranspiler = void 0;
77775
+ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
77776
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
77777
+ class OpenCursorTranspiler {
77778
+ transpile(node, traversal) {
77779
+ const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.SQLTarget)).getCode();
77780
+ const selectExpression = node.findDirectExpression(abaplint.Expressions.Select);
77781
+ let select = "SELECT ";
77782
+ select += traversal.traverse(selectExpression === null || selectExpression === void 0 ? void 0 : selectExpression.findDirectExpression(abaplint.Expressions.SQLFieldList)).getCode() + " ";
77783
+ select += traversal.traverse(selectExpression === null || selectExpression === void 0 ? void 0 : selectExpression.findDirectExpression(abaplint.Expressions.SQLFrom)).getCode();
77784
+ const cond = selectExpression === null || selectExpression === void 0 ? void 0 : selectExpression.findDirectExpression(abaplint.Expressions.SQLCond);
77785
+ if (cond) {
77786
+ select += "WHERE " + traversal.traverse(node).getCode();
77787
+ }
77788
+ const orderBy = selectExpression === null || selectExpression === void 0 ? void 0 : selectExpression.findDirectExpression(abaplint.Expressions.SQLOrderBy);
77789
+ if (orderBy) {
77790
+ select += "ORDER BY " + traversal.traverse(node).getCode();
77791
+ }
77792
+ return new chunk_1.Chunk().append(`await abap.statements.openCursor(${target}, "${select}");`, node, traversal);
77793
+ }
77794
+ }
77795
+ exports.OpenCursorTranspiler = OpenCursorTranspiler;
77796
+ //# sourceMappingURL=open_cursor.js.map
77797
+
77798
+ /***/ }),
77799
+
77551
77800
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/open_dataset.js":
77552
77801
  /*!********************************************************************************!*\
77553
77802
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/open_dataset.js ***!
@@ -78296,21 +78545,10 @@ class SelectTranspiler {
78296
78545
  let select = "SELECT ";
78297
78546
  const fieldList = node.findFirstExpression(abaplint.Expressions.SQLFieldList)
78298
78547
  || node.findFirstExpression(abaplint.Expressions.SQLFieldListLoop);
78299
- const fields = [];
78300
- for (const f of (fieldList === null || fieldList === void 0 ? void 0 : fieldList.getChildren()) || []) {
78301
- if (f instanceof abaplint.Nodes.ExpressionNode && f.get() instanceof abaplint.Expressions.SQLField) {
78302
- const code = new expressions_1.SQLFieldTranspiler().transpile(f, traversal).getCode();
78303
- fields.push(code);
78304
- }
78305
- else if (f instanceof abaplint.Nodes.ExpressionNode && f.get() instanceof abaplint.Expressions.SQLFieldName) {
78306
- const code = new expressions_1.SQLFieldNameTranspiler().transpile(f, traversal).getCode();
78307
- fields.push(code);
78308
- }
78309
- else {
78310
- fields.push(f.concatTokens());
78311
- }
78548
+ if (fieldList === undefined) {
78549
+ throw new Error("SelectTranspiler, field list not found");
78312
78550
  }
78313
- select += fields.join(", ") + " ";
78551
+ select += new expressions_1.SQLFieldListTranspiler().transpile(fieldList, traversal).getCode() + " ";
78314
78552
  const from = node.findFirstExpression(abaplint.Expressions.SQLFrom);
78315
78553
  if (from) {
78316
78554
  select += new sql_from_1.SQLFromTranspiler().transpile(from, traversal).getCode();
@@ -80331,6 +80569,7 @@ class SelectTranspiler {
80331
80569
  const loopName = unique_identifier_1.UniqueIdentifier.get();
80332
80570
  ret.appendString(`let ${targetName} = new abap.types.Table(abap.DDIC["${from}"].type);\n`);
80333
80571
  ret.appendChunk(new select_1.SelectTranspiler().transpile(selectStatement, traversal, targetName));
80572
+ // todo: optimize, it should do real streaming?
80334
80573
  const packageSize = (_b = node.findFirstExpression(abaplint.Expressions.SelectLoop)) === null || _b === void 0 ? void 0 : _b.findExpressionAfterToken("SIZE");
80335
80574
  if (packageSize) {
80336
80575
  const getSize = new expressions_1.SQLSourceTranspiler().transpile(packageSize, traversal).getCode() + ".get()";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.7.94",
3
+ "version": "2.7.96",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -26,12 +26,12 @@
26
26
  "author": "abaplint",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@abaplint/transpiler": "^2.7.94",
29
+ "@abaplint/transpiler": "^2.7.96",
30
30
  "@types/glob": "^7.2.0",
31
31
  "glob": "=7.2.0",
32
32
  "@types/progress": "^2.0.5",
33
- "@types/node": "^20.5.9",
34
- "@abaplint/core": "^2.102.34",
33
+ "@types/node": "^20.6.0",
34
+ "@abaplint/core": "^2.102.40",
35
35
  "progress": "^2.0.3",
36
36
  "webpack": "^5.88.2",
37
37
  "webpack-cli": "^5.1.4",