@abaplint/transpiler-cli 2.11.16 → 2.11.18

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 +164 -22
  2. package/package.json +4 -4
package/build/bundle.js CHANGED
@@ -6791,7 +6791,7 @@ class Source extends combi_1.Expression {
6791
6791
  const corr = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CORRESPONDING", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CorrespondingBody, rparen, (0, combi_1.optPrio)(after)));
6792
6792
  const conv = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("CONV", _1.TypeNameOrInfer, lparenNoSpace, _1.ConvBody, rparenNoSpace, (0, combi_1.optPrio)(after)), version_1.Version.OpenABAP);
6793
6793
  const swit = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("SWITCH", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.SwitchBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
6794
- const value = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("VALUE", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.ValueBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
6794
+ const value = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("VALUE", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.ValueBody, rparenNoSpace, (0, combi_1.optPrio)(after)), version_1.Version.OpenABAP);
6795
6795
  const cond = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("COND", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CondBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
6796
6796
  const reff = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("REF", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), Source, (0, combi_1.optPrio)("OPTIONAL"), rparen), version_1.Version.OpenABAP);
6797
6797
  const exact = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("EXACT", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), Source, rparen, (0, combi_1.optPrio)(after)));
@@ -27220,27 +27220,24 @@ class Source {
27220
27220
  console.dir(inferredType);
27221
27221
  console.dir(typeToken);
27222
27222
  */
27223
- // hmm, need to align all this
27224
27223
  if (typeName === "#" && inferredType && typeToken) {
27225
27224
  const found = basic.lookupQualifiedName(inferredType.getQualifiedName());
27226
27225
  if (found) {
27227
- input.scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, input.filename);
27228
- }
27229
- else if (inferredType instanceof basic_1.DataReference) {
27230
- const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, inferredType);
27231
- input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename);
27226
+ input.scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, input.filename, { foundQualified: true });
27232
27227
  }
27233
27228
  else if (inferredType instanceof basic_1.ObjectReferenceType) {
27234
27229
  const def = input.scope.findObjectDefinition(inferredType.getQualifiedName());
27230
+ const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, inferredType);
27235
27231
  if (def) {
27236
- const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, inferredType);
27237
- input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename);
27232
+ input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename, { foundQualified: true });
27233
+ }
27234
+ else {
27235
+ input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename, { foundQualified: false });
27238
27236
  }
27239
27237
  }
27240
- else if (inferredType instanceof basic_1.CharacterType) {
27241
- // character is bit special it does not have a qualified name eg "TYPE c LENGTH 6"
27238
+ else {
27242
27239
  const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, inferredType);
27243
- input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename);
27240
+ input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename, { foundQualified: false });
27244
27241
  }
27245
27242
  }
27246
27243
  }
@@ -53690,7 +53687,7 @@ class Registry {
53690
53687
  }
53691
53688
  static abaplintVersion() {
53692
53689
  // magic, see build script "version.sh"
53693
- return "2.113.163";
53690
+ return "2.113.166";
53694
53691
  }
