@abaplint/transpiler-cli 2.8.26 → 2.8.28

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 +1200 -879
  2. package/package.json +6 -6
package/build/bundle.js CHANGED
@@ -1652,7 +1652,24 @@ exports.WStaticArrowW = WStaticArrowW;
1652
1652
  "use strict";
1653
1653
 
1654
1654
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1655
- exports.failStar = exports.failCombinator = exports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;
1655
+ exports.Combi = exports.Expression = void 0;
1656
+ exports.str = str;
1657
+ exports.regex = regex;
1658
+ exports.tok = tok;
1659
+ exports.seq = seq;
1660
+ exports.alt = alt;
1661
+ exports.altPrio = altPrio;
1662
+ exports.opt = opt;
1663
+ exports.optPrio = optPrio;
1664
+ exports.per = per;
1665
+ exports.star = star;
1666
+ exports.starPrio = starPrio;
1667
+ exports.plus = plus;
1668
+ exports.plusPrio = plusPrio;
1669
+ exports.ver = ver;
1670
+ exports.verNot = verNot;
1671
+ exports.failCombinator = failCombinator;
1672
+ exports.failStar = failStar;
1656
1673
  const Tokens = __webpack_require__(/*! ../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
1657
1674
  const nodes_1 = __webpack_require__(/*! ../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
1658
1675
  const version_1 = __webpack_require__(/*! ../../version */ "./node_modules/@abaplint/core/build/src/version.js");
@@ -2465,15 +2482,12 @@ function str(s) {
2465
2482
  return new Word(s);
2466
2483
  }
2467
2484
  }
2468
- exports.str = str;
2469
2485
  function regex(r) {
2470
2486
  return new Regex(r);
2471
2487
  }
2472
- exports.regex = regex;
2473
2488
  function tok(t) {
2474
2489
  return new Token(t.name);
2475
2490
  }
2476
- exports.tok = tok;
2477
2491
  const expressionSingletons = {};
2478
2492
  const stringSingletons = {};
2479
2493
  function map(s) {
@@ -2502,65 +2516,51 @@ function seq(first, second, ...rest) {
2502
2516
  list.push(...rest.map(map));
2503
2517
  return new Sequence(list);
2504
2518
  }
2505
- exports.seq = seq;
2506
2519
  function alt(first, second, ...rest) {
2507
2520
  const list = [map(first), map(second)];
2508
2521
  list.push(...rest.map(map));
2509
2522
  return new Alternative(list);
2510
2523
  }
2511
- exports.alt = alt;
2512
2524
  function altPrio(first, second, ...rest) {
2513
2525
  const list = [map(first), map(second)];
2514
2526
  list.push(...rest.map(map));
2515
2527
  return new AlternativePriority(list);
2516
2528
  }
2517
- exports.altPrio = altPrio;
2518
2529
  function opt(first) {
2519
2530
  return new Optional(map(first));
2520
2531
  }
2521
- exports.opt = opt;
2522
2532
  function optPrio(first) {
2523
2533
  return new OptionalPriority(map(first));
2524
2534
  }
2525
- exports.optPrio = optPrio;
2526
2535
  function per(first, second, ...rest) {
2527
2536
  const list = [map(first), map(second)];
2528
2537
  list.push(...rest.map(map));
2529
2538
  return new Permutation(list);
2530
2539
  }
2531
- exports.per = per;
2532
2540
  function star(first) {
2533
2541
  return new Star(map(first));
2534
2542
  }
2535
- exports.star = star;
2536
2543
  function starPrio(first) {
2537
2544
  return new StarPriority(map(first));
2538
2545
  }
2539
- exports.starPrio = starPrio;
2540
2546
  function plus(first) {
2541
2547
  return new Plus(map(first));
2542
2548
  }
2543
- exports.plus = plus;
2544
2549
  function plusPrio(first) {
2545
2550
  return new PlusPriority(map(first));
2546
2551
  }
2547
- exports.plusPrio = plusPrio;
2548
2552
  function ver(version, first, or) {
2549
2553
  return new Vers(version, map(first), or);
2550
2554
  }
2551
- exports.ver = ver;
2552
2555
  function verNot(version, first) {
2553
2556
  return new VersNot(version, map(first));
2554
2557
  }
2555
- exports.verNot = verNot;
2556
2558
  function failCombinator() {
2557
2559
  return new FailCombinator();
2558
2560
  }
2559
- exports.failCombinator = failCombinator;
2560
2561
  function failStar() {
2561
2562
  return new FailStar();
2562
2563
  }
2563
- exports.failStar = failStar;
2564
2564
  //# sourceMappingURL=combi.js.map
2565
2565
 
2566
2566
  /***/ }),
