@abaplint/transpiler-cli 2.13.20 → 2.13.21

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 +41 -2
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -85121,6 +85121,12 @@ class TypeNameOrInfer {
85121
85121
  const scope = traversal.findCurrentScopeByToken(node.getFirstToken());
85122
85122
  const type = traversal.lookupInferred(node, scope);
85123
85123
  if (type === undefined) {
85124
+ if (node.concatTokens() === "#") {
85125
+ const sqlType = traversal.getSQLInferredType();
85126
+ if (sqlType !== undefined) {
85127
+ return sqlType;
85128
+ }
85129
+ }
85124
85130
  throw new Error("TypeNameOrInfer, type not found: " + node.concatTokens() + ", " + traversal.getCurrentObject().getName() + " line " + node.getFirstToken().getStart().getRow());
85125
85131
  }
85126
85132
  return type;
@@ -89475,6 +89481,27 @@ exports.FunctionPoolTranspiler = FunctionPoolTranspiler;
89475
89481
 
89476
89482
  /***/ },
89477
89483
 
89484
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/generate_subroutine.js"
89485
+ /*!***************************************************************************************!*\
89486
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/generate_subroutine.js ***!
89487
+ \***************************************************************************************/
89488
+ (__unused_webpack_module, exports, __webpack_require__) {
89489
+
89490
+ "use strict";
89491
+
89492
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
89493
+ exports.GenerateSubroutineTranspiler = void 0;
89494
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
89495
+ class GenerateSubroutineTranspiler {
89496
+ transpile(_node, _traversal) {
89497
+ return new chunk_1.Chunk(`throw new Error("GenerateSubroutine, not supported, transpiler");`);
89498
+ }
89499
+ }
89500
+ exports.GenerateSubroutineTranspiler = GenerateSubroutineTranspiler;
89501
+ //# sourceMappingURL=generate_subroutine.js.map
89502
+
89503
+ /***/ },
89504
+
89478
89505
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/get_bit.js"
89479
89506
  /*!***************************************************************************!*\
89480
89507
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/get_bit.js ***!
@@ -89918,6 +89945,7 @@ __exportStar(__webpack_require__(/*! ./set_language */ "./node_modules/@abaplint
89918
89945
  __exportStar(__webpack_require__(/*! ./set_locale */ "./node_modules/@abaplint/transpiler/build/src/statements/set_locale.js"), exports);
89919
89946
  __exportStar(__webpack_require__(/*! ./set_parameter */ "./node_modules/@abaplint/transpiler/build/src/statements/set_parameter.js"), exports);
89920
89947
  __exportStar(__webpack_require__(/*! ./set_pf_status */ "./node_modules/@abaplint/transpiler/build/src/statements/set_pf_status.js"), exports);
89948
+ __exportStar(__webpack_require__(/*! ./generate_subroutine */ "./node_modules/@abaplint/transpiler/build/src/statements/generate_subroutine.js"), exports);
89921
89949
  __exportStar(__webpack_require__(/*! ./set_screen */ "./node_modules/@abaplint/transpiler/build/src/statements/set_screen.js"), exports);
89922
89950
  __exportStar(__webpack_require__(/*! ./set_titlebar */ "./node_modules/@abaplint/transpiler/build/src/statements/set_titlebar.js"), exports);
89923
89951
  __exportStar(__webpack_require__(/*! ./shift */ "./node_modules/@abaplint/transpiler/build/src/statements/shift.js"), exports);
@@ -90001,7 +90029,7 @@ class InsertDatabaseTranspiler {
90001
90029
  }
90002
90030
  const from = node.findExpressionAfterToken("FROM");
90003
90031
  if (from && from.get() instanceof abaplint.Expressions.SQLSource) {
90004
- const tvalues = traversal.traverse(from);
90032
+ const tvalues = traversal.traverseWithTableContext(dbtab.concatTokens(), from);
90005
90033
  options.push(`"values": ` + tvalues.getCode());
90006
90034
  }
90007
90035
  const fromTable = node.findExpressionAfterToken("TABLE");
@@ -90745,7 +90773,7 @@ class ModifyDatabaseTranspiler {
90745
90773
  }
90746
90774
  const from = node.findExpressionAfterToken("FROM");
90747
90775
  if (from && from.get() instanceof abaplint.Expressions.SQLSource) {
90748
- const tvalues = traversal.traverse(from);
90776
+ const tvalues = traversal.traverseWithTableContext(dbtab.concatTokens(), from);
90749
90777
  options.push(`"values": ` + tvalues.getCode());
90750
90778
  }
90751
90779
  return new chunk_1.Chunk(`await abap.statements.modifyDatabase(${table.getCode()}, {${options.join(", ")}});`);
@@ -94779,6 +94807,7 @@ class Traversal {
94779
94807
  spaghetti;
94780
94808
  file;
94781
94809
  obj;
94810
+ sqlInferredType;
94782
94811
  reg;
94783
94812
  options;
94784
94813
  constructor(spaghetti, file, obj, reg, options) {
@@ -94873,6 +94902,16 @@ class Traversal {
94873
94902
  }
94874
94903
  return undefined;
94875
94904
  }
94905
+ getSQLInferredType() {
94906
+ return this.sqlInferredType;
94907
+ }
94908
+ traverseWithTableContext(tableName, expressionNode) {
94909
+ const tabl = this.reg.getObject("TABL", tableName);
94910
+ this.sqlInferredType = tabl?.parseType(this.reg);
94911
+ const result = this.traverse(expressionNode);
94912
+ this.sqlInferredType = undefined;
94913
+ return result;
94914
+ }
94876
94915
  getInterfaceDefinition(token) {
94877
94916
  let scope = this.findCurrentScopeByToken(token);
94878
94917
  while (scope !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.13.20",
3
+ "version": "2.13.21",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
30
  "@abaplint/core": "^2.119.12",
31
- "@abaplint/transpiler": "^2.13.20",
31
+ "@abaplint/transpiler": "^2.13.21",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.12.2",
34
34
  "@types/progress": "^2.0.7",