@abaplint/transpiler-cli 2.5.4 → 2.5.5

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 +65 -15
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -8174,6 +8174,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
8174
8174
  exports.Assign = void 0;
8175
8175
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
8176
8176
  const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
8177
+ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
8177
8178
  class Assign {
8178
8179
  getMatcher() {
8179
8180
  const type = (0, combi_1.seq)("TYPE", (0, combi_1.altPrio)(expressions_1.Dynamic, expressions_1.TypeName));
@@ -8183,7 +8184,7 @@ class Assign {
8183
8184
  const decimals = (0, combi_1.seq)("DECIMALS", expressions_1.Source);
8184
8185
  const casting = (0, combi_1.seq)("CASTING", (0, combi_1.opt)((0, combi_1.alt)(like, handle, (0, combi_1.per)(type, decimals))));
8185
8186
  const obsoleteType = (0, combi_1.seq)("TYPE", expressions_1.Source, (0, combi_1.optPrio)(decimals));
8186
- const ret = (0, combi_1.seq)("ASSIGN", (0, combi_1.opt)((0, combi_1.seq)(expressions_1.Target, "INCREMENT")), expressions_1.AssignSource, "TO", expressions_1.FSTarget, (0, combi_1.opt)((0, combi_1.altPrio)(casting, obsoleteType)), (0, combi_1.opt)(range));
8187
+ const ret = (0, combi_1.seq)("ASSIGN", (0, combi_1.opt)((0, combi_1.seq)(expressions_1.Target, "INCREMENT")), expressions_1.AssignSource, "TO", expressions_1.FSTarget, (0, combi_1.opt)((0, combi_1.altPrio)(casting, obsoleteType)), (0, combi_1.opt)(range), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v757, "ELSE UNASSIGN")));
8187
8188
  return ret;
8188
8189
  }
8189
8190
  }
@@ -21570,9 +21571,31 @@ exports.ComponentChain = ComponentChain;
21570
21571
  Object.defineProperty(exports, "__esModule", ({ value: true }));
21571
21572
  exports.ComponentCompare = void 0;
21572
21573
  const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