@@ -2589,17 +2589,23 @@ class Macros {
2589
2589
  constructor(globalMacros) {
2590
2590
  this.macros = {};
2591
2591
  for (const m of globalMacros) {
2592
- this.macros[m.toUpperCase()] = [];
2592
+ this.macros[m.toUpperCase()] = {
2593
+ statements: [],
2594
+ filename: undefined,
2595
+ };
2593
2596
  }
2594
2597
  }
2595
- addMacro(name, contents) {
2598
+ addMacro(name, contents, filename) {
2596
2599
  if (this.isMacro(name)) {
2597
2600
  return;
2598
2601
  }
2599
- this.macros[name.toUpperCase()] = contents;
2602
+ this.macros[name.toUpperCase()] = {
2603
+ statements: contents,
2604
+ filename: filename,
2605
+ };
2600
2606
  }
2601
2607
  getContents(name) {
2602
- return this.macros[name.toUpperCase()];
2608
+ return this.macros[name.toUpperCase()].statements;
2603
2609
  }
2604
2610
  listMacroNames() {
2605
2611
  return Object.keys(this.macros);
@@ -2610,6 +2616,9 @@ class Macros {
2610
2616
  }
2611
2617
  return false;
2612
2618
  }
2619
+ getMacroFilename(name) {
2620
+ return this.macros[name.toUpperCase()].filename;
2621
+ }
2613
2622
  }
2614
2623
  class ExpandMacros {
2615
2624
  // "reg" must be supplied if there are cross object macros via INCLUDE
@@ -2619,35 +2628,43 @@ class ExpandMacros {
2619
2628
  this.globalMacros = globalMacros;
2620
2629
  this.reg = reg;
2621
2630
  }
2622
- find(statements) {
2623
- var _a, _b;
2624
- let name = undefined;
2631
+ find(statements, file, clear = true) {
2632
+ var _a, _b, _c;
2633
+ let nameToken = undefined;
2634
+ let start = undefined;
2625
2635
  let contents = [];
2636
+ const macroReferences = (_a = this.reg) === null || _a === void 0 ? void 0 : _a.getMacroReferences();
2637
+ if (clear) {
2638
+ macroReferences === null || macroReferences === void 0 ? void 0 : macroReferences.clear(file.getFilename());
2639
+ }
2626
2640
  for (let i = 0; i < statements.length; i++) {
2627
2641
  const statement = statements[i];
2628
2642
  const type = statement.get();
2629
2643
  if (type instanceof Statements.Define) {
2630
2644
  // todo, will this break if first token is a pragma?
2631
- name = statement.getTokens()[1].getStr();
2645
+ nameToken = statement.getTokens()[1];
2646
+ start = statement.getFirstToken().getStart();
2632
2647
  contents = [];
2633
2648
  }
2634
2649
  else if (type instanceof Statements.Include) {
2635
- const includeName = (_a = statement.findDirectExpression(Expressions.IncludeName)) === null || _a === void 0 ? void 0 : _a.concatTokens();
2650
+ const includeName = (_b = statement.findDirectExpression(Expressions.IncludeName)) === null || _b === void 0 ? void 0 : _b.concatTokens();
2636
2651
  // todo, this does not take function module includes into account
2637
- const prog = (_b = this.reg) === null || _b === void 0 ? void 0 : _b.getObject("PROG", includeName);
2652
+ // todo, workaround for cyclic includes?
2653
+ const prog = (_c = this.reg) === null || _c === void 0 ? void 0 : _c.getObject("PROG", includeName);
2638
2654
  if (prog) {
2639
2655
  prog.parse(this.version, this.globalMacros, this.reg);
2640
- const main = prog.getMainABAPFile();
2641
- if (main) {
2656
+ const includeMainFile = prog.getMainABAPFile();
2657
+ if (includeMainFile) {
2642
2658
  // slow, this copies everything,
2643
- this.find([...main.getStatements()]);
2659
+ this.find([...includeMainFile.getStatements()], includeMainFile, false);
2644
2660
  }
2645
2661
  }
2646
2662
  }
2647
- else if (name) {
2663
+ else if (nameToken) {
2648
2664
  if (type instanceof Statements.EndOfDefinition) {
2649
- this.macros.addMacro(name, contents);
2650
- name = undefined;
2665
+ this.macros.addMacro(nameToken.getStr(), contents, file.getFilename());
2666
+ macroReferences === null || macroReferences === void 0 ? void 0 : macroReferences.addDefinition({ filename: file.getFilename(), token: nameToken }, start, statement.getLastToken().getEnd());
2667
+ nameToken = undefined;
2651
2668
  }
2652
2669
  else if (!(type instanceof _statement_1.Comment)) {
2653
2670
  statements[i] = new statement_node_1.StatementNode(new _statement_1.MacroContent()).setChildren(this.tokensToNodes(statement.getTokens()));
@@ -2656,17 +2673,26 @@ class ExpandMacros {
2656
2673
  }
2657
2674
  }
2658
2675
  }
2659
- handleMacros(statements) {
2676
+ handleMacros(statements, file) {
2677
+ var _a;
2660
2678
  const result = [];
2661
2679
  let containsUnknown = false;
2680
+ const macroReferences = (_a = this.reg) === null || _a === void 0 ? void 0 : _a.getMacroReferences();
2662
2681
  for (const statement of statements) {
2663
2682
  const type = statement.get();
2664
2683
  if (type instanceof _statement_1.Unknown || type instanceof _statement_1.MacroCall) {
2665
2684
  const macroName = this.findName(statement.getTokens());
2666
2685
  if (macroName && this.macros.isMacro(macroName)) {
2686
+ const filename = this.macros.getMacroFilename(macroName);
2687
+ if (filename) {
2688
+ macroReferences === null || macroReferences === void 0 ? void 0 : macroReferences.addReference({
2689
+ filename: filename,
2690
+ token: statement.getFirstToken(),
2691
+ });
2692
+ }
2667
2693
  result.push(new statement_node_1.StatementNode(new _statement_1.MacroCall(), statement.getColon()).setChildren(this.tokensToNodes(statement.getTokens())));
2668
2694
  const expanded = this.expandContents(macroName, statement);
2669
- const handled = this.handleMacros(expanded);
2695
+ const handled = this.handleMacros(expanded, file);
2670
2696
  for (const e of handled.statements) {
2671
2697
  result.push(e);
2672
2698
  }
@@ -3560,9 +3586,9 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
3560
3586
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
3561
3587
  class CondBody extends combi_1.Expression {
3562
3588
  getRunnable() {
3563
- const when = (0, combi_1.seq)("WHEN", (0, combi_1.alt)(_1.Cond, _1.Source), "THEN", (0, combi_1.alt)(_1.Source, _1.Throw));
3564
- const elsee = (0, combi_1.seq)("ELSE", (0, combi_1.alt)(_1.Source, _1.Throw));
3565
- return (0, combi_1.seq)((0, combi_1.opt)(_1.Let), (0, combi_1.plus)(when), (0, combi_1.opt)(elsee));
3589
+ const when = (0, combi_1.seq)("WHEN", (0, combi_1.altPrio)(_1.Cond, _1.Source), "THEN", (0, combi_1.altPrio)(_1.Throw, _1.Source));
3590
+ const elsee = (0, combi_1.seq)("ELSE", (0, combi_1.altPrio)(_1.Throw, _1.Source));
3591
+ return (0, combi_1.seq)((0, combi_1.optPrio)(_1.Let), (0, combi_1.plusPrio)(when), (0, combi_1.optPrio)(elsee));
3566
3592
  }
3567
3593
  }
3568
3594
  exports.CondBody = CondBody;
@@ -6836,9 +6862,10 @@ class SQLCase extends combi_1.Expression {
6836
6862
  getRunnable() {
6837
6863
  const field = (0, combi_1.altPrio)(_1.SQLAggregation, SQLCase, _1.SQLFunction, _1.SQLPath, sql_field_name_1.SQLFieldName, constant_1.Constant);
6838
6864
  const sub = (0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
6839
- const when = (0, combi_1.seq)("WHEN", (0, combi_1.alt)(constant_1.Constant, sql_cond_1.SQLCond), "THEN", (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLFunction, sql_source_1.SQLSource), (0, combi_1.starPrio)(sub));
6840
- const els = (0, combi_1.seq)("ELSE", sql_source_1.SQLSource);
6841
- return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)(sql_field_name_1.SQLFieldName), (0, combi_1.plus)(when), (0, combi_1.optPrio)(els), "END"));
6865
+ const sourc = (0, combi_1.altPrio)(SQLCase, _1.SQLAggregation, _1.SQLFunction, sql_source_1.SQLSource);
6866
+ const when = (0, combi_1.seq)("WHEN", (0, combi_1.altPrio)(sql_cond_1.SQLCond, constant_1.Constant), "THEN", sourc, (0, combi_1.starPrio)(sub));
6867
+ const els = (0, combi_1.seq)("ELSE", sourc);
6868
+ return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)(sql_field_name_1.SQLFieldName), (0, combi_1.plusPrio)(when), (0, combi_1.optPrio)(els), "END"));
6842
6869
  }
6843
6870
  }
6844
6871
  exports.SQLCase = SQLCase;
@@ -7232,21 +7259,22 @@ const sql_aggregation_1 = __webpack_require__(/*! ./sql_aggregation */ "./node_m
7232
7259
  class SQLFunction extends combi_1.Expression {
7233
7260
  getRunnable() {
7234
7261
  const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), source_1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
7235
- const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.alt)(simple_source3_1.SimpleSource3, paren)));
7236
- const param = (0, combi_1.alt)(sql_field_name_1.SQLFieldName, sql_alias_field_1.SQLAliasField, SQLFunction, constant_1.Constant, sql_aggregation_1.SQLAggregation, at);
7262
+ const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(simple_source3_1.SimpleSource3, paren)));
7263
+ const param = (0, combi_1.altPrio)(SQLFunction, sql_aggregation_1.SQLAggregation, sql_field_name_1.SQLFieldName, sql_alias_field_1.SQLAliasField, constant_1.Constant, at);
7237
7264
  const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.seq)("DEC", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, ",", integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), "FLTP", "NUMC", "INT8");
7265
+ const commaParam = (0, combi_1.seq)(",", param);
7238
7266
  const abs = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("abs", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7239
7267
  const cast = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("cast", (0, combi_1.tok)(tokens_1.ParenLeftW), param, "AS", castTypes, (0, combi_1.tok)(tokens_1.WParenRightW)));
7240
7268
  const ceil = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("ceil", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7241
- const coalesce = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("coalesce", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7242
- const concat = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("concat", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7243
- const div = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("div", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7269
+ const coalesce = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("coalesce", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.optPrio)(commaParam), (0, combi_1.tok)(tokens_1.WParenRightW)));
7270
+ const concat = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("concat", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
7271
+ const div = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("div", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
7244
7272
  const floor = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("floor", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7245
7273
  const length = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("length", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7246
7274
  const lower = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("lower", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7247
- const mod = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("mod", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7248
- const replace = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("replace", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7249
- const round = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("round", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7275
+ const mod = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("mod", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
7276
+ const replace = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("replace", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
7277
+ const round = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("round", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
7250
7278
  const upper = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("upper", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
7251
7279
  const uuid = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("uuid", (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.tok)(tokens_1.WParenRightW)));
7252
7280
  return (0, combi_1.altPrio)(uuid, abs, ceil, floor, cast, div, mod, coalesce, concat, replace, length, lower, upper, round);
@@ -8522,10 +8550,10 @@ class StatementParser {
8522
8550
  for (const w of wa) {
8523
8551
  this.process(w);
8524
8552
  this.categorize(w);
8525
- macros.find(w.statements);
8553
+ macros.find(w.statements, w.file);
8526
8554
  }
8527
8555
  for (const w of wa) {
8528
- const res = macros.handleMacros(w.statements);
8556
+ const res = macros.handleMacros(w.statements, w.file);
8529
8557
  w.statements = res.statements;
8530
8558
  if (res.containsUnknown === true) {
8531
8559
  this.lazyUnknown(w);
@@ -16890,7 +16918,13 @@ StructureParser.singletons = {};
16890
16918
  "use strict";
16891
16919
 
16892
16920
  Object.defineProperty(exports, "__esModule", ({ value: true }));
16893
- exports.sub = exports.sta = exports.star = exports.opt = exports.beginEnd = exports.alt = exports.seq = void 0;
16921
+ exports.seq = seq;
16922
+ exports.alt = alt;
16923
+ exports.beginEnd = beginEnd;
16924
+ exports.opt = opt;
16925
+ exports.star = star;
16926
+ exports.sta = sta;
16927
+ exports.sub = sub;
16894
16928
  const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
16895
16929
  const _statement_1 = __webpack_require__(/*! ../../2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
16896
16930
  class Sequence {
@@ -17198,27 +17232,21 @@ class SubStatement {
17198
17232
  function seq(first, ...rest) {
17199
17233
  return new Sequence([first].concat(rest));
17200
17234
  }
17201
- exports.seq = seq;
17202
17235
  function alt(first, ...rest) {
17203
17236
  return new Alternative([first].concat(rest));
17204
17237
  }
17205
- exports.alt = alt;
17206
17238
  function beginEnd(begin, body, end) {
17207
17239
  return new Sequence([begin, body, end]);
17208
17240
  }
17209
- exports.beginEnd = beginEnd;
17210
17241
  function opt(o) {
17211
17242
  return new Optional(o);
17212
17243
  }
17213
- exports.opt = opt;
17214
17244
  function star(s) {
17215
17245
  return new Star(s);
17216
17246
  }
17217
- exports.star = star;
17218
17247
  function sta(s) {
17219
17248
  return new SubStatement(s);
17220
17249
  }
17221
- exports.sta = sta;
17222
17250
  const singletons = {};
17223
17251
  function sub(s) {
17224
17252
  if (singletons[s.name] === undefined) {
@@ -17226,7 +17254,6 @@ function sub(s) {
17226
17254
  }
17227
17255
  return singletons[s.name];
17228
17256
  }
17229
- exports.sub = sub;
17230
17257
  //# sourceMappingURL=_combi.js.map
17231
17258
 
17232
17259
  /***/ }),
@@ -17477,10 +17504,9 @@ const _combi_1 = __webpack_require__(/*! ./_combi */ "./node_modules/@abaplint/c
17477
17504
  const private_section_1 = __webpack_require__(/*! ./private_section */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/private_section.js");
17478
17505
  const protected_section_1 = __webpack_require__(/*! ./protected_section */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/protected_section.js");
17479
17506
  const public_section_1 = __webpack_require__(/*! ./public_section */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/public_section.js");
17480
- const statements_1 = __webpack_require__(/*! ../../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
17481
17507
  class ClassDefinition {
17482
17508
  getMatcher() {
17483
- const body = (0, _combi_1.seq)((0, _combi_1.opt)((0, _combi_1.sta)(statements_1.SetExtendedCheck)), (0, _combi_1.star)((0, _combi_1.sta)(statements_1.TypePools)), (0, _combi_1.opt)((0, _combi_1.sub)(public_section_1.PublicSection)), (0, _combi_1.opt)((0, _combi_1.sub)(protected_section_1.ProtectedSection)), (0, _combi_1.opt)((0, _combi_1.sub)(private_section_1.PrivateSection)), (0, _combi_1.opt)((0, _combi_1.sta)(statements_1.SetExtendedCheck)));
17509
+ const body = (0, _combi_1.seq)((0, _combi_1.opt)((0, _combi_1.sta)(Statements.SetExtendedCheck)), (0, _combi_1.star)((0, _combi_1.sta)(Statements.TypePools)), (0, _combi_1.opt)((0, _combi_1.sub)(public_section_1.PublicSection)), (0, _combi_1.star)((0, _combi_1.sta)(Statements.Include)), (0, _combi_1.opt)((0, _combi_1.sub)(protected_section_1.ProtectedSection)), (0, _combi_1.opt)((0, _combi_1.sub)(private_section_1.PrivateSection)), (0, _combi_1.opt)((0, _combi_1.sta)(Statements.SetExtendedCheck)));
17484
17510
  return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.ClassDefinition), body, (0, _combi_1.sta)(Statements.EndClass));
17485
17511
  }
17486
17512
  }
@@ -33383,13 +33409,13 @@ class FlowGraph {
33383
33409
  this.label = label;
33384
33410
  }
33385
33411
  toDigraph() {
33386
- return `digraph G {
33387
- labelloc="t";
33388
- label="${this.label}";
33389
- graph [fontname = "helvetica"];
33390
- node [fontname = "helvetica", shape="box"];
33391
- edge [fontname = "helvetica"];
33392
- ${this.toTextEdges()}
33412
+ return `digraph G {
33413
+ labelloc="t";
33414
+ label="${this.label}";
33415
+ graph [fontname = "helvetica"];
33416
+ node [fontname = "helvetica", shape="box"];
33417
+ edge [fontname = "helvetica"];
33418
+ ${this.toTextEdges()}
33393
33419
  }`;
33394
33420
  }
33395
33421
  listSources(node) {
@@ -38759,7 +38785,10 @@ const cds_association_1 = __webpack_require__(/*! ./cds_association */ "./node_m
38759
38785
  const cds_join_1 = __webpack_require__(/*! ./cds_join */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_join.js");
38760
38786
  class CDSSelect extends combi_1.Expression {
38761
38787
  getRunnable() {
38762
- return (0, combi_1.seq)("SELECT", (0, combi_1.opt)("DISTINCT"), "FROM", _1.CDSSource, (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs), (0, combi_1.star)(cds_join_1.CDSJoin), (0, combi_1.star)(_1.CDSComposition), (0, combi_1.star)(cds_association_1.CDSAssociation), (0, combi_1.star)(_1.CDSComposition), (0, combi_1.str)("{"), (0, combi_1.plus)(_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.str)("}"), (0, combi_1.opt)(_1.CDSGroupBy), (0, combi_1.opt)(_1.CDSWhere), (0, combi_1.opt)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), CDSSelect)));
38788
+ const fields = (0, combi_1.opt)((0, combi_1.seq)((0, combi_1.star)((0, combi_1.seq)(_1.CDSElement, ",")), _1.CDSElement));
38789
+ const distinct = (0, combi_1.str)("DISTINCT");
38790
+ const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.plus)(_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.str)("}"));
38791
+ return (0, combi_1.seq)("SELECT", (0, combi_1.opt)(distinct), (0, combi_1.opt)(fields), "FROM", _1.CDSSource, (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs), (0, combi_1.star)(cds_join_1.CDSJoin), (0, combi_1.star)(_1.CDSComposition), (0, combi_1.star)(cds_association_1.CDSAssociation), (0, combi_1.star)(_1.CDSComposition), (0, combi_1.opt)(elements), (0, combi_1.opt)(_1.CDSGroupBy), (0, combi_1.opt)(_1.CDSWhere), (0, combi_1.opt)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), CDSSelect)));
38763
38792
  }
38764
38793
  }
38765
38794
  exports.CDSSelect = CDSSelect;
@@ -39916,7 +39945,9 @@ __exportStar(__webpack_require__(/*! ./ddl_type */ "./node_modules/@abaplint/cor
39916
39945
  "use strict";
39917
39946
 
39918
39947
  Object.defineProperty(exports, "__esModule", ({ value: true }));
39919
- exports.applyEditList = exports.applyEditSingle = exports.EditHelper = exports.EditDraft = void 0;
39948
+ exports.EditHelper = exports.EditDraft = void 0;
39949
+ exports.applyEditSingle = applyEditSingle;
39950
+ exports.applyEditList = applyEditList;
39920
39951
  const position_1 = __webpack_require__(/*! ./position */ "./node_modules/@abaplint/core/build/src/position.js");
39921
39952
  const memory_file_1 = __webpack_require__(/*! ./files/memory_file */ "./node_modules/@abaplint/core/build/src/files/memory_file.js");
39922
39953
  class EditDraft {
@@ -40134,7 +40165,6 @@ function applyEditSingle(reg, edit) {
40134
40165
  reg.updateFile(result);
40135
40166
  }
40136
40167
  }
40137
- exports.applyEditSingle = applyEditSingle;
40138
40168
  /** returns list of filenames which were changed */
40139
40169
  function applyEditList(reg, edits) {
40140
40170
  const ret = [];
@@ -40164,7 +40194,6 @@ function applyEditList(reg, edits) {
40164
40194
  }
40165
40195
  return ret;
40166
40196
  }
40167
- exports.applyEditList = applyEditList;
40168
40197
  //# sourceMappingURL=edit_helper.js.map
40169
40198
 
40170
40199
  /***/ }),
@@ -40261,8 +40290,8 @@ exports.MemoryFile = MemoryFile;
40261
40290
  "use strict";
40262
40291
 
40263
40292
  Object.defineProperty(exports, "__esModule", ({ value: true }));
40264
- exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.ABAPFile = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = exports.applyEditList = exports.applyEditSingle = exports.SpaghettiScopeNode = exports.AbstractFile = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.ReferenceType = exports.Version = exports.Config = exports.Issue = exports.MemoryFile = void 0;
40265
- exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = void 0;
40293
+ exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.ABAPFile = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = exports.NativeSQL = exports.MacroContent = exports.MacroCall = exports.applyEditList = exports.applyEditSingle = exports.SpaghettiScopeNode = exports.AbstractFile = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.ReferenceType = exports.Version = exports.Config = exports.Issue = exports.MemoryFile = void 0;
40294
+ exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = void 0;
40266
40295
  const issue_1 = __webpack_require__(/*! ./issue */ "./node_modules/@abaplint/core/build/src/issue.js");
40267
40296
  Object.defineProperty(exports, "Issue", ({ enumerable: true, get: function () { return issue_1.Issue; } }));
40268
40297
  const config_1 = __webpack_require__(/*! ./config */ "./node_modules/@abaplint/core/build/src/config.js");
@@ -40330,6 +40359,9 @@ const _statement_1 = __webpack_require__(/*! ./abap/2_statements/statements/_sta
40330
40359
  Object.defineProperty(exports, "Empty", ({ enumerable: true, get: function () { return _statement_1.Empty; } }));
40331
40360
  Object.defineProperty(exports, "Unknown", ({ enumerable: true, get: function () { return _statement_1.Unknown; } }));
40332
40361
  Object.defineProperty(exports, "Comment", ({ enumerable: true, get: function () { return _statement_1.Comment; } }));
40362
+ Object.defineProperty(exports, "MacroCall", ({ enumerable: true, get: function () { return _statement_1.MacroCall; } }));
40363
+ Object.defineProperty(exports, "MacroContent", ({ enumerable: true, get: function () { return _statement_1.MacroContent; } }));
40364
+ Object.defineProperty(exports, "NativeSQL", ({ enumerable: true, get: function () { return _statement_1.NativeSQL; } }));
40333
40365
  const edit_helper_1 = __webpack_require__(/*! ./edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
40334
40366
  Object.defineProperty(exports, "applyEditSingle", ({ enumerable: true, get: function () { return edit_helper_1.applyEditSingle; } }));
40335
40367
  Object.defineProperty(exports, "applyEditList", ({ enumerable: true, get: function () { return edit_helper_1.applyEditList; } }));
@@ -40592,6 +40624,7 @@ const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./n
40592
40624
  const _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
40593
40625
  const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
40594
40626
  const types_1 = __webpack_require__(/*! ../abap/types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
40627
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
40595
40628
  class LSPLookup {
40596
40629
  static lookup(cursor, reg, obj) {
40597
40630
  var _a, _b;
@@ -40708,6 +40741,18 @@ class LSPLookup {
40708
40741
  scope: bottomScope,
40709
40742
  };
40710
40743
  }
40744
+ if (cursor.snode.get() instanceof _statement_1.MacroCall) {
40745
+ const macroDefinition = reg.getMacroReferences().findDefinitionByUsage(cursor.identifier.getFilename(), cursor.snode.getFirstToken());
40746
+ if (macroDefinition) {
40747
+ return {
40748
+ hover: "Macro Call",
40749
+ definition: {
40750
+ uri: macroDefinition === null || macroDefinition === void 0 ? void 0 : macroDefinition.filename,
40751
+ range: _lsp_utils_1.LSPUtils.tokenToRange(macroDefinition.token),
40752
+ },
40753
+ };
40754
+ }
40755
+ }
40711
40756
  if (hoverValue !== "") {
40712
40757
  return { hover: hoverValue, scope: bottomScope };
40713
40758
  }
@@ -41084,6 +41129,9 @@ class CodeActions {
41084
41129
  const diagnostics = [];
41085
41130
  const fixes = [];
41086
41131
  for (const i of issues) {
41132
+ if (i.getKey() !== key) {
41133
+ continue;
41134
+ }
41087
41135
  const fix = i.getDefaultFix();
41088
41136
  if (fix === undefined) {
41089
41137
  continue;
@@ -41466,13 +41514,13 @@ class Help {
41466
41514
  /////////////////////////////////////////////////
41467
41515
  static dumpABAP(file, reg, textDocument, position) {
41468
41516
  let content = "";
41469
- content = `
41470
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
41471
- <a href="#_statements" rel="no-refresh">Statements</a> |
41472
- <a href="#_structure" rel="no-refresh">Structure</a> |
41473
- <a href="#_files" rel="no-refresh">Files</a> |
41474
- <a href="#_info" rel="no-refresh">Info Dump</a>
41475
- <hr>
41517
+ content = `
41518
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
41519
+ <a href="#_statements" rel="no-refresh">Statements</a> |
41520
+ <a href="#_structure" rel="no-refresh">Structure</a> |
41521
+ <a href="#_files" rel="no-refresh">Files</a> |
41522
+ <a href="#_info" rel="no-refresh">Info Dump</a>
41523
+ <hr>
41476
41524
  ` +
41477
41525
  "<tt>" + textDocument.uri + " (" +
41478
41526
  (position.line + 1) + ", " +
@@ -41772,11 +41820,13 @@ exports.Highlight = Highlight;
41772
41820
 
41773
41821
  Object.defineProperty(exports, "__esModule", ({ value: true }));
41774
41822
  exports.Hover = void 0;
41823
+ const Tokens = __webpack_require__(/*! ../abap/1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
41824
+ const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
41775
41825
  const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
41776
41826
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
41777
41827
  const _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
41778
- const Tokens = __webpack_require__(/*! ../abap/1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
41779
41828
  const _lookup_1 = __webpack_require__(/*! ./_lookup */ "./node_modules/@abaplint/core/build/src/lsp/_lookup.js");
41829
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
41780
41830
  class Hover {
41781
41831
  constructor(reg) {
41782
41832
  this.reg = reg;
@@ -41800,6 +41850,12 @@ class Hover {
41800
41850
  || found.token instanceof Tokens.StringTemplateMiddle) {
41801
41851
  return { kind: LServer.MarkupKind.Markdown, value: "String Template" };
41802
41852
  }
41853
+ else if (found.snode.get() instanceof _statement_1.MacroCall) {
41854
+ return { kind: LServer.MarkupKind.Markdown, value: "Macro Call" };
41855
+ }
41856
+ else if (found.snode.get() instanceof Statements.Define && found.stack.length === 2) {
41857
+ return { kind: LServer.MarkupKind.Markdown, value: "Macro Name" };
41858
+ }
41803
41859
  else if (found.token instanceof Tokens.Comment) {
41804
41860
  let type = "Comment";
41805
41861
  if (found.token.getStr().startsWith(`"!`)) {
@@ -42168,6 +42224,7 @@ class References {
42168
42224
  const locs = this.search(lookup.definitionId, lookup.scope);
42169
42225
  return locs.map(_lsp_utils_1.LSPUtils.identiferToLocation);
42170
42226
  }
42227
+ ////////////////////////////////////////////
42171
42228
  // todo, cleanup this mehtod, some of the method parameters are not used anymore?
42172
42229
  search(identifier, node, exitAfterFound = false, removeDuplicates = true) {
42173
42230
  let ret = [];
@@ -42195,7 +42252,6 @@ class References {
42195
42252
  return ret;
42196
42253
  }
42197
42254
  }
42198
- ////////////////////////////////////////////
42199
42255
  removeDuplicates(arr) {
42200
42256
  const values = {};
42201
42257
  return arr.filter(item => {
@@ -42621,6 +42677,87 @@ exports.Symbols = Symbols;
42621
42677
 
42622
42678
  /***/ }),
42623
42679
 
42680
+ /***/ "./node_modules/@abaplint/core/build/src/macro_references.js":
42681
+ /*!*******************************************************************!*\
42682
+ !*** ./node_modules/@abaplint/core/build/src/macro_references.js ***!
42683
+ \*******************************************************************/
42684
+ /***/ ((__unused_webpack_module, exports) => {
42685
+
42686
+ "use strict";
42687
+
42688
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
42689
+ exports.MacroReferences = void 0;
42690
+ class MacroReferences {
42691
+ constructor() {
42692
+ this.definitions = {};
42693
+ this.references = {};
42694
+ }
42695
+ addDefinition(ref, start, end) {
42696
+ if (this.definitions[ref.filename] === undefined) {
42697
+ this.definitions[ref.filename] = [];
42698
+ }
42699
+ else if (this.definitions[ref.filename].find((d) => d.token.getStart().equals(ref.token.getStart()))) {
42700
+ return;
42701
+ }
42702
+ this.definitions[ref.filename].push({ token: ref.token, start, end });
42703
+ }
42704
+ getDefinitionRange(filename, token) {
42705
+ for (const d of this.definitions[filename] || []) {
42706
+ if (d.token.getStart().equals(token.getStart())) {
42707
+ return { start: d.start, end: d.end };
42708
+ }
42709
+ }
42710
+ return undefined;
42711
+ }
42712
+ addReference(ref) {
42713
+ if (this.references[ref.filename] === undefined) {
42714
+ this.references[ref.filename] = [];
42715
+ }
42716
+ this.references[ref.filename].push(ref);
42717
+ }
42718
+ listDefinitionsByFile(filename) {
42719
+ const ret = [];
42720
+ for (const d of this.definitions[filename] || []) {
42721
+ ret.push(d.token);
42722
+ }
42723
+ return ret;
42724
+ }
42725
+ listUsagesbyMacro(filename, token) {
42726
+ const ret = [];
42727
+ const tokenStr = token.getStr().toUpperCase();
42728
+ for (const ref of this.references[filename] || []) {
42729
+ if (ref.token.getStr().toUpperCase() === tokenStr) {
42730
+ ret.push(ref);
42731
+ }
42732
+ }
42733
+ return ret;
42734
+ }
42735
+ clear(filename) {
42736
+ delete this.definitions[filename];
42737
+ delete this.references[filename];
42738
+ }
42739
+ findDefinitionByUsage(filename, token) {
42740
+ const tokenStr = token.getStr().toUpperCase();
42741
+ for (const ref of this.references[filename] || []) {
42742
+ if (ref.token.getStart().equals(token.getStart())) {
42743
+ for (const d of this.definitions[ref.filename] || []) {
42744
+ if (d.token.getStr().toUpperCase() === tokenStr) {
42745
+ return {
42746
+ filename: ref.filename,
42747
+ token: d.token,
42748
+ };
42749
+ }
42750
+ }
42751
+ }
42752
+ }
42753
+ return undefined;
42754
+ }
42755
+ }
42756
+ exports.MacroReferences = MacroReferences;
42757
+ //# sourceMappingURL=macro_references.js.map
42758
+
42759
+ /***/ }),
42760
+
42624
42761
  /***/ "./node_modules/@abaplint/core/build/src/msag_references.js":
42625
42762
  /*!******************************************************************!*\
42626
42763
  !*** ./node_modules/@abaplint/core/build/src/msag_references.js ***!
@@ -50526,6 +50663,7 @@ const excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ "./node
50526
50663
  const ddic_references_1 = __webpack_require__(/*! ./ddic_references */ "./node_modules/@abaplint/core/build/src/ddic_references.js");
50527
50664
  const rules_runner_1 = __webpack_require__(/*! ./rules_runner */ "./node_modules/@abaplint/core/build/src/rules_runner.js");
50528
50665
  const msag_references_1 = __webpack_require__(/*! ./msag_references */ "./node_modules/@abaplint/core/build/src/msag_references.js");
50666
+ const macro_references_1 = __webpack_require__(/*! ./macro_references */ "./node_modules/@abaplint/core/build/src/macro_references.js");
50529
50667
  // todo, this should really be an instance in case there are multiple Registry'ies
50530
50668
  class ParsingPerformance {
50531
50669
  static clear() {
@@ -50580,10 +50718,11 @@ class Registry {
50580
50718
  this.conf = conf ? conf : config_1.Config.getDefault();
50581
50719
  this.ddicReferences = new ddic_references_1.DDICReferences();
50582
50720
  this.msagReferences = new msag_references_1.MSAGReferences();
50721
+ this.macroReferences = new macro_references_1.MacroReferences();
50583
50722
  }
50584
50723
  static abaplintVersion() {
50585
50724
  // magic, see build script "version.sh"
50586
- return "2.108.12";
50725
+ return "2.110.4";
50587
50726
  }
50588
50727
  getDDICReferences() {
50589
50728
  return this.ddicReferences;
@@ -50591,6 +50730,9 @@ class Registry {
50591
50730
  getMSAGReferences() {
50592
50731
  return this.msagReferences;
50593
50732
  }
50733
+ getMacroReferences() {
50734
+ return this.macroReferences;
50735
+ }
50594
50736
  *getObjects() {
50595
50737
  for (const name in this.objects) {
50596
50738
  for (const type in this.objects[name]) {
@@ -50899,10 +51041,10 @@ class SevenBitAscii {
50899
51041
  key: "7bit_ascii",
50900
51042
  title: "Check for 7bit ascii",
50901
51043
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
50902
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
50903
-
50904
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
50905
-
51044
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
51045
+
51046
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
51047
+
50906
51048
  Checkes files with extensions ".abap" and ".asddls"`,
50907
51049
  tags: [_irule_1.RuleTag.SingleFile],
50908
51050
  badExample: `WRITE '뽑'.`,
@@ -51108,10 +51250,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
51108
51250
  key: "abapdoc",
51109
51251
  title: "Check abapdoc",
51110
51252
  shortDescription: `Various checks regarding abapdoc.`,
51111
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
51112
-
51113
- Plus class and interface definitions.
51114
-
51253
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
51254
+
51255
+ Plus class and interface definitions.
51256
+
51115
51257
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
51116
51258
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
51117
51259
  };
@@ -51249,49 +51391,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
51249
51391
  key: "align_parameters",
51250
51392
  title: "Align Parameters",
51251
51393
  shortDescription: `Checks for vertially aligned parameters`,
51252
- extendedInformation: `Checks:
51253
- * function module calls
51254
- * method calls
51255
- * VALUE constructors
51256
- * NEW constructors
51257
- * RAISE EXCEPTION statements
51258
- * CREATE OBJECT statements
51259
- * RAISE EVENT statements
51260
-
51261
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
51262
-
51263
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
51264
-
51265
- If parameters are on the same row, no issues are reported, see
51394
+ extendedInformation: `Checks:
51395
+ * function module calls
51396
+ * method calls
51397
+ * VALUE constructors
51398
+ * NEW constructors
51399
+ * RAISE EXCEPTION statements
51400
+ * CREATE OBJECT statements
51401
+ * RAISE EVENT statements
51402
+
51403
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
51404
+
51405
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
51406
+
51407
+ If parameters are on the same row, no issues are reported, see
51266
51408
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
51267
51409
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
51268
- badExample: `CALL FUNCTION 'FOOBAR'
51269
- EXPORTING
51270
- foo = 2
51271
- parameter = 3.
51272
-
51273
- foobar( moo = 1
51274
- param = 1 ).
51275
-
51276
- foo = VALUE #(
51277
- foo = bar
51410
+ badExample: `CALL FUNCTION 'FOOBAR'
51411
+ EXPORTING
51412
+ foo = 2
51413
+ parameter = 3.
51414
+
51415
+ foobar( moo = 1
51416
+ param = 1 ).
51417
+
51418
+ foo = VALUE #(
51419
+ foo = bar
51278
51420
  moo = 2 ).`,
51279
- goodExample: `CALL FUNCTION 'FOOBAR'
51280
- EXPORTING
51281
- foo = 2
51282
- parameter = 3.
51283
-
51284
- foobar( moo = 1
51285
- param = 1 ).
51286
-
51287
- foo = VALUE #(
51288
- foo = bar
51289
- moo = 2 ).
51290
-
51291
- DATA(sdf) = VALUE type(
51292
- common_val = 2
51293
- another_common = 5
51294
- ( row_value = 4
51421
+ goodExample: `CALL FUNCTION 'FOOBAR'
51422
+ EXPORTING
51423
+ foo = 2
51424
+ parameter = 3.
51425
+
51426
+ foobar( moo = 1
51427
+ param = 1 ).
51428
+
51429
+ foo = VALUE #(
51430
+ foo = bar
51431
+ moo = 2 ).
51432
+
51433
+ DATA(sdf) = VALUE type(
51434
+ common_val = 2
51435
+ another_common = 5
51436
+ ( row_value = 4
51295
51437
  value_foo = 5 ) ).`,
51296
51438
  };
51297
51439
  }
@@ -51725,37 +51867,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
51725
51867
  key: "align_type_expressions",
51726
51868
  title: "Align TYPE expressions",
51727
51869
  shortDescription: `Align TYPE expressions in statements`,
51728
- extendedInformation: `
51729
- Currently works for METHODS + BEGIN OF
51730
-
51731
- If BEGIN OF has an INCLUDE TYPE its ignored
51732
-
51733
- Also note that clean ABAP does not recommend aligning TYPE clauses:
51870
+ extendedInformation: `
51871
+ Currently works for METHODS + BEGIN OF
51872
+
51873
+ If BEGIN OF has an INCLUDE TYPE its ignored
51874
+
51875
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
51734
51876
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
51735
51877
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
51736
- badExample: `
51737
- TYPES: BEGIN OF foo,
51738
- bar TYPE i,
51739
- foobar TYPE i,
51740
- END OF foo.
51741
-
51742
- INTERFACE lif.
51743
- METHODS bar
51744
- IMPORTING
51745
- foo TYPE i
51746
- foobar TYPE i.
51878
+ badExample: `
51879
+ TYPES: BEGIN OF foo,
51880
+ bar TYPE i,
51881
+ foobar TYPE i,
51882
+ END OF foo.
51883
+
51884
+ INTERFACE lif.
51885
+ METHODS bar
51886
+ IMPORTING
51887
+ foo TYPE i
51888
+ foobar TYPE i.
51747
51889
  ENDINTERFACE.`,
51748
- goodExample: `
51749
- TYPES: BEGIN OF foo,
51750
- bar TYPE i,
51751
- foobar TYPE i,
51752
- END OF foo.
51753
-
51754
- INTERFACE lif.
51755
- METHODS bar
51756
- IMPORTING
51757
- foo TYPE i
51758
- foobar TYPE i.
51890
+ goodExample: `
51891
+ TYPES: BEGIN OF foo,
51892
+ bar TYPE i,
51893
+ foobar TYPE i,
51894
+ END OF foo.
51895
+
51896
+ INTERFACE lif.
51897
+ METHODS bar
51898
+ IMPORTING
51899
+ foo TYPE i
51900
+ foobar TYPE i.
51759
51901
  ENDINTERFACE.`,
51760
51902
  };
51761
51903
  }
@@ -52034,15 +52176,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
52034
52176
  return {
52035
52177
  key: "ambiguous_statement",
52036
52178
  title: "Check for ambigious statements",
52037
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52038
- Add "TABLE" keyword or "@" for escaping SQL variables
52039
-
52179
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52180
+ Add "TABLE" keyword or "@" for escaping SQL variables
52181
+
52040
52182
  Only works if the target version is 740sp05 or above`,
52041
52183
  tags: [_irule_1.RuleTag.SingleFile],
52042
- badExample: `DELETE foo FROM bar.
52184
+ badExample: `DELETE foo FROM bar.
52043
52185
  MODIFY foo FROM bar.`,
52044
- goodExample: `DELETE foo FROM @bar.
52045
- MODIFY TABLE foo FROM bar.
52186
+ goodExample: `DELETE foo FROM @bar.
52187
+ MODIFY TABLE foo FROM bar.
52046
52188
  MODIFY zfoo FROM @wa.`,
52047
52189
  };
52048
52190
  }
@@ -52147,16 +52289,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
52147
52289
  key: "avoid_use",
52148
52290
  title: "Avoid use of certain statements",
52149
52291
  shortDescription: `Detects usage of certain statements.`,
52150
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
52151
-
52152
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
52153
-
52154
- STATICS: use CLASS-DATA instead
52155
-
52156
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
52157
-
52158
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
52159
-
52292
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
52293
+
52294
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
52295
+
52296
+ STATICS: use CLASS-DATA instead
52297
+
52298
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
52299
+
52300
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
52301
+
52160
52302
  BREAK points`,
52161
52303
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
52162
52304
  };
@@ -52288,11 +52430,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
52288
52430
  title: "Check BEGIN END names",
52289
52431
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
52290
52432
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
52291
- badExample: `DATA: BEGIN OF stru,
52292
- field TYPE i,
52433
+ badExample: `DATA: BEGIN OF stru,
52434
+ field TYPE i,
52293
52435
  END OF structure_not_the_same.`,
52294
- goodExample: `DATA: BEGIN OF stru,
52295
- field TYPE i,
52436
+ goodExample: `DATA: BEGIN OF stru,
52437
+ field TYPE i,
52296
52438
  END OF stru.`,
52297
52439
  };
52298
52440
  }
@@ -52389,20 +52531,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
52389
52531
  title: "BEGIN contains single INCLUDE",
52390
52532
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
52391
52533
  tags: [_irule_1.RuleTag.SingleFile],
52392
- badExample: `TYPES: BEGIN OF dummy1.
52393
- INCLUDE TYPE dselc.
52394
- TYPES: END OF dummy1.
52395
-
52396
- DATA BEGIN OF foo.
52397
- INCLUDE STRUCTURE syst.
52398
- DATA END OF foo.
52399
-
52400
- STATICS BEGIN OF bar.
52401
- INCLUDE STRUCTURE syst.
52534
+ badExample: `TYPES: BEGIN OF dummy1.
52535
+ INCLUDE TYPE dselc.
52536
+ TYPES: END OF dummy1.
52537
+
52538
+ DATA BEGIN OF foo.
52539
+ INCLUDE STRUCTURE syst.
52540
+ DATA END OF foo.
52541
+
52542
+ STATICS BEGIN OF bar.
52543
+ INCLUDE STRUCTURE syst.
52402
52544
  STATICS END OF bar.`,
52403
- goodExample: `DATA BEGIN OF foo.
52404
- DATA field TYPE i.
52405
- INCLUDE STRUCTURE dselc.
52545
+ goodExample: `DATA BEGIN OF foo.
52546
+ DATA field TYPE i.
52547
+ INCLUDE STRUCTURE dselc.
52406
52548
  DATA END OF foo.`,
52407
52549
  };
52408
52550
  }
@@ -52492,9 +52634,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
52492
52634
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
52493
52635
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
52494
52636
  badExample: `CALL TRANSACTION 'FOO'.`,
52495
- goodExample: `TRY.
52496
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
52497
- CATCH cx_sy_authorization_error.
52637
+ goodExample: `TRY.
52638
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
52639
+ CATCH cx_sy_authorization_error.
52498
52640
  ENDTRY.`,
52499
52641
  };
52500
52642
  }
@@ -52559,10 +52701,10 @@ class CDSCommentStyle {
52559
52701
  key: "cds_comment_style",
52560
52702
  title: "CDS Comment Style",
52561
52703
  shortDescription: `Check for obsolete comment style`,
52562
- extendedInformation: `Check for obsolete comment style
52563
-
52564
- Comments starting with "--" are considered obsolete
52565
-
52704
+ extendedInformation: `Check for obsolete comment style
52705
+
52706
+ Comments starting with "--" are considered obsolete
52707
+
52566
52708
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
52567
52709
  tags: [_irule_1.RuleTag.SingleFile],
52568
52710
  badExample: "-- this is a comment",
@@ -52629,10 +52771,10 @@ class CDSLegacyView {
52629
52771
  title: "CDS Legacy View",
52630
52772
  shortDescription: `Identify CDS Legacy Views`,
52631
52773
  // eslint-disable-next-line max-len
52632
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
52633
-
52634
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
52635
-
52774
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
52775
+
52776
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
52777
+
52636
52778
  v755 and up`,
52637
52779
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
52638
52780
  };
@@ -52787,10 +52929,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
52787
52929
  key: "chain_mainly_declarations",
52788
52930
  title: "Chain mainly declarations",
52789
52931
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
52790
- extendedInformation: `
52791
- https://docs.abapopenchecks.org/checks/23/
52792
-
52793
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
52932
+ extendedInformation: `
52933
+ https://docs.abapopenchecks.org/checks/23/
52934
+
52935
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
52794
52936
  `,
52795
52937
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
52796
52938
  badExample: `CALL METHOD: bar.`,
@@ -52966,17 +53108,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
52966
53108
  title: "Change IF to CASE",
52967
53109
  shortDescription: `Finds IF constructs that can be changed to CASE`,
52968
53110
  // eslint-disable-next-line max-len
52969
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
52970
-
53111
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
53112
+
52971
53113
  If the first comparison is a boolean compare, no issue is reported.`,
52972
53114
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
52973
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
52974
- ELSEIF l_fcat-fieldname = 'BAR'
52975
- OR l_fcat-fieldname = 'MOO'.
53115
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
53116
+ ELSEIF l_fcat-fieldname = 'BAR'
53117
+ OR l_fcat-fieldname = 'MOO'.
52976
53118
  ENDIF.`,
52977
- goodExample: `CASE l_fcat-fieldname.
52978
- WHEN 'FOO'.
52979
- WHEN 'BAR' OR 'MOO'.
53119
+ goodExample: `CASE l_fcat-fieldname.
53120
+ WHEN 'FOO'.
53121
+ WHEN 'BAR' OR 'MOO'.
52980
53122
  ENDCASE.`,
52981
53123
  };
52982
53124
  }
@@ -53113,8 +53255,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
53113
53255
  return {
53114
53256
  key: "check_abstract",
53115
53257
  title: "Check abstract methods and classes",
53116
- shortDescription: `Checks abstract methods and classes:
53117
- - class defined as abstract and final,
53258
+ shortDescription: `Checks abstract methods and classes:
53259
+ - class defined as abstract and final,
53118
53260
  - non-abstract class contains abstract methods`,
53119
53261
  extendedInformation: `If a class defines only constants, use an interface instead`,
53120
53262
  tags: [_irule_1.RuleTag.SingleFile],
@@ -53195,11 +53337,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
53195
53337
  return {
53196
53338
  key: "check_comments",
53197
53339
  title: "Check Comments",
53198
- shortDescription: `
53340
+ shortDescription: `
53199
53341
  Various checks for comment usage.`,
53200
- extendedInformation: `
53201
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
53202
-
53342
+ extendedInformation: `
53343
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
53344
+
53203
53345
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
53204
53346
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
53205
53347
  badExample: `WRITE 2. " descriptive comment`,
@@ -53361,9 +53503,9 @@ class CheckInclude {
53361
53503
  key: "check_include",
53362
53504
  title: "Check INCLUDEs",
53363
53505
  shortDescription: `Checks INCLUDE statements`,
53364
- extendedInformation: `
53365
- * Reports unused includes
53366
- * Errors if the includes are not found
53506
+ extendedInformation: `
53507
+ * Reports unused includes
53508
+ * Errors if the includes are not found
53367
53509
  * Error if including a main program`,
53368
53510
  tags: [_irule_1.RuleTag.Syntax],
53369
53511
  };
@@ -53439,14 +53581,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
53439
53581
  key: "check_subrc",
53440
53582
  title: "Check sy-subrc",
53441
53583
  shortDescription: `Check sy-subrc`,
53442
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
53443
-
53444
- If sy-dbcnt is checked after database statements, it is considered okay.
53445
-
53446
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
53447
-
53448
- If IS ASSIGNED is checked after assigning, it is considered okay.
53449
-
53584
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
53585
+
53586
+ If sy-dbcnt is checked after database statements, it is considered okay.
53587
+
53588
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
53589
+
53590
+ If IS ASSIGNED is checked after assigning, it is considered okay.
53591
+
53450
53592
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
53451
53593
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
53452
53594
  pseudoComment: "EC CI_SUBRC",
@@ -54015,17 +54157,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
54015
54157
  shortDescription: `Find overlapping classic exceptions`,
54016
54158
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
54017
54159
  tags: [_irule_1.RuleTag.SingleFile],
54018
- badExample: `CALL FUNCTION 'SOMETHING'
54019
- EXCEPTIONS
54020
- system_failure = 1 MESSAGE lv_message
54021
- communication_failure = 1 MESSAGE lv_message
54022
- resource_failure = 1
54160
+ badExample: `CALL FUNCTION 'SOMETHING'
54161
+ EXCEPTIONS
54162
+ system_failure = 1 MESSAGE lv_message
54163
+ communication_failure = 1 MESSAGE lv_message
54164
+ resource_failure = 1
54023
54165
  OTHERS = 1.`,
54024
- goodExample: `CALL FUNCTION 'SOMETHING'
54025
- EXCEPTIONS
54026
- system_failure = 1 MESSAGE lv_message
54027
- communication_failure = 2 MESSAGE lv_message
54028
- resource_failure = 3
54166
+ goodExample: `CALL FUNCTION 'SOMETHING'
54167
+ EXCEPTIONS
54168
+ system_failure = 1 MESSAGE lv_message
54169
+ communication_failure = 2 MESSAGE lv_message
54170
+ resource_failure = 3
54029
54171
  OTHERS = 4.`,
54030
54172
  };
54031
54173
  }
@@ -54271,7 +54413,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
54271
54413
  key: "commented_code",
54272
54414
  title: "Find commented code",
54273
54415
  shortDescription: `Detects usage of commented out code.`,
54274
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
54416
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
54275
54417
  https://docs.abapopenchecks.org/checks/14/`,
54276
54418
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54277
54419
  badExample: `* WRITE 'hello world'.`,
@@ -54504,10 +54646,10 @@ class ConstructorVisibilityPublic {
54504
54646
  key: "constructor_visibility_public",
54505
54647
  title: "Check constructor visibility is public",
54506
54648
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
54507
- extendedInformation: `
54508
- This only applies to global classes.
54509
-
54510
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
54649
+ extendedInformation: `
54650
+ This only applies to global classes.
54651
+
54652
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
54511
54653
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
54512
54654
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54513
54655
  };
@@ -54582,8 +54724,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
54582
54724
  key: "contains_tab",
54583
54725
  title: "Code contains tab",
54584
54726
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
54585
- extendedInformation: `
54586
- https://docs.abapopenchecks.org/checks/09/
54727
+ extendedInformation: `
54728
+ https://docs.abapopenchecks.org/checks/09/
54587
54729
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
54588
54730
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54589
54731
  badExample: `\tWRITE 'hello world'.`,
@@ -54670,10 +54812,10 @@ class CyclicOO {
54670
54812
  key: "cyclic_oo",
54671
54813
  title: "Cyclic OO",
54672
54814
  shortDescription: `Finds cyclic OO references`,
54673
- extendedInformation: `Runs for global INTF + CLAS objects
54674
-
54675
- Objects must be without syntax errors for this rule to take effect
54676
-
54815
+ extendedInformation: `Runs for global INTF + CLAS objects
54816
+
54817
+ Objects must be without syntax errors for this rule to take effect
54818
+
54677
54819
  References in testclass includes are ignored`,
54678
54820
  };
54679
54821
  }
@@ -54915,7 +55057,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
54915
55057
  key: "dangerous_statement",
54916
55058
  title: "Dangerous statement",
54917
55059
  shortDescription: `Detects potentially dangerous statements`,
54918
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55060
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
54919
55061
  dynamic SQL can potentially create SQL injection problems`,
54920
55062
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
54921
55063
  };
@@ -55119,13 +55261,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
55119
55261
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
55120
55262
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
55121
55263
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55122
- badExample: `FROM foo.
55123
- WRITE 'hello'.
55124
- DATA int TYPE i.
55264
+ badExample: `FROM foo.
55265
+ WRITE 'hello'.
55266
+ DATA int TYPE i.
55125
55267
  ENDFORM.`,
55126
- goodExample: `FROM foo.
55127
- DATA int TYPE i.
55128
- WRITE 'hello'.
55268
+ goodExample: `FROM foo.
55269
+ DATA int TYPE i.
55270
+ WRITE 'hello'.
55129
55271
  ENDFORM.`,
55130
55272
  };
55131
55273
  }
@@ -55661,39 +55803,39 @@ class Downport {
55661
55803
  key: "downport",
55662
55804
  title: "Downport statement",
55663
55805
  shortDescription: `Downport functionality`,
55664
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
55665
- a higher level language version. If successful, various rules are applied to downport the statement.
55666
- Target downport version is always v702, thus rule is only enabled if target version is v702.
55667
-
55668
- Current rules:
55669
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
55670
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
55671
- * FIELD-SYMBOL() definitions are outlined
55672
- * CONV is outlined
55673
- * COND is outlined
55674
- * REDUCE is outlined
55675
- * SWITCH is outlined
55676
- * FILTER is outlined
55677
- * APPEND expression is outlined
55678
- * INSERT expression is outlined
55679
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
55680
- * CAST changed to ?=
55681
- * LOOP AT method_call( ) is outlined
55682
- * VALUE # with structure fields
55683
- * VALUE # with internal table lines
55684
- * Table Expressions are outlined
55685
- * SELECT INTO @DATA definitions are outlined
55686
- * Some occurrences of string template formatting option ALPHA changed to function module call
55687
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
55688
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
55689
- * RAISE EXCEPTION ... MESSAGE
55690
- * Moving with +=, -=, /=, *=, &&= is expanded
55691
- * line_exists and line_index is downported to READ TABLE
55692
- * ENUMs, but does not nessesarily give the correct type and value
55693
- * MESSAGE with non simple source
55694
-
55695
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
55696
-
55806
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
55807
+ a higher level language version. If successful, various rules are applied to downport the statement.
55808
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
55809
+
55810
+ Current rules:
55811
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
55812
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
55813
+ * FIELD-SYMBOL() definitions are outlined
55814
+ * CONV is outlined
55815
+ * COND is outlined
55816
+ * REDUCE is outlined
55817
+ * SWITCH is outlined
55818
+ * FILTER is outlined
55819
+ * APPEND expression is outlined
55820
+ * INSERT expression is outlined
55821
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
55822
+ * CAST changed to ?=
55823
+ * LOOP AT method_call( ) is outlined
55824
+ * VALUE # with structure fields
55825
+ * VALUE # with internal table lines
55826
+ * Table Expressions are outlined
55827
+ * SELECT INTO @DATA definitions are outlined
55828
+ * Some occurrences of string template formatting option ALPHA changed to function module call
55829
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
55830
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
55831
+ * RAISE EXCEPTION ... MESSAGE
55832
+ * Moving with +=, -=, /=, *=, &&= is expanded
55833
+ * line_exists and line_index is downported to READ TABLE
55834
+ * ENUMs, but does not nessesarily give the correct type and value
55835
+ * MESSAGE with non simple source
55836
+
55837
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
55838
+
55697
55839
  Make sure to test the downported code, it might not always be completely correct.`,
55698
55840
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
55699
55841
  };
@@ -56271,10 +56413,10 @@ Make sure to test the downported code, it might not always be completely correct
56271
56413
  const fieldName = f.concatTokens();
56272
56414
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
56273
56415
  }
56274
- fieldDefinition = `DATA: BEGIN OF ${name},
56416
+ fieldDefinition = `DATA: BEGIN OF ${name},
56275
56417
  ${fieldDefinition}${indentation} END OF ${name}.`;
56276
56418
  }
56277
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
56419
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
56278
56420
  ${indentation}`);
56279
56421
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
56280
56422
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56318,12 +56460,12 @@ ${indentation}`);
56318
56460
  }
56319
56461
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56320
56462
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
56321
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
56322
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
56323
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
56463
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
56464
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
56465
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
56324
56466
  ${indentation}`);
56325
56467
  if (fieldDefinitions === "") {
56326
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
56468
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
56327
56469
  ${indentation}`);
56328
56470
  }
56329
56471
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -56391,7 +56533,7 @@ ${indentation}`);
56391
56533
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56392
56534
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56393
56535
  const firstToken = high.getFirstToken();
56394
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56536
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56395
56537
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56396
56538
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
56397
56539
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56445,7 +56587,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56445
56587
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56446
56588
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56447
56589
  const firstToken = high.getFirstToken();
56448
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56590
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56449
56591
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56450
56592
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
56451
56593
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56487,14 +56629,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56487
56629
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56488
56630
  const firstToken = high.getFirstToken();
56489
56631
  // note that the tabix restore should be done before throwing the exception
56490
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
56491
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
56492
- ${indentation}${tabixBackup} = sy-tabix.
56493
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
56494
- ${indentation}sy-tabix = ${tabixBackup}.
56495
- ${indentation}IF sy-subrc <> 0.
56496
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56497
- ${indentation}ENDIF.
56632
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
56633
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
56634
+ ${indentation}${tabixBackup} = sy-tabix.
56635
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
56636
+ ${indentation}sy-tabix = ${tabixBackup}.
56637
+ ${indentation}IF sy-subrc <> 0.
56638
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56639
+ ${indentation}ENDIF.
56498
56640
  ${indentation}`);
56499
56641
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
56500
56642
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56551,7 +56693,7 @@ ${indentation}`);
56551
56693
  const className = classNames[0].concatTokens();
56552
56694
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
56553
56695
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
56554
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
56696
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
56555
56697
  ${indentation}CATCH ${className} INTO ${targetName}.`;
56556
56698
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
56557
56699
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -56713,16 +56855,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
56713
56855
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56714
56856
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56715
56857
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
56716
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
56717
- ${indentation}${uniqueName1}-msgid = ${id}.
56858
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
56859
+ ${indentation}${uniqueName1}-msgid = ${id}.
56718
56860
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
56719
56861
  if (withs.length > 0) {
56720
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
56721
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
56722
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
56862
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
56863
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
56864
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
56723
56865
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
56724
56866
  }
56725
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
56867
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
56726
56868
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
56727
56869
  if (withs.length > 0) {
56728
56870
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -56834,10 +56976,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
56834
56976
  let code = "";
56835
56977
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
56836
56978
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56837
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
56838
- IF sy-subrc <> 0.
56839
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56840
- ENDIF.
56979
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
56980
+ IF sy-subrc <> 0.
56981
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56982
+ ENDIF.
56841
56983
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
56842
56984
  }
56843
56985
  else {
@@ -56926,20 +57068,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
56926
57068
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56927
57069
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56928
57070
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56929
- code += ` items LIKE ${loopSourceName},
56930
- END OF ${groupTargetName}type.
56931
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
56932
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
57071
+ code += ` items LIKE ${loopSourceName},
57072
+ END OF ${groupTargetName}type.
57073
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
57074
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
56933
57075
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
56934
57076
  if (groupIndexName !== undefined) {
56935
57077
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
56936
57078
  }
56937
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57079
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
56938
57080
  IF sy-subrc = 0.\n`;
56939
57081
  if (groupCountName !== undefined) {
56940
57082
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
56941
57083
  }
56942
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57084
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
56943
57085
  ELSE.\n`;
56944
57086
  code += ` CLEAR ${uniqueName}.\n`;
56945
57087
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -56960,8 +57102,8 @@ ELSE.\n`;
56960
57102
  }
56961
57103
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
56962
57104
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
56963
- code += `ENDIF.
56964
- ENDLOOP.
57105
+ code += `ENDIF.
57106
+ ENDLOOP.
56965
57107
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
56966
57108
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
56967
57109
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -57133,7 +57275,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57133
57275
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
57134
57276
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
57135
57277
  // all ENUMS are char like?
57136
- let code = `TYPES ${enumName} TYPE string.
57278
+ let code = `TYPES ${enumName} TYPE string.
57137
57279
  CONSTANTS: BEGIN OF ${structureName},\n`;
57138
57280
  let count = 1;
57139
57281
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -57177,14 +57319,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
57177
57319
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57178
57320
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57179
57321
  // restore tabix before exeption
57180
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
57181
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57182
- ${indentation}${tabixBackup} = sy-tabix.
57183
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
57184
- ${indentation}sy-tabix = ${tabixBackup}.
57185
- ${indentation}IF sy-subrc <> 0.
57186
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57187
- ${indentation}ENDIF.
57322
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
57323
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57324
+ ${indentation}${tabixBackup} = sy-tabix.
57325
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
57326
+ ${indentation}sy-tabix = ${tabixBackup}.
57327
+ ${indentation}IF sy-subrc <> 0.
57328
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57329
+ ${indentation}ENDIF.
57188
57330
  ${indentation}${uniqueName}`;
57189
57331
  const start = target.getFirstToken().getStart();
57190
57332
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -57268,11 +57410,11 @@ ${indentation}${uniqueName}`;
57268
57410
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57269
57411
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
57270
57412
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57271
- const code = `DATA ${uniqueName} TYPE string.
57272
- ${indentation}CALL FUNCTION '${functionName}'
57273
- ${indentation} EXPORTING
57274
- ${indentation} input = ${source}
57275
- ${indentation} IMPORTING
57413
+ const code = `DATA ${uniqueName} TYPE string.
57414
+ ${indentation}CALL FUNCTION '${functionName}'
57415
+ ${indentation} EXPORTING
57416
+ ${indentation} input = ${source}
57417
+ ${indentation} IMPORTING
57276
57418
  ${indentation} output = ${uniqueName}.\n`;
57277
57419
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
57278
57420
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -58584,12 +58726,12 @@ class EasyToFindMessages {
58584
58726
  key: "easy_to_find_messages",
58585
58727
  title: "Easy to find messages",
58586
58728
  shortDescription: `Make messages easy to find`,
58587
- extendedInformation: `All messages must be statically referenced exactly once
58588
-
58589
- Only MESSAGE and RAISE statments are counted as static references
58590
-
58591
- Also see rule "message_exists"
58592
-
58729
+ extendedInformation: `All messages must be statically referenced exactly once
58730
+
58731
+ Only MESSAGE and RAISE statments are counted as static references
58732
+
58733
+ Also see rule "message_exists"
58734
+
58593
58735
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
58594
58736
  tags: [_irule_1.RuleTag.Styleguide],
58595
58737
  };
@@ -58674,8 +58816,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
58674
58816
  key: "empty_line_in_statement",
58675
58817
  title: "Find empty lines in statements",
58676
58818
  shortDescription: `Checks that statements do not contain empty lines.`,
58677
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
58678
-
58819
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
58820
+
58679
58821
  https://docs.abapopenchecks.org/checks/41/`,
58680
58822
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
58681
58823
  badExample: `WRITE\n\nhello.`,
@@ -58851,13 +58993,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
58851
58993
  shortDescription: `Checks that the code does not contain empty blocks.`,
58852
58994
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
58853
58995
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
58854
- badExample: `IF foo = bar.
58855
- ENDIF.
58856
-
58857
- DO 2 TIMES.
58996
+ badExample: `IF foo = bar.
58997
+ ENDIF.
58998
+
58999
+ DO 2 TIMES.
58858
59000
  ENDDO.`,
58859
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
58860
- ENDLOOP.
59001
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
59002
+ ENDLOOP.
58861
59003
  result = xsdbool( sy-subrc = 0 ).`,
58862
59004
  };
58863
59005
  }
@@ -58999,10 +59141,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
58999
59141
  return {
59000
59142
  key: "exit_or_check",
59001
59143
  title: "Find EXIT or CHECK outside loops",
59002
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59144
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59003
59145
  Use RETURN to leave procesing blocks instead.`,
59004
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59005
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59146
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59147
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59006
59148
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
59007
59149
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
59008
59150
  };
@@ -59085,12 +59227,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
59085
59227
  key: "expand_macros",
59086
59228
  title: "Expand Macros",
59087
59229
  shortDescription: `Allows expanding macro calls with quick fixes`,
59088
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
59089
-
59230
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
59231
+
59090
59232
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
59091
- badExample: `DEFINE _hello.
59092
- WRITE 'hello'.
59093
- END-OF-DEFINITION.
59233
+ badExample: `DEFINE _hello.
59234
+ WRITE 'hello'.
59235
+ END-OF-DEFINITION.
59094
59236
  _hello.`,
59095
59237
  goodExample: `WRITE 'hello'.`,
59096
59238
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -59177,7 +59319,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
59177
59319
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
59178
59320
  badExample: `call_method( EXPORTING foo = bar ).`,
59179
59321
  goodExample: `call_method( foo = bar ).`,
59180
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
59322
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
59181
59323
  https://docs.abapopenchecks.org/checks/30/`,
59182
59324
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
59183
59325
  };
@@ -59275,7 +59417,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
59275
59417
  key: "forbidden_identifier",
59276
59418
  title: "Forbidden Identifier",
59277
59419
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
59278
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
59420
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
59279
59421
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
59280
59422
  tags: [_irule_1.RuleTag.SingleFile],
59281
59423
  };
@@ -59517,8 +59659,8 @@ class ForbiddenVoidType {
59517
59659
  key: "forbidden_void_type",
59518
59660
  title: "Forbidden Void Types",
59519
59661
  shortDescription: `Avoid usage of specified void types.`,
59520
- extendedInformation: `Inspiration:
59521
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
59662
+ extendedInformation: `Inspiration:
59663
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
59522
59664
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
59523
59665
  };
59524
59666
  }
@@ -59761,7 +59903,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
59761
59903
  key: "fully_type_itabs",
59762
59904
  title: "Fully type internal tables",
59763
59905
  shortDescription: `No implict table types or table keys`,
59764
- badExample: `DATA lt_foo TYPE TABLE OF ty.
59906
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
59765
59907
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
59766
59908
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
59767
59909
  tags: [_irule_1.RuleTag.SingleFile],
@@ -59946,26 +60088,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
59946
60088
  key: "functional_writing",
59947
60089
  title: "Use functional writing",
59948
60090
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
59949
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
60091
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
59950
60092
  https://docs.abapopenchecks.org/checks/07/`,
59951
60093
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
59952
- badExample: `CALL METHOD zcl_class=>method( ).
59953
- CALL METHOD cl_abap_typedescr=>describe_by_name
59954
- EXPORTING
59955
- p_name = 'NAME'
59956
- RECEIVING
59957
- p_descr_ref = lr_typedescr
59958
- EXCEPTIONS
59959
- type_not_found = 1
60094
+ badExample: `CALL METHOD zcl_class=>method( ).
60095
+ CALL METHOD cl_abap_typedescr=>describe_by_name
60096
+ EXPORTING
60097
+ p_name = 'NAME'
60098
+ RECEIVING
60099
+ p_descr_ref = lr_typedescr
60100
+ EXCEPTIONS
60101
+ type_not_found = 1
59960
60102
  OTHERS = 2.`,
59961
- goodExample: `zcl_class=>method( ).
59962
- cl_abap_typedescr=>describe_by_name(
59963
- EXPORTING
59964
- p_name = 'NAME'
59965
- RECEIVING
59966
- p_descr_ref = lr_typedescr
59967
- EXCEPTIONS
59968
- type_not_found = 1
60103
+ goodExample: `zcl_class=>method( ).
60104
+ cl_abap_typedescr=>describe_by_name(
60105
+ EXPORTING
60106
+ p_name = 'NAME'
60107
+ RECEIVING
60108
+ p_descr_ref = lr_typedescr
60109
+ EXCEPTIONS
60110
+ type_not_found = 1
59969
60111
  OTHERS = 2 ).`,
59970
60112
  };
59971
60113
  }
@@ -60076,14 +60218,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
60076
60218
  key: "global_class",
60077
60219
  title: "Global class checks",
60078
60220
  shortDescription: `Checks related to global classes`,
60079
- extendedInformation: `* global classes must be in own files
60080
-
60081
- * file names must match class name
60082
-
60083
- * file names must match interface name
60084
-
60085
- * global classes must be global definitions
60086
-
60221
+ extendedInformation: `* global classes must be in own files
60222
+
60223
+ * file names must match class name
60224
+
60225
+ * file names must match interface name
60226
+
60227
+ * global classes must be global definitions
60228
+
60087
60229
  * global interfaces must be global definitions`,
60088
60230
  tags: [_irule_1.RuleTag.Syntax],
60089
60231
  };
@@ -60182,21 +60324,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
60182
60324
  return {
60183
60325
  key: "identical_conditions",
60184
60326
  title: "Identical conditions",
60185
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
60186
-
60327
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
60328
+
60187
60329
  Prerequsites: code is pretty printed with identical cAsE`,
60188
60330
  tags: [_irule_1.RuleTag.SingleFile],
60189
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
60190
- ENDIF.
60191
- CASE bar.
60192
- WHEN '1'.
60193
- WHEN 'A' OR '1'.
60331
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
60332
+ ENDIF.
60333
+ CASE bar.
60334
+ WHEN '1'.
60335
+ WHEN 'A' OR '1'.
60194
60336
  ENDCASE.`,
60195
- goodExample: `IF foo = bar OR 1 = a.
60196
- ENDIF.
60197
- CASE bar.
60198
- WHEN '1'.
60199
- WHEN 'A'.
60337
+ goodExample: `IF foo = bar OR 1 = a.
60338
+ ENDIF.
60339
+ CASE bar.
60340
+ WHEN '1'.
60341
+ WHEN 'A'.
60200
60342
  ENDCASE.`,
60201
60343
  };
60202
60344
  }
@@ -60330,23 +60472,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
60330
60472
  key: "identical_contents",
60331
60473
  title: "Identical contents",
60332
60474
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
60333
- extendedInformation: `
60334
- Prerequsites: code is pretty printed with identical cAsE
60335
-
60475
+ extendedInformation: `
60476
+ Prerequsites: code is pretty printed with identical cAsE
60477
+
60336
60478
  Chained statments are ignored`,
60337
60479
  tags: [_irule_1.RuleTag.SingleFile],
60338
- badExample: `IF foo = bar.
60339
- WRITE 'bar'.
60340
- WRITE 'world'.
60341
- ELSE.
60342
- WRITE 'foo'.
60343
- WRITE 'world'.
60480
+ badExample: `IF foo = bar.
60481
+ WRITE 'bar'.
60482
+ WRITE 'world'.
60483
+ ELSE.
60484
+ WRITE 'foo'.
60485
+ WRITE 'world'.
60344
60486
  ENDIF.`,
60345
- goodExample: `IF foo = bar.
60346
- WRITE 'bar'.
60347
- ELSE.
60348
- WRITE 'foo'.
60349
- ENDIF.
60487
+ goodExample: `IF foo = bar.
60488
+ WRITE 'bar'.
60489
+ ELSE.
60490
+ WRITE 'foo'.
60491
+ ENDIF.
60350
60492
  WRITE 'world'.`,
60351
60493
  };
60352
60494
  }
@@ -60454,12 +60596,12 @@ class IdenticalDescriptions {
60454
60596
  key: "identical_descriptions",
60455
60597
  title: "Identical descriptions",
60456
60598
  shortDescription: `Searches for objects with the same type and same description`,
60457
- extendedInformation: `Case insensitive
60458
-
60459
- Only checks the master language descriptions
60460
-
60461
- Dependencies are skipped
60462
-
60599
+ extendedInformation: `Case insensitive
60600
+
60601
+ Only checks the master language descriptions
60602
+
60603
+ Dependencies are skipped
60604
+
60463
60605
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
60464
60606
  tags: [],
60465
60607
  };
@@ -60633,43 +60775,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
60633
60775
  key: "if_in_if",
60634
60776
  title: "IF in IF",
60635
60777
  shortDescription: `Detects nested ifs which can be refactored.`,
60636
- extendedInformation: `
60637
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
60638
-
60639
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
60640
-
60641
- https://docs.abapopenchecks.org/checks/01/
60778
+ extendedInformation: `
60779
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
60780
+
60781
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
60782
+
60783
+ https://docs.abapopenchecks.org/checks/01/
60642
60784
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
60643
- badExample: `IF condition1.
60644
- IF condition2.
60645
- ...
60646
- ENDIF.
60647
- ENDIF.
60648
-
60649
- IF condition1.
60650
- ...
60651
- ELSE.
60652
- IF condition2.
60653
- ...
60654
- ENDIF.
60785
+ badExample: `IF condition1.
60786
+ IF condition2.
60787
+ ...
60788
+ ENDIF.
60789
+ ENDIF.
60790
+
60791
+ IF condition1.
60792
+ ...
60793
+ ELSE.
60794
+ IF condition2.
60795
+ ...
60796
+ ENDIF.
60655
60797
  ENDIF.`,
60656
- goodExample: `IF ( condition1 ) AND ( condition2 ).
60657
- ...
60658
- ENDIF.
60659
-
60660
- IF condition1.
60661
- ...
60662
- ELSEIF condition2.
60663
- ...
60664
- ENDIF.
60665
-
60666
- CASE variable.
60667
- WHEN value1.
60668
- ...
60669
- WHEN value2.
60670
- IF condition2.
60671
- ...
60672
- ENDIF.
60798
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
60799
+ ...
60800
+ ENDIF.
60801
+
60802
+ IF condition1.
60803
+ ...
60804
+ ELSEIF condition2.
60805
+ ...
60806
+ ENDIF.
60807
+
60808
+ CASE variable.
60809
+ WHEN value1.
60810
+ ...
60811
+ WHEN value2.
60812
+ IF condition2.
60813
+ ...
60814
+ ENDIF.
60673
60815
  ENDCASE.`,
60674
60816
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
60675
60817
  };
@@ -60854,9 +60996,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
60854
60996
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
60855
60997
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
60856
60998
  if (name === impl.identifier.getName().toUpperCase()) {
60857
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
60858
- METHOD ${methodName.toLowerCase()}.
60859
- RETURN. " todo, implement method
60999
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
61000
+ METHOD ${methodName.toLowerCase()}.
61001
+ RETURN. " todo, implement method
60860
61002
  ENDMETHOD.`);
60861
61003
  }
60862
61004
  }
@@ -61044,19 +61186,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
61044
61186
  key: "in_statement_indentation",
61045
61187
  title: "In-statement indentation",
61046
61188
  shortDescription: "Checks alignment within statements which span multiple lines.",
61047
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
61048
-
61049
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61189
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
61190
+
61191
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61050
61192
  to distinguish them better from code within the block.`,
61051
- badExample: `IF 1 = 1
61052
- AND 2 = 2.
61053
- WRITE 'hello' &&
61054
- 'world'.
61193
+ badExample: `IF 1 = 1
61194
+ AND 2 = 2.
61195
+ WRITE 'hello' &&
61196
+ 'world'.
61055
61197
  ENDIF.`,
61056
- goodExample: `IF 1 = 1
61057
- AND 2 = 2.
61058
- WRITE 'hello' &&
61059
- 'world'.
61198
+ goodExample: `IF 1 = 1
61199
+ AND 2 = 2.
61200
+ WRITE 'hello' &&
61201
+ 'world'.
61060
61202
  ENDIF.`,
61061
61203
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61062
61204
  };
@@ -61179,23 +61321,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
61179
61321
  title: "Indentation",
61180
61322
  shortDescription: `Checks indentation`,
61181
61323
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61182
- badExample: `CLASS lcl DEFINITION.
61183
- PRIVATE SECTION.
61184
- METHODS constructor.
61185
- ENDCLASS.
61186
-
61187
- CLASS lcl IMPLEMENTATION.
61188
- METHOD constructor.
61189
- ENDMETHOD.
61324
+ badExample: `CLASS lcl DEFINITION.
61325
+ PRIVATE SECTION.
61326
+ METHODS constructor.
61327
+ ENDCLASS.
61328
+
61329
+ CLASS lcl IMPLEMENTATION.
61330
+ METHOD constructor.
61331
+ ENDMETHOD.
61190
61332
  ENDCLASS.`,
61191
- goodExample: `CLASS lcl DEFINITION.
61192
- PRIVATE SECTION.
61193
- METHODS constructor.
61194
- ENDCLASS.
61195
-
61196
- CLASS lcl IMPLEMENTATION.
61197
- METHOD constructor.
61198
- ENDMETHOD.
61333
+ goodExample: `CLASS lcl DEFINITION.
61334
+ PRIVATE SECTION.
61335
+ METHODS constructor.
61336
+ ENDCLASS.
61337
+
61338
+ CLASS lcl IMPLEMENTATION.
61339
+ METHOD constructor.
61340
+ ENDMETHOD.
61199
61341
  ENDCLASS.`,
61200
61342
  };
61201
61343
  }
@@ -61383,6 +61525,7 @@ __exportStar(__webpack_require__(/*! ./line_only_punc */ "./node_modules/@abapli
61383
61525
  __exportStar(__webpack_require__(/*! ./local_class_naming */ "./node_modules/@abaplint/core/build/src/rules/local_class_naming.js"), exports);
61384
61526
  __exportStar(__webpack_require__(/*! ./local_testclass_consistency */ "./node_modules/@abaplint/core/build/src/rules/local_testclass_consistency.js"), exports);
61385
61527
  __exportStar(__webpack_require__(/*! ./local_variable_names */ "./node_modules/@abaplint/core/build/src/rules/local_variable_names.js"), exports);
61528
+ __exportStar(__webpack_require__(/*! ./macro_naming */ "./node_modules/@abaplint/core/build/src/rules/macro_naming.js"), exports);
61386
61529
  __exportStar(__webpack_require__(/*! ./main_file_contents */ "./node_modules/@abaplint/core/build/src/rules/main_file_contents.js"), exports);
61387
61530
  __exportStar(__webpack_require__(/*! ./many_parentheses */ "./node_modules/@abaplint/core/build/src/rules/many_parentheses.js"), exports);
61388
61531
  __exportStar(__webpack_require__(/*! ./max_one_method_parameter_per_line */ "./node_modules/@abaplint/core/build/src/rules/max_one_method_parameter_per_line.js"), exports);
@@ -61460,6 +61603,7 @@ __exportStar(__webpack_require__(/*! ./unnecessary_return */ "./node_modules/@ab
61460
61603
  __exportStar(__webpack_require__(/*! ./unreachable_code */ "./node_modules/@abaplint/core/build/src/rules/unreachable_code.js"), exports);
61461
61604
  __exportStar(__webpack_require__(/*! ./unsecure_fae */ "./node_modules/@abaplint/core/build/src/rules/unsecure_fae.js"), exports);
61462
61605
  __exportStar(__webpack_require__(/*! ./unused_ddic */ "./node_modules/@abaplint/core/build/src/rules/unused_ddic.js"), exports);
61606
+ __exportStar(__webpack_require__(/*! ./unused_macros */ "./node_modules/@abaplint/core/build/src/rules/unused_macros.js"), exports);
61463
61607
  __exportStar(__webpack_require__(/*! ./unused_methods */ "./node_modules/@abaplint/core/build/src/rules/unused_methods.js"), exports);
61464
61608
  __exportStar(__webpack_require__(/*! ./unused_types */ "./node_modules/@abaplint/core/build/src/rules/unused_types.js"), exports);
61465
61609
  __exportStar(__webpack_require__(/*! ./unused_variables */ "./node_modules/@abaplint/core/build/src/rules/unused_variables.js"), exports);
@@ -61582,9 +61726,9 @@ class IntfReferencingClas {
61582
61726
  key: "intf_referencing_clas",
61583
61727
  title: "INTF referencing CLAS",
61584
61728
  shortDescription: `Interface contains references to class`,
61585
- extendedInformation: `Only global interfaces are checked.
61586
- Only first level references are checked.
61587
- Exception class references are ignored.
61729
+ extendedInformation: `Only global interfaces are checked.
61730
+ Only first level references are checked.
61731
+ Exception class references are ignored.
61588
61732
  Void references are ignored.`,
61589
61733
  };
61590
61734
  }
@@ -61669,9 +61813,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
61669
61813
  title: "Invalid Table Index",
61670
61814
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
61671
61815
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61672
- badExample: `DATA(first) = table[ 0 ].
61816
+ badExample: `DATA(first) = table[ 0 ].
61673
61817
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
61674
- goodExample: `DATA(first) = table[ 1 ].
61818
+ goodExample: `DATA(first) = table[ 1 ].
61675
61819
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
61676
61820
  };
61677
61821
  }
@@ -62272,8 +62416,8 @@ class LineBreakStyle {
62272
62416
  return {
62273
62417
  key: "line_break_style",
62274
62418
  title: "Makes sure line breaks are consistent in the ABAP code",
62275
- shortDescription: `Enforces LF as newlines in ABAP files
62276
-
62419
+ shortDescription: `Enforces LF as newlines in ABAP files
62420
+
62277
62421
  abapGit does not work with CRLF`,
62278
62422
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
62279
62423
  };
@@ -62342,7 +62486,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
62342
62486
  key: "line_length",
62343
62487
  title: "Line length",
62344
62488
  shortDescription: `Detects lines exceeding the provided maximum length.`,
62345
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
62489
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
62346
62490
  https://docs.abapopenchecks.org/checks/04/`,
62347
62491
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
62348
62492
  };
@@ -62413,7 +62557,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
62413
62557
  key: "line_only_punc",
62414
62558
  title: "Line containing only punctuation",
62415
62559
  shortDescription: `Detects lines containing only punctuation.`,
62416
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
62560
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
62417
62561
  https://docs.abapopenchecks.org/checks/16/`,
62418
62562
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62419
62563
  badExample: "zcl_class=>method(\n).",
@@ -62673,15 +62817,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
62673
62817
  return {
62674
62818
  key: "local_variable_names",
62675
62819
  title: "Local variable naming conventions",
62676
- shortDescription: `
62677
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
62820
+ shortDescription: `
62821
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
62678
62822
  Regexes are case-insensitive.`,
62679
62823
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
62680
- badExample: `FORM bar.
62681
- DATA foo.
62824
+ badExample: `FORM bar.
62825
+ DATA foo.
62682
62826
  ENDFORM.`,
62683
- goodExample: `FORM bar.
62684
- DATA lv_foo.
62827
+ goodExample: `FORM bar.
62828
+ DATA lv_foo.
62685
62829
  ENDFORM.`,
62686
62830
  };
62687
62831
  }
@@ -62796,6 +62940,83 @@ exports.LocalVariableNames = LocalVariableNames;
62796
62940
 
62797
62941
  /***/ }),
62798
62942
 
62943
+ /***/ "./node_modules/@abaplint/core/build/src/rules/macro_naming.js":
62944
+ /*!*********************************************************************!*\
62945
+ !*** ./node_modules/@abaplint/core/build/src/rules/macro_naming.js ***!
62946
+ \*********************************************************************/
62947
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
62948
+
62949
+ "use strict";
62950
+
62951
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
62952
+ exports.MacroNaming = exports.MacroNamingConf = void 0;
62953
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
62954
+ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
62955
+ const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
62956
+ const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
62957
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
62958
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
62959
+ const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
62960
+ class MacroNamingConf extends _basic_rule_config_1.BasicRuleConfig {
62961
+ constructor() {
62962
+ super(...arguments);
62963
+ /** The pattern for macros, case insensitive */
62964
+ this.pattern = "^_.+$";
62965
+ }
62966
+ }
62967
+ exports.MacroNamingConf = MacroNamingConf;
62968
+ class MacroNaming extends _abap_rule_1.ABAPRule {
62969
+ constructor() {
62970
+ super(...arguments);
62971
+ this.conf = new MacroNamingConf();
62972
+ }
62973
+ getMetadata() {
62974
+ return {
62975
+ key: "macro_naming",
62976
+ title: "Macro naming conventions",
62977
+ shortDescription: `Allows you to enforce a pattern for macro definitions`,
62978
+ extendedInformation: `Use rule "avoid_use" to avoid macros alotogether.`,
62979
+ tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
62980
+ };
62981
+ }
62982
+ getConfig() {
62983
+ return this.conf;
62984
+ }
62985
+ setConfig(conf) {
62986
+ this.conf = conf;
62987
+ }
62988
+ runParsed(file, obj) {
62989
+ const issues = [];
62990
+ const testRegex = new RegExp(this.conf.pattern, "i");
62991
+ if (obj instanceof objects_1.TypePool) {
62992
+ return [];
62993
+ }
62994
+ for (const stat of file.getStatements()) {
62995
+ if (!(stat.get() instanceof Statements.Define)) {
62996
+ continue;
62997
+ }
62998
+ const expr = stat.findDirectExpression(Expressions.MacroName);
62999
+ if (expr === undefined) {
63000
+ continue;
63001
+ }
63002
+ const token = expr.getFirstToken();
63003
+ if (testRegex.exec(token.getStr())) {
63004
+ continue;
63005
+ }
63006
+ else {
63007
+ const message = "Bad macro name naming, expected \"" + this.conf.pattern + "\", got \"" + token.getStr() + "\"";
63008
+ const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);
63009
+ issues.push(issue);
63010
+ }
63011
+ }
63012
+ return issues;
63013
+ }
63014
+ }
63015
+ exports.MacroNaming = MacroNaming;
63016
+ //# sourceMappingURL=macro_naming.js.map
63017
+
63018
+ /***/ }),
63019
+
62799
63020
  /***/ "./node_modules/@abaplint/core/build/src/rules/main_file_contents.js":
62800
63021
  /*!***************************************************************************!*\
62801
63022
  !*** ./node_modules/@abaplint/core/build/src/rules/main_file_contents.js ***!
@@ -62827,10 +63048,10 @@ class MainFileContents {
62827
63048
  key: "main_file_contents",
62828
63049
  title: "Main file contents",
62829
63050
  shortDescription: `Checks related to report declarations.`,
62830
- extendedInformation: `Does not run if the target version is Cloud
62831
-
62832
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
62833
- * TYPEs must begin with "TYPE-POOL <name>."
63051
+ extendedInformation: `Does not run if the target version is Cloud
63052
+
63053
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
63054
+ * TYPEs must begin with "TYPE-POOL <name>."
62834
63055
  `,
62835
63056
  };
62836
63057
  }
@@ -62946,17 +63167,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
62946
63167
  title: "Too many parentheses",
62947
63168
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
62948
63169
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
62949
- badExample: `
62950
- IF ( destination IS INITIAL ).
62951
- ENDIF.
62952
- IF foo = boo AND ( bar = lar AND moo = loo ).
62953
- ENDIF.
63170
+ badExample: `
63171
+ IF ( destination IS INITIAL ).
63172
+ ENDIF.
63173
+ IF foo = boo AND ( bar = lar AND moo = loo ).
63174
+ ENDIF.
62954
63175
  `,
62955
- goodExample: `
62956
- IF destination IS INITIAL.
62957
- ENDIF.
62958
- IF foo = boo AND bar = lar AND moo = loo.
62959
- ENDIF.
63176
+ goodExample: `
63177
+ IF destination IS INITIAL.
63178
+ ENDIF.
63179
+ IF foo = boo AND bar = lar AND moo = loo.
63180
+ ENDIF.
62960
63181
  `,
62961
63182
  };
62962
63183
  }
@@ -63130,14 +63351,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
63130
63351
  title: "Max one method parameter definition per line",
63131
63352
  shortDescription: `Keep max one method parameter description per line`,
63132
63353
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
63133
- badExample: `
63134
- METHODS apps_scope_token
63135
- IMPORTING
63354
+ badExample: `
63355
+ METHODS apps_scope_token
63356
+ IMPORTING
63136
63357
  body TYPE bodyapps_scope_token client_id TYPE str.`,
63137
- goodExample: `
63138
- METHODS apps_scope_token
63139
- IMPORTING
63140
- body TYPE bodyapps_scope_token
63358
+ goodExample: `
63359
+ METHODS apps_scope_token
63360
+ IMPORTING
63361
+ body TYPE bodyapps_scope_token
63141
63362
  client_id TYPE str.`,
63142
63363
  };
63143
63364
  }
@@ -63202,11 +63423,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
63202
63423
  key: "max_one_statement",
63203
63424
  title: "Max one statement per line",
63204
63425
  shortDescription: `Checks that each line contains only a single statement.`,
63205
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
63206
-
63207
- Does not report anything for chained statements.
63208
-
63209
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
63426
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
63427
+
63428
+ Does not report anything for chained statements.
63429
+
63430
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
63210
63431
  https://docs.abapopenchecks.org/checks/11/`,
63211
63432
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63212
63433
  badExample: `WRITE foo. WRITE bar.`,
@@ -63544,8 +63765,8 @@ class MethodLength {
63544
63765
  key: "method_length",
63545
63766
  title: "Method/Form Length",
63546
63767
  shortDescription: `Checks relating to method/form length.`,
63547
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
63548
-
63768
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
63769
+
63549
63770
  Abstract methods without statements are considered okay.`,
63550
63771
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
63551
63772
  };
@@ -63650,20 +63871,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
63650
63871
  key: "method_overwrites_builtin",
63651
63872
  title: "Method name overwrites builtin function",
63652
63873
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
63653
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
63654
-
63655
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
63656
-
63874
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
63875
+
63876
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
63877
+
63657
63878
  Interface method names are ignored`,
63658
63879
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
63659
- badExample: `CLASS lcl DEFINITION.
63660
- PUBLIC SECTION.
63661
- METHODS matches.
63662
- ENDCLASS.
63663
-
63664
- CLASS lcl IMPLEMENTATION.
63665
- METHOD matches.
63666
- ENDMETHOD.
63880
+ badExample: `CLASS lcl DEFINITION.
63881
+ PUBLIC SECTION.
63882
+ METHODS matches.
63883
+ ENDCLASS.
63884
+
63885
+ CLASS lcl IMPLEMENTATION.
63886
+ METHOD matches.
63887
+ ENDMETHOD.
63667
63888
  ENDCLASS.`,
63668
63889
  };
63669
63890
  }
@@ -63854,12 +64075,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
63854
64075
  // eslint-disable-next-line max-len
63855
64076
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
63856
64077
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
63857
- badExample: `CLASS lcl DEFINITION.
63858
- PUBLIC SECTION.
63859
- METHODS
63860
- foobar
63861
- EXPORTING foo TYPE i
63862
- RETURNING VALUE(rv_string) TYPE string.
64078
+ badExample: `CLASS lcl DEFINITION.
64079
+ PUBLIC SECTION.
64080
+ METHODS
64081
+ foobar
64082
+ EXPORTING foo TYPE i
64083
+ RETURNING VALUE(rv_string) TYPE string.
63863
64084
  ENDCLASS.`,
63864
64085
  };
63865
64086
  }
@@ -64239,7 +64460,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
64239
64460
  key: "nesting",
64240
64461
  title: "Check nesting depth",
64241
64462
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
64242
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
64463
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
64243
64464
  https://docs.abapopenchecks.org/checks/74/`,
64244
64465
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64245
64466
  };
@@ -64482,7 +64703,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
64482
64703
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
64483
64704
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64484
64705
  badExample: `var1 = var2 = var3.`,
64485
- goodExample: `var2 = var3.
64706
+ goodExample: `var2 = var3.
64486
64707
  var1 = var2.`,
64487
64708
  };
64488
64709
  }
@@ -64541,8 +64762,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
64541
64762
  key: "no_external_form_calls",
64542
64763
  title: "No external FORM calls",
64543
64764
  shortDescription: `Detect external form calls`,
64544
- badExample: `PERFORM foo IN PROGRAM bar.
64545
-
64765
+ badExample: `PERFORM foo IN PROGRAM bar.
64766
+
64546
64767
  PERFORM foo(bar).`,
64547
64768
  tags: [_irule_1.RuleTag.SingleFile],
64548
64769
  };
@@ -64603,17 +64824,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
64603
64824
  key: "no_inline_in_optional_branches",
64604
64825
  title: "Don't declare inline in optional branches",
64605
64826
  shortDescription: `Don't declare inline in optional branches`,
64606
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
64607
-
64608
- Considered optional branches:
64609
- * inside IF/ELSEIF/ELSE
64610
- * inside LOOP
64611
- * inside WHILE
64612
- * inside CASE/WHEN, CASE TYPE OF
64613
- * inside DO
64614
- * inside SELECT loops
64615
-
64616
- Not considered optional branches:
64827
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
64828
+
64829
+ Considered optional branches:
64830
+ * inside IF/ELSEIF/ELSE
64831
+ * inside LOOP
64832
+ * inside WHILE
64833
+ * inside CASE/WHEN, CASE TYPE OF
64834
+ * inside DO
64835
+ * inside SELECT loops
64836
+
64837
+ Not considered optional branches:
64617
64838
  * TRY/CATCH/CLEANUP`,
64618
64839
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64619
64840
  };
@@ -64713,12 +64934,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
64713
64934
  key: "no_prefixes",
64714
64935
  title: "No Prefixes",
64715
64936
  shortDescription: `Dont use hungarian notation`,
64716
- extendedInformation: `
64717
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
64718
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
64719
-
64720
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
64721
-
64937
+ extendedInformation: `
64938
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
64939
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
64940
+
64941
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
64942
+
64722
64943
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
64723
64944
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64724
64945
  badExample: `DATA lv_foo TYPE i.`,
@@ -64897,7 +65118,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
64897
65118
  return {
64898
65119
  key: "no_public_attributes",
64899
65120
  title: "No public attributes",
64900
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
65121
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
64901
65122
  Exceptions are excluded from this rule.`,
64902
65123
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
64903
65124
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -64998,13 +65219,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
64998
65219
  key: "no_yoda_conditions",
64999
65220
  title: "No Yoda conditions",
65000
65221
  shortDescription: `Finds Yoda conditions and reports issues`,
65001
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
65002
-
65222
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
65223
+
65003
65224
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
65004
65225
  tags: [_irule_1.RuleTag.SingleFile],
65005
- badExample: `IF 0 <> sy-subrc.
65226
+ badExample: `IF 0 <> sy-subrc.
65006
65227
  ENDIF.`,
65007
- goodExample: `IF sy-subrc <> 0.
65228
+ goodExample: `IF sy-subrc <> 0.
65008
65229
  ENDIF.`,
65009
65230
  };
65010
65231
  }
@@ -65105,8 +65326,8 @@ class NROBConsistency {
65105
65326
  key: "nrob_consistency",
65106
65327
  title: "Number range consistency",
65107
65328
  shortDescription: `Consistency checks for number ranges`,
65108
- extendedInformation: `Issue reported if percentage warning is over 50%
65109
-
65329
+ extendedInformation: `Issue reported if percentage warning is over 50%
65330
+
65110
65331
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
65111
65332
  tags: [_irule_1.RuleTag.SingleFile],
65112
65333
  };
@@ -65383,58 +65604,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
65383
65604
  title: "Obsolete statements",
65384
65605
  shortDescription: `Checks for usages of certain obsolete statements`,
65385
65606
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
65386
- extendedInformation: `
65387
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
65388
-
65389
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
65390
-
65391
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
65392
-
65393
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
65394
-
65395
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
65396
-
65397
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
65398
-
65399
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65400
-
65401
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65402
-
65403
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
65404
-
65405
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
65406
-
65407
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
65408
-
65409
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
65410
-
65411
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
65412
-
65413
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
65414
-
65415
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
65416
- SELECT COUNT(*) is considered okay
65417
-
65418
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
65419
-
65420
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
65421
-
65422
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
65423
-
65424
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
65425
-
65426
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
65427
-
65607
+ extendedInformation: `
65608
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
65609
+
65610
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
65611
+
65612
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
65613
+
65614
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
65615
+
65616
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
65617
+
65618
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
65619
+
65620
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65621
+
65622
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65623
+
65624
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
65625
+
65626
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
65627
+
65628
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
65629
+
65630
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
65631
+
65632
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
65633
+
65634
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
65635
+
65636
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
65637
+ SELECT COUNT(*) is considered okay
65638
+
65639
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
65640
+
65641
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
65642
+
65643
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
65644
+
65645
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
65646
+
65647
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
65648
+
65428
65649
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
65429
- badExample: `REFRESH itab.
65430
-
65431
- COMPUTE foo = 2 + 2.
65432
-
65433
- MULTIPLY lv_foo BY 2.
65434
-
65435
- INTERFACE intf LOAD.
65436
-
65437
- IF foo IS SUPPLIED.
65650
+ badExample: `REFRESH itab.
65651
+
65652
+ COMPUTE foo = 2 + 2.
65653
+
65654
+ MULTIPLY lv_foo BY 2.
65655
+
65656
+ INTERFACE intf LOAD.
65657
+
65658
+ IF foo IS SUPPLIED.
65438
65659
  ENDIF.`,
65439
65660
  };
65440
65661
  }
@@ -65711,7 +65932,7 @@ ENDIF.`,
65711
65932
  const children = statementNode.getChildren();
65712
65933
  const sourceString = children[1].concatTokens();
65713
65934
  const targetString = children[3].concatTokens();
65714
- let operator = children[2].concatTokens();
65935
+ let operator = children[2].concatTokens().toUpperCase();
65715
65936
  if (operator === "TO") {
65716
65937
  operator = " = ";
65717
65938
  }
@@ -65774,9 +65995,9 @@ class OmitParameterName {
65774
65995
  key: "omit_parameter_name",
65775
65996
  title: "Omit parameter name",
65776
65997
  shortDescription: `Omit the parameter name in single parameter calls`,
65777
- extendedInformation: `
65778
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
65779
-
65998
+ extendedInformation: `
65999
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
66000
+
65780
66001
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
65781
66002
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
65782
66003
  badExample: `method( param = 2 ).`,
@@ -65982,20 +66203,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
65982
66203
  shortDescription: `Omit RECEIVING`,
65983
66204
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
65984
66205
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65985
- badExample: `
65986
- upload_pack(
65987
- EXPORTING
65988
- io_client = lo_client
65989
- iv_url = iv_url
65990
- iv_deepen_level = iv_deepen_level
65991
- it_hashes = lt_hashes
65992
- RECEIVING
66206
+ badExample: `
66207
+ upload_pack(
66208
+ EXPORTING
66209
+ io_client = lo_client
66210
+ iv_url = iv_url
66211
+ iv_deepen_level = iv_deepen_level
66212
+ it_hashes = lt_hashes
66213
+ RECEIVING
65993
66214
  rt_objects = et_objects ).`,
65994
- goodExample: `
65995
- et_objects = upload_pack(
65996
- io_client = lo_client
65997
- iv_url = iv_url
65998
- iv_deepen_level = iv_deepen_level
66215
+ goodExample: `
66216
+ et_objects = upload_pack(
66217
+ io_client = lo_client
66218
+ iv_url = iv_url
66219
+ iv_deepen_level = iv_deepen_level
65999
66220
  it_hashes = lt_hashes ).`,
66000
66221
  };
66001
66222
  }
@@ -66059,8 +66280,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
66059
66280
  return {
66060
66281
  key: "parser_702_chaining",
66061
66282
  title: "Parser Error, bad chanining on 702",
66062
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
66063
- this rule finds these and reports errors.
66283
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
66284
+ this rule finds these and reports errors.
66064
66285
  Only active on target version 702 and below.`,
66065
66286
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66066
66287
  };
@@ -66140,8 +66361,8 @@ class ParserError {
66140
66361
  return {
66141
66362
  key: "parser_error",
66142
66363
  title: "Parser error",
66143
- shortDescription: `Checks for syntax not recognized by abaplint.
66144
-
66364
+ shortDescription: `Checks for syntax not recognized by abaplint.
66365
+
66145
66366
  See recognized syntax at https://syntax.abaplint.org`,
66146
66367
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66147
66368
  };
@@ -66226,7 +66447,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
66226
66447
  return {
66227
66448
  key: "parser_missing_space",
66228
66449
  title: "Parser Error, missing space",
66229
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
66450
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
66230
66451
  This rule makes sure the spaces are consistently required across the language.`,
66231
66452
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
66232
66453
  badExample: `IF ( foo = 'bar').`,
@@ -66638,25 +66859,25 @@ class PreferInline {
66638
66859
  key: "prefer_inline",
66639
66860
  title: "Prefer Inline Declarations",
66640
66861
  shortDescription: `Prefer inline to up-front declarations.`,
66641
- extendedInformation: `EXPERIMENTAL
66642
-
66643
- Activates if language version is v740sp02 or above.
66644
-
66645
- Variables must be local(METHOD or FORM).
66646
-
66647
- No generic or void typed variables. No syntax errors.
66648
-
66649
- First position used must be a full/pure write.
66650
-
66651
- Move statment is not a cast(?=)
66652
-
66862
+ extendedInformation: `EXPERIMENTAL
66863
+
66864
+ Activates if language version is v740sp02 or above.
66865
+
66866
+ Variables must be local(METHOD or FORM).
66867
+
66868
+ No generic or void typed variables. No syntax errors.
66869
+
66870
+ First position used must be a full/pure write.
66871
+
66872
+ Move statment is not a cast(?=)
66873
+
66653
66874
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
66654
66875
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
66655
- badExample: `DATA foo TYPE i.
66656
- foo = 2.
66657
- DATA percentage TYPE decfloat34.
66876
+ badExample: `DATA foo TYPE i.
66877
+ foo = 2.
66878
+ DATA percentage TYPE decfloat34.
66658
66879
  percentage = ( comment_number / abs_statement_number ) * 100.`,
66659
- goodExample: `DATA(foo) = 2.
66880
+ goodExample: `DATA(foo) = 2.
66660
66881
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
66661
66882
  };
66662
66883
  }
@@ -66870,18 +67091,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
66870
67091
  key: "prefer_is_not",
66871
67092
  title: "Prefer IS NOT to NOT IS",
66872
67093
  shortDescription: `Prefer IS NOT to NOT IS`,
66873
- extendedInformation: `
66874
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
66875
-
67094
+ extendedInformation: `
67095
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
67096
+
66876
67097
  "if not is_valid( )." examples are skipped`,
66877
67098
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
66878
- goodExample: `IF variable IS NOT INITIAL.
66879
- IF variable NP 'TODO*'.
66880
- IF variable <> 42.
67099
+ goodExample: `IF variable IS NOT INITIAL.
67100
+ IF variable NP 'TODO*'.
67101
+ IF variable <> 42.
66881
67102
  IF variable CO 'hello'.`,
66882
- badExample: `IF NOT variable IS INITIAL.
66883
- IF NOT variable CP 'TODO*'.
66884
- IF NOT variable = 42.
67103
+ badExample: `IF NOT variable IS INITIAL.
67104
+ IF NOT variable CP 'TODO*'.
67105
+ IF NOT variable = 42.
66885
67106
  IF NOT variable CA 'hello'.`,
66886
67107
  };
66887
67108
  }
@@ -67069,14 +67290,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
67069
67290
  key: "prefer_raise_exception_new",
67070
67291
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
67071
67292
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
67072
- extendedInformation: `
67073
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
67074
-
67293
+ extendedInformation: `
67294
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
67295
+
67075
67296
  From 752 and up`,
67076
67297
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
67077
67298
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
67078
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
67079
- EXPORTING
67299
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
67300
+ EXPORTING
67080
67301
  previous = exception.`,
67081
67302
  };
67082
67303
  }
@@ -67154,12 +67375,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
67154
67375
  key: "prefer_returning_to_exporting",
67155
67376
  title: "Prefer RETURNING to EXPORTING",
67156
67377
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
67157
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
67378
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
67158
67379
  https://docs.abapopenchecks.org/checks/44/`,
67159
67380
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67160
- badExample: `CLASS lcl DEFINITION.
67161
- PUBLIC SECTION.
67162
- METHODS test EXPORTING ev_foo TYPE i.
67381
+ badExample: `CLASS lcl DEFINITION.
67382
+ PUBLIC SECTION.
67383
+ METHODS test EXPORTING ev_foo TYPE i.
67163
67384
  ENDCLASS.`,
67164
67385
  };
67165
67386
  }
@@ -67255,8 +67476,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
67255
67476
  key: "prefer_xsdbool",
67256
67477
  title: "Prefer xsdbool over boolc",
67257
67478
  shortDescription: `Prefer xsdbool over boolc`,
67258
- extendedInformation: `Activates if language version is v740sp08 or above.
67259
-
67479
+ extendedInformation: `Activates if language version is v740sp08 or above.
67480
+
67260
67481
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
67261
67482
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
67262
67483
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -67328,9 +67549,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
67328
67549
  title: "Preferred compare operator",
67329
67550
  shortDescription: `Configure undesired operator variants`,
67330
67551
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
67331
- badExample: `IF foo EQ bar.
67552
+ badExample: `IF foo EQ bar.
67332
67553
  ENDIF.`,
67333
- goodExample: `IF foo = bar.
67554
+ goodExample: `IF foo = bar.
67334
67555
  ENDIF.`,
67335
67556
  };
67336
67557
  }
@@ -67554,26 +67775,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
67554
67775
  key: "reduce_procedural_code",
67555
67776
  title: "Reduce procedural code",
67556
67777
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
67557
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
67558
-
67559
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
67560
-
67778
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
67779
+
67780
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
67781
+
67561
67782
  Comments are not counted as statements.`,
67562
67783
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67563
- badExample: `FORM foo.
67564
- DATA lv_bar TYPE i.
67565
- lv_bar = 2 + 2.
67566
- IF lv_bar = 4.
67567
- WRITE 'hello world'.
67568
- ENDIF.
67569
- DATA lv_bar TYPE i.
67570
- lv_bar = 2 + 2.
67571
- IF lv_bar = 4.
67572
- WRITE 'hello world'.
67573
- ENDIF.
67784
+ badExample: `FORM foo.
67785
+ DATA lv_bar TYPE i.
67786
+ lv_bar = 2 + 2.
67787
+ IF lv_bar = 4.
67788
+ WRITE 'hello world'.
67789
+ ENDIF.
67790
+ DATA lv_bar TYPE i.
67791
+ lv_bar = 2 + 2.
67792
+ IF lv_bar = 4.
67793
+ WRITE 'hello world'.
67794
+ ENDIF.
67574
67795
  ENDFORM.`,
67575
- goodExample: `FORM foo.
67576
- NEW zcl_global_class( )->run_logic( ).
67796
+ goodExample: `FORM foo.
67797
+ NEW zcl_global_class( )->run_logic( ).
67577
67798
  ENDFORM.`,
67578
67799
  };
67579
67800
  }
