@abaplint/transpiler-cli 2.5.64 → 2.5.66

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 +55 -2
  2. package/package.json +4 -4
package/build/bundle.js CHANGED
@@ -68317,6 +68317,7 @@ __exportStar(__webpack_require__(/*! ./sql_from_source */ "./node_modules/@abapl
68317
68317
  __exportStar(__webpack_require__(/*! ./sql_from */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_from.js"), exports);
68318
68318
  __exportStar(__webpack_require__(/*! ./sql_join */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_join.js"), exports);
68319
68319
  __exportStar(__webpack_require__(/*! ./sql_source_simple */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_source_simple.js"), exports);
68320
+ __exportStar(__webpack_require__(/*! ./sql_into_structure */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_into_structure.js"), exports);
68320
68321
  __exportStar(__webpack_require__(/*! ./sql_source */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_source.js"), exports);
68321
68322
  __exportStar(__webpack_require__(/*! ./sql_target */ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_target.js"), exports);
68322
68323
  __exportStar(__webpack_require__(/*! ./string_template_source */ "./node_modules/@abaplint/transpiler/build/src/expressions/string_template_source.js"), exports);
@@ -69412,6 +69413,39 @@ exports.SQLFromSourceTranspiler = SQLFromSourceTranspiler;
69412
69413
 
69413
69414
  /***/ }),
69414
69415
 
69416
+ /***/ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_into_structure.js":
69417
+ /*!***************************************************************************************!*\
69418
+ !*** ./node_modules/@abaplint/transpiler/build/src/expressions/sql_into_structure.js ***!
69419
+ \***************************************************************************************/
69420
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
69421
+
69422
+ "use strict";
69423
+
69424
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
69425
+ exports.SQLIntoStructureTranspiler = void 0;
69426
+ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
69427
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
69428
+ class SQLIntoStructureTranspiler {
69429
+ transpile(node, traversal) {
69430
+ const targets = node.findDirectExpressions(abaplint.Expressions.SQLTarget);
69431
+ const transpiled = targets.map(t => traversal.traverse(t));
69432
+ if (targets.length === 1) {
69433
+ return transpiled[0];
69434
+ }
69435
+ else {
69436
+ const chunk = new chunk_1.Chunk();
69437
+ chunk.appendString("[");
69438
+ chunk.appendString(transpiled.map(t => t.getCode()).join(","));
69439
+ chunk.appendString("]");
69440
+ return chunk;
69441
+ }
69442
+ }
69443
+ }
69444
+ exports.SQLIntoStructureTranspiler = SQLIntoStructureTranspiler;
69445
+ //# sourceMappingURL=sql_into_structure.js.map
69446
+
69447
+ /***/ }),
69448
+
69415
69449
  /***/ "./node_modules/@abaplint/transpiler/build/src/expressions/sql_join.js":
69416
69450
  /*!*****************************************************************************!*\
69417
69451
  !*** ./node_modules/@abaplint/transpiler/build/src/expressions/sql_join.js ***!
@@ -71453,7 +71487,8 @@ class ClassImplementationTranspiler {
71453
71487
  const scope = traversal.findCurrentScopeByToken(token);
71454
71488
  return new chunk_1.Chunk().append(ret + ` {
71455
71489
  static INTERNAL_TYPE = 'CLAS';
71456
- static IMPLEMENTED_INTERFACES = [${this.findImplementedClass(traversal, def, scope).map(e => `"` + e.toUpperCase() + `"`).join(",")}];`, node, traversal);
71490
+ static IMPLEMENTED_INTERFACES = [${this.findImplementedClass(traversal, def, scope).map(e => `"` + e.toUpperCase() + `"`).join(",")}];
71491
+ static ATTRIBUTES = {};`, node, traversal);
71457
71492
  }
71458
71493
  findImplementedInterface(traversal, def, scope) {
71459
71494
  if (def === undefined || scope === undefined) {
@@ -74815,6 +74850,7 @@ const sql_from_1 = __webpack_require__(/*! ../expressions/sql_from */ "./node_mo
74815
74850
  function escapeRegExp(string) {
74816
74851
  return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
74817
74852
  }
74853
+ // TODO: currently SELECT into are always handled as CORRESPONDING
74818
74854
  class SelectTranspiler {
74819
74855
  transpile(node, traversal, targetOverride) {
74820
74856
  var _a;
@@ -74822,9 +74858,12 @@ class SelectTranspiler {
74822
74858
  if (targetOverride) {
74823
74859
  target = targetOverride;
74824
74860
  }
74825
- else if (node.findFirstExpression(abaplint.Expressions.Target)) {
74861
+ else if (node.findFirstExpression(abaplint.Expressions.SQLIntoTable)) {
74826
74862
  target = traversal.traverse(node.findFirstExpression(abaplint.Expressions.Target)).getCode();
74827
74863
  }
74864
+ else if (node.findFirstExpression(abaplint.Expressions.SQLIntoStructure)) {
74865
+ target = traversal.traverse(node.findFirstExpression(abaplint.Expressions.SQLIntoStructure)).getCode();
74866
+ }
74828
74867
  let select = "SELECT ";
74829
74868
  const fieldList = node.findFirstExpression(abaplint.Expressions.SQLFieldList)
74830
74869
  || node.findFirstExpression(abaplint.Expressions.SQLFieldListLoop);
@@ -76103,6 +76142,7 @@ class ClassDefinitionTranspiler {
76103
76142
  return new chunk_1.Chunk(`
76104
76143
  class ${className === null || className === void 0 ? void 0 : className.toLowerCase()} {
76105
76144
  static INTERNAL_TYPE = 'CLAS';
76145
+ static ATTRIBUTES = {};
76106
76146
  async constructor_() {
76107
76147
  this.me = new abap.types.ABAPObject();
76108
76148
  this.me.set(this);
@@ -76570,6 +76610,7 @@ class InterfaceTranspiler {
76570
76610
  name = traversal_1.Traversal.escapeNamespace(name);
76571
76611
  ret += `class ${name} {\n`;
76572
76612
  ret += `static INTERNAL_TYPE = 'INTF';\n`;
76613
+ ret += `static ATTRIBUTES = {${this.buildAttributes(def)}};\n`;
76573
76614
  }
76574
76615
  else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndInterface) {
76575
76616
  ret += "}\n";
@@ -76580,6 +76621,18 @@ class InterfaceTranspiler {
76580
76621
  ret += this.buildTypes(def);
76581
76622
  return new chunk_1.Chunk(ret);
76582
76623
  }
76624
+ buildAttributes(idef) {
76625
+ const attr = [];
76626
+ for (const a of (idef === null || idef === void 0 ? void 0 : idef.getAttributes().getAll()) || []) {
76627
+ const type = new transpile_types_1.TranspileTypes().toType(a.getType());
76628
+ attr.push(`"${a.getName().toUpperCase()}": {"type": ${type}, "visibility": "U", "is_constant": " "}`);
76629
+ }
76630
+ for (const a of (idef === null || idef === void 0 ? void 0 : idef.getAttributes().getConstants()) || []) {
76631
+ const type = new transpile_types_1.TranspileTypes().toType(a.getType());
76632
+ attr.push(`"${a.getName().toUpperCase()}": {"type": ${type}, "visibility": "U", "is_constant": "X"}`);
76633
+ }
76634
+ return attr.join(",\n");
76635
+ }
76583
76636
  buildTypes(idef) {
76584
76637
  if (idef === undefined) {
76585
76638
  return "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.5.64",
3
+ "version": "2.5.66",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,14 +25,14 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.5.64",
28
+ "@abaplint/transpiler": "^2.5.66",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",
32
- "@types/node": "^18.15.10",
32
+ "@types/node": "^18.15.11",
33
33
  "@abaplint/core": "^2.95.50",
34
34
  "progress": "^2.0.3",
35
- "webpack": "^5.76.3",
35
+ "webpack": "^5.77.0",
36
36
  "webpack-cli": "^5.0.1",
37
37
  "typescript": "^5.0.2"
38
38
  }