53695
53692
  getDDICReferences() {
53696
53693
  return this.ddicReferences;
@@ -59623,7 +59620,7 @@ ${indentation}`);
59623
59620
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
59624
59621
  return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), "Outline SELECT @DATA", this.getMetadata().key, this.conf.severity, fix);
59625
59622
  }
59626
- // the anonymous type minght be used in inferred type statements, define it so it can be referred
59623
+ // the anonymous type might be used in inferred type statements, define it so it can be referred
59627
59624
  anonymousTableType(high, lowFile, highSyntax) {
59628
59625
  if (!(high.get() instanceof Statements.Data)) {
59629
59626
  return undefined;
@@ -60610,6 +60607,9 @@ ${indentation} output = ${uniqueName}.\n`;
60610
60607
  if (!(node.get() instanceof Statements.Loop)) {
60611
60608
  return undefined;
60612
60609
  }
60610
+ if (this.lowReg.getConfig().getVersion() === version_1.Version.OpenABAP) {
60611
+ return undefined;
60612
+ }
60613
60613
  const source = (_a = node.findDirectExpression(Expressions.LoopSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.SimpleSource2);
60614
60614
  if (source === undefined) {
60615
60615
  return undefined;
@@ -61205,7 +61205,7 @@ ${indentation} output = ${uniqueName}.\n`;
61205
61205
  throw new SkipToNextFile(issue);
61206
61206
  }
61207
61207
  findType(i, lowFile, highSyntax, ref = false) {
61208
- var _a;
61208
+ var _a, _b;
61209
61209
  const expr = i.findDirectExpression(Expressions.TypeNameOrInfer);
61210
61210
  if (expr === undefined) {
61211
61211
  return undefined;
@@ -61224,7 +61224,8 @@ ${indentation} output = ${uniqueName}.\n`;
61224
61224
  if (r.referenceType === _reference_1.ReferenceType.InferredType
61225
61225
  && r.resolved
61226
61226
  && r.position.getStart().equals(firstToken.getStart())
61227
- && r.resolved instanceof _typed_identifier_1.TypedIdentifier) {
61227
+ && r.resolved instanceof _typed_identifier_1.TypedIdentifier
61228
+ && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.foundQualified) === true) {
61228
61229
  inferred = r.resolved;
61229
61230
  break;
61230
61231
  }
@@ -61236,7 +61237,7 @@ ${indentation} output = ${uniqueName}.\n`;
61236
61237
  return inferred.getType().toABAP();
61237
61238
  }
61238
61239
  else {
61239
- return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
61240
+ return (_b = inferred.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase();
61240
61241
  }
61241
61242
  }
61242
61243
  outlineFS(low, high, lowFile, highSyntax) {
@@ -78891,6 +78892,38 @@ exports.DatabaseTableTranspiler = DatabaseTableTranspiler;
78891
78892
 
78892
78893
  /***/ }),
78893
78894
 
78895
+ /***/ "./node_modules/@abaplint/transpiler/build/src/expressions/field_assignment.js":
78896
+ /*!*************************************************************************************!*\
78897
+ !*** ./node_modules/@abaplint/transpiler/build/src/expressions/field_assignment.js ***!
78898
+ \*************************************************************************************/
78899
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
78900
+
78901
+ "use strict";
78902
+
78903
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
78904
+ exports.FieldAssignmentTranspiler = void 0;
78905
+ const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
78906
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
78907
+ class FieldAssignmentTranspiler {
78908
+ transpile(node, traversal) {
78909
+ const ret = new chunk_1.Chunk();
78910
+ const field = node.findDirectExpression(core_1.Expressions.FieldSub);
78911
+ if (field === undefined) {
78912
+ throw new Error("FieldAssignmentTranspiler, Expected FieldSub");
78913
+ }
78914
+ const source = node.findDirectExpression(core_1.Expressions.Source);
78915
+ if (source === undefined) {
78916
+ throw new Error("FieldAssignmentTranspiler, Expected Source");
78917
+ }
78918
+ ret.appendString(`.setField("${field.concatTokens().toLowerCase()}", ${traversal.traverse(source).getCode()})`);
78919
+ return ret;
78920
+ }
78921
+ }
78922
+ exports.FieldAssignmentTranspiler = FieldAssignmentTranspiler;
78923
+ //# sourceMappingURL=field_assignment.js.map
78924
+
78925
+ /***/ }),
78926
+
78894
78927
  /***/ "./node_modules/@abaplint/transpiler/build/src/expressions/field_chain.js":
78895
78928
  /*!********************************************************************************!*\
78896
78929
  !*** ./node_modules/@abaplint/transpiler/build/src/expressions/field_chain.js ***!
@@ -79983,6 +80016,7 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/bui
79983
80016
  const constant_1 = __webpack_require__(/*! ./constant */ "./node_modules/@abaplint/transpiler/build/src/expressions/constant.js");
79984
80017
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
79985
80018
  const transpile_types_1 = __webpack_require__(/*! ../transpile_types */ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js");
80019
+ const value_body_1 = __webpack_require__(/*! ./value_body */ "./node_modules/@abaplint/transpiler/build/src/expressions/value_body.js");
79986
80020
  class SourceTranspiler {
79987
80021
  addGet;
79988
80022
  constructor(addGet = false) {
@@ -80061,6 +80095,13 @@ class SourceTranspiler {
80061
80095
  ret.appendString(traversal.traverse(c.getFirstChild()).getCode());
80062
80096
  ret.appendString(")");
80063
80097
  }
80098
+ else if (c.get() instanceof core_1.Expressions.ValueBody) {
80099
+ const typ = node.findFirstExpression(core_1.Expressions.TypeNameOrInfer);
80100
+ if (typ === undefined) {
80101
+ throw new Error("TypeNameOrInfer not found in ValueBody");
80102
+ }
80103
+ ret.appendChunk(new value_body_1.ValueBodyTranspiler().transpile(typ, c, traversal));
80104
+ }
80064
80105
  else {
80065
80106
  ret.appendString("SourceUnknown-" + c.get().constructor.name);
80066
80107
  }
@@ -80303,6 +80344,10 @@ class SQLCondTranspiler {
80303
80344
  ret += this.sqlSource(source, traversal, filename, table);
80304
80345
  return ret;
80305
80346
  }
80347
+ if (fieldNameExpression && c.getChildren().length === 3 && c.concatTokens().toUpperCase().endsWith(" IS NULL")) {
80348
+ ret += fieldName + " IS NULL";
80349
+ return ret;
80350
+ }
80306
80351
  if (fieldName === undefined || operator === undefined || source === undefined) {
80307
80352
  throw new Error("SQL Condition, transpiler todo2, " + c.concatTokens());
80308
80353
  }
@@ -81084,7 +81129,7 @@ exports.TypeNameOrInfer = void 0;
81084
81129
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
81085
81130
  const transpile_types_1 = __webpack_require__(/*! ../transpile_types */ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js");
81086
81131
  class TypeNameOrInfer {
81087
- transpile(node, traversal) {
81132
+ findType(node, traversal) {
81088
81133
  let type;
81089
81134
  const scope = traversal.findCurrentScopeByToken(node.getFirstToken());
81090
81135
  if (node.concatTokens() === "#") {
@@ -81096,6 +81141,10 @@ class TypeNameOrInfer {
81096
81141
  if (type === undefined) {
81097
81142
  throw new Error("TypeNameOrInfer, type not found: " + node.concatTokens());
81098
81143
  }
81144
+ return type;
81145
+ }
81146
+ transpile(node, traversal) {
81147
+ const type = this.findType(node, traversal);
81099
81148
  const ret = new chunk_1.Chunk();
81100
81149
  ret.appendString(transpile_types_1.TranspileTypes.toType(type));
81101
81150
  return ret;
@@ -81106,6 +81155,98 @@ exports.TypeNameOrInfer = TypeNameOrInfer;
81106
81155
 
81107
81156
  /***/ }),
81108
81157
 
81158
+ /***/ "./node_modules/@abaplint/transpiler/build/src/expressions/value_body.js":
81159
+ /*!*******************************************************************************!*\
81160
+ !*** ./node_modules/@abaplint/transpiler/build/src/expressions/value_body.js ***!
81161
+ \*******************************************************************************/
81162
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
81163
+
81164
+ "use strict";
81165
+
81166
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
81167
+ exports.ValueBodyTranspiler = void 0;
81168
+ const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
81169
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
81170
+ const type_name_or_infer_1 = __webpack_require__(/*! ./type_name_or_infer */ "./node_modules/@abaplint/transpiler/build/src/expressions/type_name_or_infer.js");
81171
+ const value_body_line_1 = __webpack_require__(/*! ./value_body_line */ "./node_modules/@abaplint/transpiler/build/src/expressions/value_body_line.js");
81172
+ const field_assignment_1 = __webpack_require__(/*! ./field_assignment */ "./node_modules/@abaplint/transpiler/build/src/expressions/field_assignment.js");
81173
+ class ValueBodyTranspiler {
81174
+ transpile(typ, body, traversal) {
81175
+ if (!(typ.get() instanceof core_1.Expressions.TypeNameOrInfer)) {
81176
+ throw new Error("ValueBodyTranspiler, Expected TypeNameOrInfer");
81177
+ }
81178
+ const ret = new chunk_1.Chunk().appendString(new type_name_or_infer_1.TypeNameOrInfer().transpile(typ, traversal).getCode());
81179
+ const context = new type_name_or_infer_1.TypeNameOrInfer().findType(typ, traversal);
81180
+ const hasLines = body.findDirectExpression(core_1.Expressions.ValueBodyLine) !== undefined;
81181
+ let extraFields = "";
81182
+ for (const child of body.getChildren()) {
81183
+ if (child.get() instanceof core_1.Expressions.FieldAssignment && child instanceof core_1.Nodes.ExpressionNode) {
81184
+ const transpiled = new field_assignment_1.FieldAssignmentTranspiler().transpile(child, traversal).getCode();
81185
+ if (hasLines === false) {
81186
+ ret.appendString(transpiled);
81187
+ }
81188
+ else {
81189
+ extraFields += transpiled;
81190
+ }
81191
+ }
81192
+ else if (child.get() instanceof core_1.Expressions.ValueBodyLine && child instanceof core_1.Nodes.ExpressionNode) {
81193
+ if (!(context instanceof core_1.BasicTypes.TableType)) {
81194
+ throw new Error("ValueBodyTranspiler, Expected BasicTypes");
81195
+ }
81196
+ const rowType = context.getRowType();
81197
+ ret.appendString(new value_body_line_1.ValueBodyLineTranspiler().transpile(rowType, child, traversal, extraFields).getCode());
81198
+ }
81199
+ else {
81200
+ throw new Error("ValueBodyTranspiler, unknown " + child.get().constructor.name);
81201
+ }
81202
+ }
81203
+ return ret;
81204
+ }
81205
+ }
81206
+ exports.ValueBodyTranspiler = ValueBodyTranspiler;
81207
+ //# sourceMappingURL=value_body.js.map
81208
+
81209
+ /***/ }),
81210
+
81211
+ /***/ "./node_modules/@abaplint/transpiler/build/src/expressions/value_body_line.js":
81212
+ /*!************************************************************************************!*\
81213
+ !*** ./node_modules/@abaplint/transpiler/build/src/expressions/value_body_line.js ***!
81214
+ \************************************************************************************/
81215
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
81216
+
81217
+ "use strict";
81218
+
81219
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
81220
+ exports.ValueBodyLineTranspiler = void 0;
81221
+ const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
81222
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
81223
+ const transpile_types_1 = __webpack_require__(/*! ../transpile_types */ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js");
81224
+ const field_assignment_1 = __webpack_require__(/*! ./field_assignment */ "./node_modules/@abaplint/transpiler/build/src/expressions/field_assignment.js");
81225
+ class ValueBodyLineTranspiler {
81226
+ transpile(rowType, line, traversal, extraFields) {
81227
+ const ret = new chunk_1.Chunk();
81228
+ ret.appendString(`.appendThis(${transpile_types_1.TranspileTypes.toType(rowType)}`);
81229
+ for (const child of line.getChildren()) {
81230
+ if (child instanceof core_1.Nodes.TokenNode) {
81231
+ // last or first parenthesis
81232
+ continue;
81233
+ }
81234
+ else if (child.get() instanceof core_1.Expressions.FieldAssignment && child instanceof core_1.Nodes.ExpressionNode) {
81235
+ ret.appendString(new field_assignment_1.FieldAssignmentTranspiler().transpile(child, traversal).getCode());
81236
+ }
81237
+ else {
81238
+ throw new Error("ValueBodyLineTranspiler, unknown " + child.get().constructor.name);
81239
+ }
81240
+ }
81241
+ ret.appendString(extraFields + `)`);
81242
+ return ret;
81243
+ }
81244
+ }
81245
+ exports.ValueBodyLineTranspiler = ValueBodyLineTranspiler;
81246
+ //# sourceMappingURL=value_body_line.js.map
81247
+
81248
+ /***/ }),
81249
+
81109
81250
  /***/ "./node_modules/@abaplint/transpiler/build/src/feature_flags.js":
81110
81251
  /*!**********************************************************************!*\
81111
81252
  !*** ./node_modules/@abaplint/transpiler/build/src/feature_flags.js ***!
@@ -82452,7 +82593,8 @@ class AppendTranspiler {
82452
82593
  }
82453
82594
  else {
82454
82595
  const options = [];
82455
- const s = node.findDirectExpression(abaplint.Expressions.SimpleSource4);
82596
+ const s = node.findDirectExpression(abaplint.Expressions.SimpleSource4)
82597
+ || node.findDirectExpression(abaplint.Expressions.Source);
82456
82598
  if (s) {
82457
82599
  const option = new chunk_1.Chunk().appendString("source: ");
82458
82600
  option.appendChunk(traversal.traverse(s));
@@ -85433,14 +85575,14 @@ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/tr
85433
85575
  class InsertInternalTranspiler {
85434
85576
  transpile(node, traversal) {
85435
85577
  const options = [];
85436
- let source = node.findDirectExpression(abaplint.Expressions.SimpleSource4);
85578
+ const source = node.findDirectExpression(abaplint.Expressions.SimpleSource4)
85579
+ || node.findDirectExpression(abaplint.Expressions.Source);
85437
85580
  const target = node.findDirectExpression(abaplint.Expressions.Target);
85438
85581
  const concat = node.concatTokens().toUpperCase();
85439
85582
  if (concat.startsWith("INSERT LINES OF ")) {
85440
- source = node.findDirectExpression(abaplint.Expressions.Source);
85441
85583
  options.push("lines: true");
85442
85584
  }
85443
- if (source === undefined) {
85585
+ if (concat.startsWith("INSERT INITIAL LINE ")) {
85444
85586
  options.push("initial: true");
85445
85587
  }
85446
85588
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.11.16",
3
+ "version": "2.11.18",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -27,8 +27,8 @@
27
27
  "author": "abaplint",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@abaplint/core": "^2.113.163",
31
- "@abaplint/transpiler": "^2.11.16",
30
+ "@abaplint/core": "^2.113.166",
31
+ "@abaplint/transpiler": "^2.11.18",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.2.1",
34
34
  "@types/progress": "^2.0.7",
@@ -38,6 +38,6 @@
38
38
  "typescript": "^5.9.2",
39
39
  "p-limit": "^3.1.0",
40
40
  "webpack-cli": "^6.0.1",
41
- "webpack": "^5.101.0"
41
+ "webpack": "^5.101.1"
42
42
  }
43
43
  }