@@ -67817,10 +68038,10 @@ class RemoveDescriptions {
67817
68038
  return {
67818
68039
  key: "remove_descriptions",
67819
68040
  title: "Remove descriptions",
67820
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
67821
-
67822
- Class descriptions are required, see rule description_empty.
67823
-
68041
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
68042
+
68043
+ Class descriptions are required, see rule description_empty.
68044
+
67824
68045
  Consider using ABAP Doc for documentation.`,
67825
68046
  tags: [],
67826
68047
  };
@@ -67945,16 +68166,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
67945
68166
  tags: [_irule_1.RuleTag.SingleFile],
67946
68167
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
67947
68168
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
67948
- badExample: `
67949
- CALL FUNCTION 'ZRFC'
68169
+ badExample: `CALL FUNCTION 'ZRFC'
67950
68170
  DESTINATION lv_rfc.`,
67951
- goodExample: `
67952
- CALL FUNCTION 'ZRFC'
67953
- DESTINATION lv_rfc
67954
- EXCEPTIONS
67955
- system_failure = 1 MESSAGE msg
67956
- communication_failure = 2 MESSAGE msg
67957
- resource_failure = 3
68171
+ goodExample: `CALL FUNCTION 'ZRFC'
68172
+ DESTINATION lv_rfc
68173
+ EXCEPTIONS
68174
+ system_failure = 1 MESSAGE msg
68175
+ communication_failure = 2 MESSAGE msg
68176
+ resource_failure = 3
67958
68177
  OTHERS = 4.`,
67959
68178
  };
67960
68179
  }
@@ -68038,11 +68257,11 @@ class SelectAddOrderBy {
68038
68257
  key: "select_add_order_by",
68039
68258
  title: "SELECT add ORDER BY",
68040
68259
  shortDescription: `SELECTs add ORDER BY clause`,
68041
- extendedInformation: `
68042
- This will make sure that the SELECT statement returns results in the same sequence on different databases
68043
-
68044
- add ORDER BY PRIMARY KEY if in doubt
68045
-
68260
+ extendedInformation: `
68261
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
68262
+
68263
+ add ORDER BY PRIMARY KEY if in doubt
68264
+
68046
68265
  If the target is a sorted/hashed table, no issue is reported`,
68047
68266
  tags: [_irule_1.RuleTag.SingleFile],
68048
68267
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -68173,14 +68392,14 @@ class SelectPerformance {
68173
68392
  key: "select_performance",
68174
68393
  title: "SELECT performance",
68175
68394
  shortDescription: `Various checks regarding SELECT performance.`,
68176
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
68177
-
68395
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
68396
+
68178
68397
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
68179
68398
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
68180
- badExample: `SELECT field1, field2 FROM table
68181
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
68399
+ badExample: `SELECT field1, field2 FROM table
68400
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
68182
68401
  ENDSELECT.`,
68183
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
68402
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
68184
68403
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
68185
68404
  };
68186
68405
  }
@@ -68294,8 +68513,8 @@ class SelectSingleFullKey {
68294
68513
  key: "select_single_full_key",
68295
68514
  title: "Detect SELECT SINGLE which are possibily not unique",
68296
68515
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
68297
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
68298
-
68516
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
68517
+
68299
68518
  If the statement contains a JOIN it is not checked`,
68300
68519
  pseudoComment: "EC CI_NOORDER",
68301
68520
  tags: [_irule_1.RuleTag.Quickfix],
@@ -68719,8 +68938,8 @@ class SICFConsistency {
68719
68938
  key: "sicf_consistency",
68720
68939
  title: "SICF consistency",
68721
68940
  shortDescription: `Checks the validity of ICF services`,
68722
- extendedInformation: `* Class defined in handler must exist
68723
- * Class must not have any syntax errors
68941
+ extendedInformation: `* Class defined in handler must exist
68942
+ * Class must not have any syntax errors
68724
68943
  * Class must implement interface IF_HTTP_EXTENSION`,
68725
68944
  };
68726
68945
  }
@@ -68832,23 +69051,23 @@ class SlowParameterPassing {
68832
69051
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
68833
69052
  extendedInformation: `Method parameters defined in interfaces is not checked`,
68834
69053
  tags: [_irule_1.RuleTag.Performance],
68835
- badExample: `CLASS lcl DEFINITION.
68836
- PUBLIC SECTION.
68837
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
68838
- ENDCLASS.
68839
- CLASS lcl IMPLEMENTATION.
68840
- METHOD bar.
68841
- WRITE sdf.
68842
- ENDMETHOD.
69054
+ badExample: `CLASS lcl DEFINITION.
69055
+ PUBLIC SECTION.
69056
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
69057
+ ENDCLASS.
69058
+ CLASS lcl IMPLEMENTATION.
69059
+ METHOD bar.
69060
+ WRITE sdf.
69061
+ ENDMETHOD.
68843
69062
  ENDCLASS.`,
68844
- goodExample: `CLASS lcl DEFINITION.
68845
- PUBLIC SECTION.
68846
- METHODS bar IMPORTING sdf TYPE string.
68847
- ENDCLASS.
68848
- CLASS lcl IMPLEMENTATION.
68849
- METHOD bar.
68850
- WRITE sdf.
68851
- ENDMETHOD.
69063
+ goodExample: `CLASS lcl DEFINITION.
69064
+ PUBLIC SECTION.
69065
+ METHODS bar IMPORTING sdf TYPE string.
69066
+ ENDCLASS.
69067
+ CLASS lcl IMPLEMENTATION.
69068
+ METHOD bar.
69069
+ WRITE sdf.
69070
+ ENDMETHOD.
68852
69071
  ENDCLASS.`,
68853
69072
  };
68854
69073
  }
@@ -69105,8 +69324,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
69105
69324
  key: "space_before_dot",
69106
69325
  title: "Space before dot",
69107
69326
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
69108
- extendedInformation: `
69109
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
69327
+ extendedInformation: `
69328
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
69110
69329
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
69111
69330
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69112
69331
  badExample: `WRITE bar .`,
@@ -69292,12 +69511,12 @@ class SQLValueConversion {
69292
69511
  key: "sql_value_conversion",
69293
69512
  title: "Implicit SQL Value Conversion",
69294
69513
  shortDescription: `Ensure types match when selecting from database`,
69295
- extendedInformation: `
69296
- * Integer to CHAR conversion
69297
- * Integer to NUMC conversion
69298
- * NUMC to Integer conversion
69299
- * CHAR to Integer conversion
69300
- * Source field longer than database field, CHAR -> CHAR
69514
+ extendedInformation: `
69515
+ * Integer to CHAR conversion
69516
+ * Integer to NUMC conversion
69517
+ * NUMC to Integer conversion
69518
+ * CHAR to Integer conversion
69519
+ * Source field longer than database field, CHAR -> CHAR
69301
69520
  * Source field longer than database field, NUMC -> NUMC`,
69302
69521
  tags: [],
69303
69522
  };
@@ -69369,7 +69588,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
69369
69588
  key: "start_at_tab",
69370
69589
  title: "Start at tab",
69371
69590
  shortDescription: `Checks that statements start at tabstops.`,
69372
- extendedInformation: `Reports max 100 issues per file
69591
+ extendedInformation: `Reports max 100 issues per file
69373
69592
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
69374
69593
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69375
69594
  badExample: ` WRITE a.`,
@@ -69546,12 +69765,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
69546
69765
  key: "strict_sql",
69547
69766
  title: "Strict SQL",
69548
69767
  shortDescription: `Strict SQL`,
69549
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
69550
-
69551
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
69552
-
69553
- Also see separate rule sql_escape_host_variables
69554
-
69768
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
69769
+
69770
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
69771
+
69772
+ Also see separate rule sql_escape_host_variables
69773
+
69555
69774
  Activates from v750 and up`,
69556
69775
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
69557
69776
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -69805,11 +70024,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
69805
70024
  key: "sy_modification",
69806
70025
  title: "Modification of SY fields",
69807
70026
  shortDescription: `Finds modification of sy fields`,
69808
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
69809
-
70027
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
70028
+
69810
70029
  Changes to SY-TVAR* fields are not reported`,
69811
70030
  tags: [_irule_1.RuleTag.SingleFile],
69812
- badExample: `sy-uname = 2.
70031
+ badExample: `sy-uname = 2.
69813
70032
  sy = sy.`,
69814
70033
  };
69815
70034
  }
@@ -69871,8 +70090,8 @@ class TABLEnhancementCategory {
69871
70090
  key: "tabl_enhancement_category",
69872
70091
  title: "TABL enhancement category must be set",
69873
70092
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
69874
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
69875
-
70093
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
70094
+
69876
70095
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
69877
70096
  tags: [],
69878
70097
  };
@@ -70000,9 +70219,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
70000
70219
  title: "Type FORM parameters",
70001
70220
  shortDescription: `Checks for untyped FORM parameters`,
70002
70221
  tags: [_irule_1.RuleTag.SingleFile],
70003
- badExample: `FORM foo USING bar.
70222
+ badExample: `FORM foo USING bar.
70004
70223
  ENDFORM.`,
70005
- goodExample: `FORM foo USING bar TYPE string.
70224
+ goodExample: `FORM foo USING bar TYPE string.
70006
70225
  ENDFORM.`,
70007
70226
  };
70008
70227
  }
@@ -70056,7 +70275,7 @@ const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplin
70056
70275
  class TypesNamingConf extends _basic_rule_config_1.BasicRuleConfig {
70057
70276
  constructor() {
70058
70277
  super(...arguments);
70059
- /** The pattern for TYPES */
70278
+ /** The pattern for TYPES, case insensitive */
70060
70279
  this.pattern = "^TY_.+$";
70061
70280
  }
70062
70281
  }
@@ -70675,38 +70894,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
70675
70894
  key: "unnecessary_pragma",
70676
70895
  title: "Unnecessary Pragma",
70677
70896
  shortDescription: `Finds pragmas which can be removed`,
70678
- extendedInformation: `* NO_HANDLER with handler
70679
-
70680
- * NEEDED without definition
70681
-
70682
- * NO_TEXT without texts
70683
-
70684
- * SUBRC_OK where sy-subrc is checked
70685
-
70897
+ extendedInformation: `* NO_HANDLER with handler
70898
+
70899
+ * NEEDED without definition
70900
+
70901
+ * NO_TEXT without texts
70902
+
70903
+ * SUBRC_OK where sy-subrc is checked
70904
+
70686
70905
  NO_HANDLER inside macros are not checked`,
70687
70906
  tags: [_irule_1.RuleTag.SingleFile],
70688
- badExample: `TRY.
70689
- ...
70690
- CATCH zcx_abapgit_exception ##NO_HANDLER.
70691
- RETURN. " it has a handler
70692
- ENDTRY.
70693
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
70694
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
70695
- IF sy-subrc <> 0.
70907
+ badExample: `TRY.
70908
+ ...
70909
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
70910
+ RETURN. " it has a handler
70911
+ ENDTRY.
70912
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
70913
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
70914
+ IF sy-subrc <> 0.
70696
70915
  ENDIF.`,
70697
- goodExample: `TRY.
70698
- ...
70699
- CATCH zcx_abapgit_exception.
70700
- RETURN.
70701
- ENDTRY.
70702
- MESSAGE w125(zbar) WITH c_foo INTO message.
70703
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
70704
- IF sy-subrc <> 0.
70705
- ENDIF.
70706
-
70707
- DATA: BEGIN OF blah ##NEEDED,
70708
- test1 TYPE string,
70709
- test2 TYPE string,
70916
+ goodExample: `TRY.
70917
+ ...
70918
+ CATCH zcx_abapgit_exception.
70919
+ RETURN.
70920
+ ENDTRY.
70921
+ MESSAGE w125(zbar) WITH c_foo INTO message.
70922
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
70923
+ IF sy-subrc <> 0.
70924
+ ENDIF.
70925
+
70926
+ DATA: BEGIN OF blah ##NEEDED,
70927
+ test1 TYPE string,
70928
+ test2 TYPE string,
70710
70929
  END OF blah.`,
70711
70930
  };
70712
70931
  }
@@ -70873,18 +71092,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
70873
71092
  shortDescription: `Finds unnecessary RETURN statements`,
70874
71093
  extendedInformation: `Finds unnecessary RETURN statements`,
70875
71094
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
70876
- badExample: `FORM hello1.
70877
- WRITE 'world'.
70878
- RETURN.
70879
- ENDFORM.
70880
-
70881
- FORM foo.
70882
- IF 1 = 2.
70883
- RETURN.
70884
- ENDIF.
71095
+ badExample: `FORM hello1.
71096
+ WRITE 'world'.
71097
+ RETURN.
71098
+ ENDFORM.
71099
+
71100
+ FORM foo.
71101
+ IF 1 = 2.
71102
+ RETURN.
71103
+ ENDIF.
70885
71104
  ENDFORM.`,
70886
- goodExample: `FORM hello2.
70887
- WRITE 'world'.
71105
+ goodExample: `FORM hello2.
71106
+ WRITE 'world'.
70888
71107
  ENDFORM.`,
70889
71108
  };
