@abaplint/transpiler-cli 2.10.22 → 2.10.23

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 +52 -32
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -26613,7 +26613,12 @@ class Source {
26613
26613
  return foundType;
26614
26614
  }
26615
26615
  case "EXACT":
26616
- return this.determineType(node, input, targetType);
26616
+ {
26617
+ const foundType = this.determineType(node, input, targetType);
26618
+ new Source().runSyntax(node.findDirectExpression(Expressions.Source), input, foundType);
26619
+ this.addIfInferred(node, input, foundType);
26620
+ return foundType;
26621
+ }
26617
26622
  case "VALUE":
26618
26623
  {
26619
26624
  const foundType = this.determineType(node, input, targetType);
@@ -39678,8 +39683,8 @@ class CDSCase extends combi_1.Expression {
39678
39683
  getRunnable() {
39679
39684
  const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", _1.CDSName)));
39680
39685
  const value = (0, combi_1.alt)(name, _1.CDSString, _1.CDSFunction, CDSCase, _1.CDSCast, _1.CDSArithmetics);
39681
- const simple = (0, combi_1.seq)("CASE", (0, combi_1.alt)(name, _1.CDSFunction), (0, combi_1.plus)((0, combi_1.seq)("WHEN", value, "THEN", value)), "ELSE", value, "END");
39682
- const complex = (0, combi_1.seq)("CASE", (0, combi_1.plus)((0, combi_1.seq)("WHEN", _1.CDSCondition, "THEN", value)), (0, combi_1.opt)((0, combi_1.seq)("ELSE", value)), "END");
39686
+ const simple = (0, combi_1.seq)("CASE", (0, combi_1.alt)(name, _1.CDSFunction), (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", value, "THEN", value)), "ELSE", value, "END");
39687
+ const complex = (0, combi_1.seq)("CASE", (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", _1.CDSCondition, "THEN", value)), (0, combi_1.opt)((0, combi_1.seq)("ELSE", value)), "END");
39683
39688
  return (0, combi_1.altPrio)(simple, complex);
39684
39689
  }
39685
39690
  }
@@ -52492,7 +52497,7 @@ class Registry {
52492
52497
  }
52493
52498
  static abaplintVersion() {
52494
52499
  // magic, see build script "version.sh"
52495
- return "2.113.79";
52500
+ return "2.113.82";
52496
52501
  }
52497
52502
  getDDICReferences() {
52498
52503
  return this.ddicReferences;
@@ -57578,32 +57583,32 @@ exports.DoubleSpace = DoubleSpace;
57578
57583
  Object.defineProperty(exports, "__esModule", ({ value: true }));
57579
57584
  exports.Downport = exports.DownportConf = void 0;
57580
57585
  /* eslint-disable max-len */
57581
- const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
57586
+ const crypto = __webpack_require__(/*! crypto */ "crypto");
57587
+ const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
57582
57588
  const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
57583
- const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
57584
- const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
57585
- const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
57586
- const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
57589
+ const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
57590
+ const statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
57587
57591
  const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
57588
- const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
57589
- const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
57590
- const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
57591
- const virtual_position_1 = __webpack_require__(/*! ../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
57592
- const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
57593
- const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
57594
- const registry_1 = __webpack_require__(/*! ../registry */ "./node_modules/@abaplint/core/build/src/registry.js");
57595
- const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
57592
+ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
57593
+ const _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
57596
57594
  const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
57595
+ const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
57596
+ const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
57597
+ const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
57597
57598
  const _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
57598
57599
  const basic_1 = __webpack_require__(/*! ../abap/types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
57599
57600
  const config_1 = __webpack_require__(/*! ../config */ "./node_modules/@abaplint/core/build/src/config.js");
57600
- const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
57601
- const include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ "./node_modules/@abaplint/core/build/src/utils/include_graph.js");
57601
+ const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
57602
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
57602
57603
  const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
57603
- const _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
57604
- const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
57605
- const statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
57606
- const crypto = __webpack_require__(/*! crypto */ "crypto");
57604
+ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
57605
+ const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
57606
+ const registry_1 = __webpack_require__(/*! ../registry */ "./node_modules/@abaplint/core/build/src/registry.js");
57607
+ const include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ "./node_modules/@abaplint/core/build/src/utils/include_graph.js");
57608
+ const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
57609
+ const virtual_position_1 = __webpack_require__(/*! ../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
57610
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
57611
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
57607
57612
  // todo: refactor each sub-rule to new classes?
57608
57613
  // todo: add configuration
57609
57614
  class DownportConf extends _basic_rule_config_1.BasicRuleConfig {
@@ -58112,7 +58117,7 @@ Make sure to test the downported code, it might not always be completely correct
58112
58117
  return undefined;
58113
58118
  }
58114
58119
  //////////////////////////////////////////
58115
- /** removes @'s */
58120
+ /** removes @'s and commas */
58116
58121
  downportSQLExtras(low, high, lowFile, highSyntax) {
58117
58122
  if (!(low.get() instanceof _statement_1.Unknown)) {
58118
58123
  return undefined;
@@ -58156,7 +58161,7 @@ Make sure to test the downported code, it might not always be completely correct
58156
58161
  }
58157
58162
  }
58158
58163
  }
58159
- for (const fieldList of high.findAllExpressionsMulti([Expressions.SQLFieldList, Expressions.SQLFieldListLoop], true)) {
58164
+ for (const fieldList of high.findAllExpressionsMulti([Expressions.SQLFieldList, Expressions.SQLFieldListLoop, Expressions.SQLOrderBy], true)) {
58160
58165
  for (const token of fieldList.getDirectTokens()) {
58161
58166
  if (token.getStr() === ",") {
58162
58167
  addFix(token);
@@ -59356,24 +59361,33 @@ ${indentation} output = ${uniqueName}.\n`;
59356
59361
  return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Outline LOOP input", this.getMetadata().key, this.conf.severity, fix);
59357
59362
  }
59358
59363
  outlineLoopTarget(node, lowFile, highSyntax) {
59359
- var _a, _b, _c, _d, _e, _f, _g;
59364
+ var _a, _b, _c, _d, _e, _f;
59360
59365
  // also allows outlining of voided types
59361
59366
  if (!(node.get() instanceof Statements.Loop)) {
59362
59367
  return undefined;
59363
59368
  }
59364
- const sourceName = (_a = node.findDirectExpression(Expressions.SimpleSource2)) === null || _a === void 0 ? void 0 : _a.concatTokens();
59369
+ const source = node.findDirectExpression(Expressions.SimpleSource2);
59370
+ if (source === undefined) {
59371
+ return undefined;
59372
+ }
59373
+ const sourceName = source === null || source === void 0 ? void 0 : source.concatTokens();
59365
59374
  if (sourceName === undefined) {
59366
59375
  return undefined;
59367
59376
  }
59377
+ let foundType = undefined;
59378
+ const spag = highSyntax.spaghetti.lookupPosition(source.getFirstToken().getStart(), lowFile.getFilename());
59379
+ if (spag) {
59380
+ foundType = spag.findVariable(source.concatTokens());
59381
+ }
59368
59382
  const concat = node.concatTokens().toUpperCase();
59369
59383
  if (concat.includes(" GROUP BY ") || concat.startsWith("LOOP AT GROUP ")) {
59370
59384
  return undefined;
59371
59385
  }
59372
59386
  const isReference = concat.includes(" REFERENCE INTO ");
59373
59387
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59374
- const dataTarget = (_c = (_b = node.findDirectExpression(Expressions.LoopTarget)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.findDirectExpression(Expressions.InlineData);
59388
+ const dataTarget = (_b = (_a = node.findDirectExpression(Expressions.LoopTarget)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.InlineData);
59375
59389
  if (dataTarget) {
59376
- const targetName = ((_d = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || "DOWNPORT_ERROR";
59390
+ const targetName = ((_c = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "DOWNPORT_ERROR";
59377
59391
  let code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\n${indentation}`;
59378
59392
  if (isReference) {
59379
59393
  const likeName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
@@ -59384,10 +59398,15 @@ ${indentation} output = ${uniqueName}.\n`;
59384
59398
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
59385
59399
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline LOOP data target", this.getMetadata().key, this.conf.severity, fix);
59386
59400
  }
59387
- const fsTarget = (_f = (_e = node.findDirectExpression(Expressions.LoopTarget)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(Expressions.FSTarget)) === null || _f === void 0 ? void 0 : _f.findDirectExpression(Expressions.InlineFS);
59401
+ const fsTarget = (_e = (_d = node.findDirectExpression(Expressions.LoopTarget)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(Expressions.FSTarget)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(Expressions.InlineFS);
59388
59402
  if (fsTarget) {
59389
- const targetName = ((_g = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "DOWNPORT_ERROR";
59390
- const code = `FIELD-SYMBOLS ${targetName} LIKE LINE OF ${sourceName}.\n${indentation}`;
59403
+ const targetName = ((_f = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _f === void 0 ? void 0 : _f.concatTokens()) || "DOWNPORT_ERROR";
59404
+ let type = `LIKE LINE OF ${sourceName}`;
59405
+ const f = foundType === null || foundType === void 0 ? void 0 : foundType.getType();
59406
+ if (f instanceof basic_1.TableType && f.getRowType() instanceof basic_1.AnyType) {
59407
+ type = "TYPE ANY";
59408
+ }
59409
+ const code = `FIELD-SYMBOLS ${targetName} ${type}.\n${indentation}`;
59391
59410
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);
59392
59411
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);
59393
59412
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -90297,6 +90316,7 @@ function readDocType(xmlData, i){
90297
90316
  if (xmlData[i] === '<' && !comment) { //Determine the tag type
90298
90317
  if( hasBody && isEntity(xmlData, i)){
90299
90318
  i += 7;
90319
+ let entityName, val;
90300
90320
  [entityName, val,i] = readEntityExp(xmlData,i+1);
90301
90321
  if(val.indexOf("&") === -1) //Parameter entities are not supported
90302
90322
  entities[ validateEntityName(entityName) ] = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.10.22",
3
+ "version": "2.10.23",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -27,13 +27,13 @@
27
27
  "author": "abaplint",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@abaplint/transpiler": "^2.10.22",
30
+ "@abaplint/transpiler": "^2.10.23",
31
31
  "@types/glob": "^8.1.0",
32
32
  "glob": "=7.2.0",
33
33
  "@types/progress": "^2.0.7",
34
34
  "ts-json-schema-generator": "^2.3.0",
35
35
  "@types/node": "^22.10.2",
36
- "@abaplint/core": "^2.113.79",
36
+ "@abaplint/core": "^2.113.82",
37
37
  "progress": "^2.0.3",
38
38
  "webpack": "^5.97.1",
39
39
  "webpack-cli": "^5.1.4",