21574
+ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
21573
21575
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
21574
21576
  class ComponentCompare {
21575
- runSyntax(node, scope, filename) {
21577
+ runSyntax(node, scope, filename, type) {
21578
+ const chain = node.findDirectExpression(Expressions.ComponentChainSimple);
21579
+ if (chain === undefined) {
21580
+ throw new Error("ComponentCompare, chain not found");
21581
+ }
21582
+ // todo, handle deep chain
21583
+ if (chain.getChildren().length === 1
21584
+ && type !== undefined
21585
+ && !(type instanceof basic_1.VoidType)
21586
+ && !(type instanceof basic_1.UnknownType)
21587
+ && !(type instanceof basic_1.AnyType)) {
21588
+ const fieldName = chain.concatTokens();
21589
+ if (fieldName.toLowerCase() !== "table_line") {
21590
+ if (!(type instanceof basic_1.StructureType)) {
21591
+ throw new Error("ComponentCompare, source not structured");
21592
+ }
21593
+ if (type.getComponentByName(fieldName) === undefined) {
21594
+ throw new Error("Component " + fieldName + " not part of structure");
21595
+ }
21596
+ // todo, check type compatibility
21597
+ }
21598
+ }
21576
21599
  for (const s of node.findDirectExpressions(Expressions.Source)) {
21577
21600
  new source_1.Source().runSyntax(s, scope, filename);
21578
21601
  }
@@ -21636,15 +21659,15 @@ exports.ComponentCond = void 0;
21636
21659
  const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
21637
21660
  const component_compare_1 = __webpack_require__(/*! ./component_compare */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare.js");
21638
21661
  class ComponentCond {
21639
- runSyntax(node, scope, filename) {
21662
+ runSyntax(node, scope, filename, type) {
21640
21663
  for (const t of node.findDirectExpressions(Expressions.ComponentCondSub)) {
21641
21664
  const c = t.findDirectExpression(Expressions.ComponentCond);
21642
21665
  if (c) {
21643
- new ComponentCond().runSyntax(c, scope, filename);
21666
+ new ComponentCond().runSyntax(c, scope, filename, type);
21644
21667
  }
21645
21668
  }
21646
21669
  for (const t of node.findDirectExpressions(Expressions.ComponentCompare)) {
21647
- new component_compare_1.ComponentCompare().runSyntax(t, scope, filename);
21670
+ new component_compare_1.ComponentCompare().runSyntax(t, scope, filename, type);
21648
21671
  }
21649
21672
  }
21650
21673
  }
@@ -27460,7 +27483,6 @@ const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_module
27460
27483
  const inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js");
27461
27484
  const inline_fs_1 = __webpack_require__(/*! ../expressions/inline_fs */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_fs.js");
27462
27485
  const fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js");
27463
- const component_compare_1 = __webpack_require__(/*! ../expressions/component_compare */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare.js");
27464
27486
  const component_cond_1 = __webpack_require__(/*! ../expressions/component_cond */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_cond.js");
27465
27487
  const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
27466
27488
  const loop_group_by_1 = __webpack_require__(/*! ../expressions/loop_group_by */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/loop_group_by.js");
@@ -27479,6 +27501,7 @@ class Loop {
27479
27501
  firstSource = sources[0];
27480
27502
  }
27481
27503
  let sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename, targetType) : undefined;
27504
+ let rowType = undefined;
27482
27505
  const concat = node.concatTokens().toUpperCase();
27483
27506
  if (sourceType === undefined) {
27484
27507
  throw new Error("No source type determined");
@@ -27500,7 +27523,8 @@ class Loop {
27500
27523
  }
27501
27524
  if (sourceType instanceof basic_1.TableType) {
27502
27525
  const targetConcat = (_a = node.findDirectExpression(Expressions.LoopTarget)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
27503
- sourceType = sourceType.getRowType();
27526
+ rowType = sourceType.getRowType();
27527
+ sourceType = rowType;
27504
27528
  if (targetConcat === null || targetConcat === void 0 ? void 0 : targetConcat.startsWith("REFERENCE INTO ")) {
27505
27529
  sourceType = new basic_1.DataReference(sourceType);
27506
27530
  }
@@ -27525,11 +27549,8 @@ class Loop {
27525
27549
  new fstarget_1.FSTarget().runSyntax(fstarget, scope, filename, sourceType);
27526
27550
  }
27527
27551
  }
27528
- for (const t of node.findDirectExpressions(Expressions.ComponentCompare)) {
27529
- new component_compare_1.ComponentCompare().runSyntax(t, scope, filename);
27530
- }
27531
27552
  for (const t of node.findDirectExpressions(Expressions.ComponentCond)) {
27532
- new component_cond_1.ComponentCond().runSyntax(t, scope, filename);
27553
+ new component_cond_1.ComponentCond().runSyntax(t, scope, filename, rowType);
27533
27554
  }
27534
27555
  for (const t of node.findDirectExpressions(Expressions.Dynamic)) {
27535
27556
  new dynamic_1.Dynamic().runSyntax(t, scope, filename);
@@ -46016,7 +46037,7 @@ class Registry {
46016
46037
  }
46017
46038
  static abaplintVersion() {
46018
46039
  // magic, see build script "version.sh"
46019
- return "2.95.23";
46040
+ return "2.95.24";
46020
46041
  }
46021
46042
  getDDICReferences() {
46022
46043
  return this.references;
@@ -64304,6 +64325,7 @@ const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplin
64304
64325
  const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
64305
64326
  const visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js");
64306
64327
  const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
64328
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
64307
64329
  class UnusedMethodsConf extends _basic_rule_config_1.BasicRuleConfig {
64308
64330
  }
64309
64331
  exports.UnusedMethodsConf = UnusedMethodsConf;
@@ -64351,6 +64373,8 @@ class UnusedMethods {
64351
64373
  shortDescription: `Checks for unused methods`,
64352
64374
  extendedInformation: `Checks private and protected methods.
64353
64375
 
64376
+ Unused methods are not reported if the object contains parser or syntax errors.
64377
+
64354
64378
  Skips:
64355
64379
  * methods FOR TESTING
64356
64380
  * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
@@ -64383,6 +64407,13 @@ Skips:
64383
64407
  else if (obj instanceof objects_1.Program && obj.isInclude() === true) {
64384
64408
  return [];
64385
64409
  }
64410
+ for (const file of obj.getABAPFiles()) {
64411
+ for (const statement of file.getStatements()) {
64412
+ if (statement.get() instanceof _statement_1.Unknown) {
64413
+ return []; // contains parser errors
64414
+ }
64415
+ }
64416
+ }
64386
64417
  // dont report anything when there are syntax errors
64387
64418
  const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();
64388
64419
  if (syntax.issues.length > 0) {
@@ -64495,6 +64526,7 @@ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./nod
64495
64526
  const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
64496
64527
  const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
64497
64528
  const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
64529
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
64498
64530
  class WorkArea {
64499
64531
  constructor() {
64500
64532
  this.workarea = [];
@@ -64541,6 +64573,7 @@ class UnusedTypes {
64541
64573
  key: "unused_types",
64542
64574
  title: "Unused types",
64543
64575
  shortDescription: `Checks for unused TYPE definitions`,
64576
+ extendedInformation: `Unused types are not reported if the object contains parser or syntax errors.`,
64544
64577
  tags: [_irule_1.RuleTag.Quickfix],
64545
64578
  pragma: "##NEEDED",
64546
64579
  };
@@ -64562,6 +64595,13 @@ class UnusedTypes {
64562
64595
  if (!(obj instanceof _abap_object_1.ABAPObject)) {
64563
64596
  return [];
64564
64597
  }
64598
+ for (const file of obj.getABAPFiles()) {
64599
+ for (const statement of file.getStatements()) {
64600
+ if (statement.get() instanceof _statement_1.Unknown) {
64601
+ return []; // contains parser errors
64602
+ }
64603
+ }
64604
+ }
64565
64605
  // dont report unused variables when there are syntax errors
64566
64606
  const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();
64567
64607
  if (syntax.issues.length > 0) {
@@ -64733,7 +64773,9 @@ class UnusedVariables {
64733
64773
 
64734
64774
  Note that this currently does not work if the source code uses macros.
64735
64775
 
64736
- Unused variables are not reported if the object contains syntax errors. Errors found in INCLUDES are reported for the main program.`,
64776
+ Unused variables are not reported if the object contains parser or syntax errors.
64777
+
64778
+ Errors found in INCLUDES are reported for the main program.`,
64737
64779
  tags: [_irule_1.RuleTag.Quickfix],
64738
64780
  pragma: "##NEEDED",
64739
64781
  pseudoComment: "EC NEEDED",
@@ -64759,10 +64801,17 @@ Unused variables are not reported if the object contains syntax errors. Errors f
64759
64801
  else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?
64760
64802
  return [];
64761
64803
  }
64804
+ for (const file of obj.getABAPFiles()) {
64805
+ for (const statement of file.getStatements()) {
64806
+ if (statement.get() instanceof _statement_1.Unknown) {
64807
+ return []; // contains parser errors
64808
+ }
64809
+ }
64810
+ }
64762
64811
  // dont report unused variables when there are syntax errors
64763
64812
  const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();
64764
64813
  if (syntax.issues.length > 0) {
64765
- return [];
64814
+ return []; // contains syntax errors
64766
64815
  }
64767
64816
  this.workarea = new WorkArea();
64768
64817
  const top = syntax.spaghetti.getTop();
@@ -66327,9 +66376,10 @@ var Version;
66327
66376
  Version["v754"] = "v754";
66328
66377
  Version["v755"] = "v755";
66329
66378
  Version["v756"] = "v756";
66379
+ Version["v757"] = "v757";
66330
66380
  Version["Cloud"] = "Cloud";
66331
66381
  })(Version = exports.Version || (exports.Version = {}));
66332
- exports.defaultVersion = Version.v756;
66382
+ exports.defaultVersion = Version.v757;
66333
66383
  function getPreviousVersion(v) {
66334
66384
  if (v === Version.OpenABAP) {
66335
66385
  return Version.v702;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.5.4",
3
+ "version": "2.5.5",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,11 +25,11 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.5.4",
28
+ "@abaplint/transpiler": "^2.5.5",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",
32
- "@abaplint/core": "^2.95.23",
32
+ "@abaplint/core": "^2.95.24",
33
33
  "progress": "^2.0.3",
34
34
  "webpack": "^5.75.0",
35
35
  "webpack-cli": "^5.0.1",