70890
71109
  }
@@ -71200,6 +71419,90 @@ exports.UnusedDDIC = UnusedDDIC;
71200
71419
 
71201
71420
  /***/ }),
71202
71421
 
71422
+ /***/ "./node_modules/@abaplint/core/build/src/rules/unused_macros.js":
71423
+ /*!**********************************************************************!*\
71424
+ !*** ./node_modules/@abaplint/core/build/src/rules/unused_macros.js ***!
71425
+ \**********************************************************************/
71426
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
71427
+
71428
+ "use strict";
71429
+
71430
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
71431
+ exports.UnusedMacros = exports.UnusedMacrosConf = void 0;
71432
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
71433
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
71434
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
71435
+ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
71436
+ const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
71437
+ class UnusedMacrosConf extends _basic_rule_config_1.BasicRuleConfig {
71438
+ constructor() {
71439
+ super(...arguments);
71440
+ /** skip specific names, case insensitive
71441
+ * @uniqueItems true
71442
+ */
71443
+ this.skipNames = [];
71444
+ }
71445
+ }
71446
+ exports.UnusedMacrosConf = UnusedMacrosConf;
71447
+ class UnusedMacros {
71448
+ constructor() {
71449
+ this.conf = new UnusedMacrosConf();
71450
+ }
71451
+ getMetadata() {
71452
+ return {
71453
+ key: "unused_macros",
71454
+ title: "Unused macros",
71455
+ shortDescription: `Checks for unused macro definitions definitions`,
71456
+ tags: [_irule_1.RuleTag.Quickfix],
71457
+ badExample: `DEFINE foobar1.
71458
+ WRITE 'hello'.
71459
+ END-OF-DEFINITION.`,
71460
+ goodExample: `DEFINE foobar2.
71461
+ WRITE 'hello'.
71462
+ END-OF-DEFINITION.
71463
+
71464
+ foobar2.`,
71465
+ };
71466
+ }
71467
+ getConfig() {
71468
+ return this.conf;
71469
+ }
71470
+ setConfig(conf) {
71471
+ this.conf = conf;
71472
+ if (this.conf.skipNames === undefined) {
71473
+ this.conf.skipNames = [];
71474
+ }
71475
+ }
71476
+ initialize(reg) {
71477
+ this.reg = reg;
71478
+ return this;
71479
+ }
71480
+ run(obj) {
71481
+ var _a;
71482
+ const result = [];
71483
+ if (!(obj instanceof _abap_object_1.ABAPObject)) {
71484
+ return [];
71485
+ }
71486
+ const references = this.reg.getMacroReferences();
71487
+ for (const file of obj.getABAPFiles()) {
71488
+ for (const macroToken of references.listDefinitionsByFile(file.getFilename())) {
71489
+ const usages = references.listUsagesbyMacro(file.getFilename(), macroToken);
71490
+ if (usages.length === 0 && ((_a = this.conf.skipNames) === null || _a === void 0 ? void 0 : _a.includes(macroToken.getStr().toUpperCase())) === false) {
71491
+ const message = "Unused macro definition: " + macroToken.getStr();
71492
+ const pos = references.getDefinitionRange(file.getFilename(), macroToken);
71493
+ const fix = edit_helper_1.EditHelper.deleteRange(file, pos.start, pos.end);
71494
+ result.push(issue_1.Issue.atToken(file, macroToken, message, this.getMetadata().key, this.conf.severity, fix));
71495
+ }
71496
+ }
71497
+ }
71498
+ return result;
71499
+ }
71500
+ }
71501
+ exports.UnusedMacros = UnusedMacros;
71502
+ //# sourceMappingURL=unused_macros.js.map
71503
+
71504
+ /***/ }),
71505
+
71203
71506
  /***/ "./node_modules/@abaplint/core/build/src/rules/unused_methods.js":
71204
71507
  /*!***********************************************************************!*\
71205
71508
  !*** ./node_modules/@abaplint/core/build/src/rules/unused_methods.js ***!
@@ -71265,17 +71568,17 @@ class UnusedMethods {
71265
71568
  key: "unused_methods",
71266
71569
  title: "Unused methods",
71267
71570
  shortDescription: `Checks for unused methods`,
71268
- extendedInformation: `Checks private and protected methods.
71269
-
71270
- Unused methods are not reported if the object contains parser or syntax errors.
71271
-
71272
- Skips:
71273
- * methods FOR TESTING
71274
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
71275
- * class_constructor + constructor methods
71276
- * event handlers
71277
- * methods that are redefined
71278
- * INCLUDEs
71571
+ extendedInformation: `Checks private and protected methods.
71572
+
71573
+ Unused methods are not reported if the object contains parser or syntax errors.
71574
+
71575
+ Skips:
71576
+ * methods FOR TESTING
71577
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
71578
+ * class_constructor + constructor methods
71579
+ * event handlers
71580
+ * methods that are redefined
71581
+ * INCLUDEs
71279
71582
  `,
71280
71583
  tags: [],
71281
71584
  pragma: "##CALLED",
@@ -71709,23 +72012,23 @@ class UnusedVariables {
71709
72012
  key: "unused_variables",
71710
72013
  title: "Unused variables",
71711
72014
  shortDescription: `Checks for unused variables and constants`,
71712
- extendedInformation: `Skips event parameters.
71713
-
71714
- Note that this currently does not work if the source code uses macros.
71715
-
71716
- Unused variables are not reported if the object contains parser or syntax errors.
71717
-
72015
+ extendedInformation: `Skips event parameters.
72016
+
72017
+ Note that this currently does not work if the source code uses macros.
72018
+
72019
+ Unused variables are not reported if the object contains parser or syntax errors.
72020
+
71718
72021
  Errors found in INCLUDES are reported for the main program.`,
71719
72022
  tags: [_irule_1.RuleTag.Quickfix],
71720
72023
  pragma: "##NEEDED",
71721
72024
  pseudoComment: "EC NEEDED",
71722
- badExample: `DATA: BEGIN OF blah1,
71723
- test TYPE string,
71724
- test2 TYPE string,
72025
+ badExample: `DATA: BEGIN OF blah1,
72026
+ test TYPE string,
72027
+ test2 TYPE string,
71725
72028
  END OF blah1.`,
71726
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
71727
- test TYPE string,
71728
- test2 TYPE string,
72029
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
72030
+ test TYPE string,
72031
+ test2 TYPE string,
71729
72032
  END OF blah2.`,
71730
72033
  };
71731
72034
  }
@@ -71944,15 +72247,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
71944
72247
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
71945
72248
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
71946
72249
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
71947
- badExample: `IF line IS INITIAL.
71948
- has_entries = abap_false.
71949
- ELSE.
71950
- has_entries = abap_true.
71951
- ENDIF.
71952
-
72250
+ badExample: `IF line IS INITIAL.
72251
+ has_entries = abap_false.
72252
+ ELSE.
72253
+ has_entries = abap_true.
72254
+ ENDIF.
72255
+
71953
72256
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
71954
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
71955
-
72257
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
72258
+
71956
72259
  DATA(fsdf) = xsdbool( foo <> bar ).`,
71957
72260
  };
71958
72261
  }
@@ -72070,15 +72373,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
72070
72373
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
72071
72374
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
72072
72375
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72073
- badExample: `INTERFACE lif.
72074
- METHODS load_data
72075
- EXCEPTIONS
72076
- invalid_parameter.
72376
+ badExample: `INTERFACE lif.
72377
+ METHODS load_data
72378
+ EXCEPTIONS
72379
+ invalid_parameter.
72077
72380
  ENDINTERFACE.`,
72078
- goodExample: `INTERFACE lif.
72079
- METHODS load_data
72080
- RAISING
72081
- cx_something.
72381
+ goodExample: `INTERFACE lif.
72382
+ METHODS load_data
72383
+ RAISING
72384
+ cx_something.
72082
72385
  ENDINTERFACE.`,
72083
72386
  };
72084
72387
  }
@@ -72138,15 +72441,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
72138
72441
  key: "use_line_exists",
72139
72442
  title: "Use line_exists",
72140
72443
  shortDescription: `Use line_exists, from 740sp02 and up`,
72141
- extendedInformation: `
72142
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
72143
-
72444
+ extendedInformation: `
72445
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
72446
+
72144
72447
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
72145
72448
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72146
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
72147
- IF sy-subrc = 0.
72449
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
72450
+ IF sy-subrc = 0.
72148
72451
  ENDIF.`,
72149
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
72452
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
72150
72453
  ENDIF.`,
72151
72454
  };
72152
72455
  }
@@ -72256,10 +72559,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
72256
72559
  key: "use_new",
72257
72560
  title: "Use NEW",
72258
72561
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
72259
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
72260
-
72261
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
72262
-
72562
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
72563
+
72564
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
72565
+
72263
72566
  Applicable from v740sp02 and up`,
72264
72567
  badExample: `CREATE OBJECT ref.`,
72265
72568
  goodExample: `ref = NEW #( ).`,
@@ -72357,13 +72660,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
72357
72660
  title: "WHEN OTHERS last",
72358
72661
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
72359
72662
  tags: [_irule_1.RuleTag.SingleFile],
72360
- badExample: `CASE bar.
72361
- WHEN OTHERS.
72362
- WHEN 2.
72663
+ badExample: `CASE bar.
72664
+ WHEN OTHERS.
72665
+ WHEN 2.
72363
72666
  ENDCASE.`,
72364
- goodExample: `CASE bar.
72365
- WHEN 2.
72366
- WHEN OTHERS.
72667
+ goodExample: `CASE bar.
72668
+ WHEN 2.
72669
+ WHEN OTHERS.
72367
72670
  ENDCASE.`,
72368
72671
  };
72369
72672
  }
@@ -73337,7 +73640,8 @@ exports.NameValidator = NameValidator;
73337
73640
  "use strict";
73338
73641
 
73339
73642
  Object.defineProperty(exports, "__esModule", ({ value: true }));
73340
- exports.getPreviousVersion = exports.defaultVersion = exports.Version = void 0;
73643
+ exports.defaultVersion = exports.Version = void 0;
73644
+ exports.getPreviousVersion = getPreviousVersion;
73341
73645
  var Version;
73342
73646
  (function (Version) {
73343
73647
  Version["OpenABAP"] = "open-abap";
@@ -73372,7 +73676,6 @@ function getPreviousVersion(v) {
73372
73676
  }
73373
73677
  return all[found - 1];
73374
73678
  }
73375
- exports.getPreviousVersion = getPreviousVersion;
73376
73679
  //# sourceMappingURL=version.js.map
73377
73680
 
73378
73681
  /***/ }),
@@ -73417,7 +73720,8 @@ exports.VirtualPosition = VirtualPosition;
73417
73720
  "use strict";
73418
73721
 
73419
73722
  Object.defineProperty(exports, "__esModule", ({ value: true }));
73420
- exports.unescape = exports.xmlToArray = void 0;
73723
+ exports.xmlToArray = xmlToArray;
73724
+ exports.unescape = unescape;
73421
73725
  function xmlToArray(data) {
73422
73726
  if (data === undefined) {
73423
73727
  return [];
@@ -73429,7 +73733,6 @@ function xmlToArray(data) {
73429
73733
  return [data];
73430
73734
  }
73431
73735
  }
73432
- exports.xmlToArray = xmlToArray;
73433
73736
  function unescape(str) {
73434
73737
  if (str === undefined) {
73435
73738
  return "";
@@ -73441,7 +73744,6 @@ function unescape(str) {
73441
73744
  str = str.replace(/&apos;/g, "'");
73442
73745
  return str;
73443
73746
  }
73444
- exports.unescape = unescape;
73445
73747
  //# sourceMappingURL=xml_utils.js.map
73446
73748
 
73447
73749
  /***/ }),
@@ -77735,7 +78037,12 @@ class Keywords {
77735
78037
  for (const f of o.getABAPFiles()) {
77736
78038
  const tokens = [];
77737
78039
  for (const s of f.getStatements()) {
77738
- tokens.push(...this.traverse(s, f));
78040
+ if (s.get() instanceof abaplint.MacroCall) {
78041
+ tokens.push(...this.handleMacro(s));
78042
+ }
78043
+ else {
78044
+ tokens.push(...this.traverse(s, f));
78045
+ }
77739
78046
  }
77740
78047
  if (tokens.length === 0) {
77741
78048
  continue;
@@ -77751,6 +78058,20 @@ class Keywords {
77751
78058
  }
77752
78059
  reg.parse();
77753
78060
  }
78061
+ handleMacro(node) {
78062
+ const tokens = [];
78063
+ for (const token of node.getTokens()) {
78064
+ for (const k of this.keywords) {
78065
+ const lower = token.getStr().toLowerCase();
78066
+ if (k === lower
78067
+ || "!" + k === lower
78068
+ || lower.endsWith("~" + k)) {
78069
+ tokens.push(token);
78070
+ }
78071
+ }
78072
+ }
78073
+ return tokens;
78074
+ }
77754
78075
  traverse(node, file) {
77755
78076
  const ret = [];
77756
78077
  for (const c of node.getChildren()) {
@@ -80861,7 +81182,8 @@ exports.InitializationTranspiler = InitializationTranspiler;
80861
81182
  "use strict";
80862
81183
 
80863
81184
  Object.defineProperty(exports, "__esModule", ({ value: true }));
80864
- exports.findConnection = exports.InsertDatabaseTranspiler = void 0;
81185
+ exports.InsertDatabaseTranspiler = void 0;
81186
+ exports.findConnection = findConnection;
80865
81187
  const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
80866
81188
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
80867
81189
  const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
@@ -80905,7 +81227,6 @@ function findConnection(connection) {
80905
81227
  }
80906
81228
  return con;
80907
81229
  }
80908
- exports.findConnection = findConnection;
80909
81230
  //# sourceMappingURL=insert_database.js.map
80910
81231
 
80911
81232
  /***/ }),