@abaplint/transpiler-cli 2.6.40 → 2.6.42

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 +66 -26
  2. package/package.json +5 -5
package/build/bundle.js CHANGED
@@ -19653,7 +19653,7 @@ class CurrentScope {
19653
19653
  return undefined;
19654
19654
  }
19655
19655
  const typePoolName = name.split("_")[0];
19656
- if (typePoolName.length !== 4) {
19656
+ if (typePoolName.length <= 2 || typePoolName.length > 5) {
19657
19657
  return undefined;
19658
19658
  }
19659
19659
  const typePool = this.reg.getObject("TYPE", typePoolName);
@@ -19670,7 +19670,10 @@ class CurrentScope {
19670
19670
  return undefined;
19671
19671
  }
19672
19672
  const typePoolName = name.split("_")[0];
19673
- if (typePoolName.length !== 4 || new ddic_1.DDIC(this.reg).lookupNoVoid(name) !== undefined) {
19673
+ if (typePoolName.length <= 2 || typePoolName.length > 5) {
19674
+ return undefined;
19675
+ }
19676
+ if (new ddic_1.DDIC(this.reg).lookupNoVoid(name) !== undefined) {
19674
19677
  // this is tricky, it should not do recursion when parsing the type pool itself,
19675
19678
  // think about DTEL ABAP_ENCOD vs TYPE ABAP
19676
19679
  return undefined;
@@ -32975,7 +32978,7 @@ class CharacterType extends _abstract_type_1.AbstractType {
32975
32978
  constructor(length, extra) {
32976
32979
  super(extra);
32977
32980
  if (length <= 0) {
32978
- throw new Error("Bad LENGTH");
32981
+ throw new Error("Bad LENGTH, Character");
32979
32982
  }
32980
32983
  this.length = length;
32981
32984
  }
@@ -33346,7 +33349,7 @@ class FloatingPointType extends _abstract_type_1.AbstractType {
33346
33349
  constructor(length, qualifiedName) {
33347
33350
  super({ qualifiedName: qualifiedName });
33348
33351
  if (length <= 0) {
33349
- throw new Error("Bad LENGTH");
33352
+ throw new Error("Bad LENGTH, Floating Point");
33350
33353
  }
33351
33354
  this.length = length;
33352
33355
  }
@@ -33423,7 +33426,7 @@ class HexType extends _abstract_type_1.AbstractType {
33423
33426
  constructor(length, qualifiedName) {
33424
33427
  super({ qualifiedName: qualifiedName });
33425
33428
  if (length <= 0) {
33426
- throw new Error("Bad LENGTH");
33429
+ throw new Error("Bad LENGTHm, Hex");
33427
33430
  }
33428
33431
  this.length = length;
33429
33432
  }
@@ -33588,7 +33591,7 @@ class NumericType extends _abstract_type_1.AbstractType {
33588
33591
  constructor(length, qualifiedName) {
33589
33592
  super({ qualifiedName: qualifiedName });
33590
33593
  if (length <= 0) {
33591
- throw new Error("Bad LENGTH");
33594
+ throw new Error("Bad LENGTH, Numeric");
33592
33595
  }
33593
33596
  this.length = length;
33594
33597
  }
@@ -33675,10 +33678,10 @@ class PackedType extends _abstract_type_1.AbstractType {
33675
33678
  constructor(length, decimals, extra) {
33676
33679
  super(extra);
33677
33680
  if (length <= 0) {
33678
- throw new Error("Bad LENGTH");
33681
+ throw new Error("Bad LENGTH, Packed");
33679
33682
  }
33680
33683
  else if (decimals < 0) {
33681
- throw new Error("Bad DECIMALS");
33684
+ throw new Error("Bad DECIMALS, Packed");
33682
33685
  }
33683
33686
  this.length = length;
33684
33687
  this.decimals = decimals;
@@ -36790,9 +36793,10 @@ class Config {
36790
36793
  return new Config(JSON.stringify(config));
36791
36794
  }
36792
36795
  getEnabledRules() {
36796
+ var _a;
36793
36797
  const rules = [];
36794
36798
  for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {
36795
- const ruleConfig = this.config["rules"][rule.getMetadata().key];
36799
+ const ruleConfig = (_a = this.config["rules"]) === null || _a === void 0 ? void 0 : _a[rule.getMetadata().key];
36796
36800
  const ruleExists = ruleConfig !== undefined;
36797
36801
  if (ruleExists) {
36798
36802
  if (ruleConfig === false) { // "rule": false
@@ -44147,6 +44151,7 @@ class RenameDataElement {
44147
44151
  changes = changes.concat(helper.renameDDICCodeReferences(obj, oldName, newName));
44148
44152
  changes = changes.concat(helper.renameDDICTABLReferences(obj, oldName, newName));
44149
44153
  changes = changes.concat(helper.renameDDICTTYPReferences(obj, oldName, newName));
44154
+ changes = changes.concat(helper.renameDDICAUTHReferences(obj, oldName, newName));
44150
44155
  return {
44151
44156
  documentChanges: changes,
44152
44157
  };
@@ -44616,6 +44621,21 @@ class RenamerHelper {
44616
44621
  }
44617
44622
  return changes;
44618
44623
  }
44624
+ renameDDICAUTHReferences(obj, oldName, newName) {
44625
+ const changes = [];
44626
+ const used = this.reg.getDDICReferences().listWhereUsed(obj);
44627
+ for (const u of used) {
44628
+ if (u.type !== "AUTH") {
44629
+ continue;
44630
+ }
44631
+ const tabl = this.reg.getObject(u.type, u.name);
44632
+ if (tabl === undefined) {
44633
+ continue;
44634
+ }
44635
+ changes.push(...this.buildXMLFileEdits(tabl, "ROLLNAME", oldName, newName));
44636
+ }
44637
+ return changes;
44638
+ }
44619
44639
  buildXMLFileEdits(object, xmlTag, oldName, newName) {
44620
44640
  const changes = [];
44621
44641
  const xml = object.getXMLFile();
@@ -46609,7 +46629,7 @@ class Registry {
46609
46629
  }
46610
46630
  static abaplintVersion() {
46611
46631
  // magic, see build script "version.sh"
46612
- return "2.99.3";
46632
+ return "2.99.6";
46613
46633
  }
46614
46634
  getDDICReferences() {
46615
46635
  return this.references;
@@ -48898,10 +48918,12 @@ class CheckComments extends _abap_rule_1.ABAPRule {
48898
48918
  shortDescription: `
48899
48919
  Various checks for comment usage.`,
48900
48920
  extendedInformation: `
48901
- * End of line comments. Comments starting with "#EC" or "##" are ignored
48921
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
48902
48922
 
48903
48923
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
48904
48924
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
48925
+ badExample: `WRITE 2. " descriptive comment`,
48926
+ goodExample: `" descriptive comment\nWRITE 2.`,
48905
48927
  };
48906
48928
  }
48907
48929
  getDescription(issueType) {
@@ -62772,6 +62794,10 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
62772
62794
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
62773
62795
  const __1 = __webpack_require__(/*! .. */ "./node_modules/@abaplint/core/build/src/index.js");
62774
62796
  class SelectSingleFullKeyConf extends _basic_rule_config_1.BasicRuleConfig {
62797
+ constructor() {
62798
+ super(...arguments);
62799
+ this.allowPseudo = true;
62800
+ }
62775
62801
  }
62776
62802
  exports.SelectSingleFullKeyConf = SelectSingleFullKeyConf;
62777
62803
  class SelectSingleFullKey {
@@ -62793,6 +62819,14 @@ class SelectSingleFullKey {
62793
62819
  return this;
62794
62820
  }
62795
62821
  getConfig() {
62822
+ if (this.conf === undefined) {
62823
+ this.conf = {
62824
+ allowPseudo: true,
62825
+ };
62826
+ }
62827
+ if (this.conf.allowPseudo === undefined) {
62828
+ this.conf.allowPseudo = true;
62829
+ }
62796
62830
  return this.conf;
62797
62831
  }
62798
62832
  setConfig(conf) {
@@ -62824,7 +62858,11 @@ class SelectSingleFullKey {
62824
62858
  continue;
62825
62859
  }
62826
62860
  const next = statements[i + 1];
62827
- if ((next === null || next === void 0 ? void 0 : next.get()) instanceof __1.Comment && next.concatTokens().includes(this.getMetadata().pseudoComment + "")) {
62861
+ if ((next === null || next === void 0 ? void 0 : next.get()) instanceof __1.Comment
62862
+ && next.concatTokens().includes(this.getMetadata().pseudoComment + "")) {
62863
+ if (this.getConfig().allowPseudo !== true) {
62864
+ issues.push(issue_1.Issue.atStatement(file, s, "Pseudo comment not allowed", this.getMetadata().key, this.getConfig().severity));
62865
+ }
62828
62866
  continue;
62829
62867
  }
62830
62868
  const tabl = this.findReference(databaseTable.getFirstToken().getStart(), syntax.spaghetti, file);
@@ -62833,7 +62871,6 @@ class SelectSingleFullKey {
62833
62871
  continue;
62834
62872
  }
62835
62873
  const keys = table.listKeys(this.reg);
62836
- // const type = table.parseType(this.reg);
62837
62874
  const cond = s.findFirstExpression(__1.Expressions.SQLCond);
62838
62875
  const set = new Set();
62839
62876
  for (const key of keys) {
@@ -65100,6 +65137,7 @@ ENDIF.`,
65100
65137
  && !(statement.get() instanceof Statements.DataEnd)
65101
65138
  && !(statement.get() instanceof Statements.Type)
65102
65139
  && !(statement.get() instanceof Statements.Form)
65140
+ && !(statement.get() instanceof Statements.Tables)
65103
65141
  && !(statement.get() instanceof Statements.TypeEnd)
65104
65142
  && !(statement.get() instanceof Statements.Constant)
65105
65143
  && !(statement.get() instanceof Statements.ConstantEnd)
@@ -78553,21 +78591,23 @@ class Traversal {
78553
78591
  static setValues(identifier, name) {
78554
78592
  const val = identifier.getValue();
78555
78593
  let ret = "";
78556
- if (typeof val === "string") {
78557
- const e = new expressions_1.ConstantTranspiler().escape(val);
78558
- ret += name + ".set(" + e + ");\n";
78559
- }
78560
- else if (typeof val === "object") {
78561
- const a = val;
78562
- for (const v of Object.keys(val)) {
78563
- let s = a[v];
78564
- if (s === undefined) {
78565
- continue;
78594
+ const handle = (val, name) => {
78595
+ if (typeof val === "string") {
78596
+ const e = new expressions_1.ConstantTranspiler().escape(val);
78597
+ ret += name + ".set(" + e + ");\n";
78598
+ }
78599
+ else if (typeof val === "object") {
78600
+ const a = val;
78601
+ for (const v of Object.keys(val)) {
78602
+ const s = a[v];
78603
+ if (s === undefined) {
78604
+ continue;
78605
+ }
78606
+ handle(s, name + ".get()." + v);
78566
78607
  }
78567
- s = new expressions_1.ConstantTranspiler().escape(s);
78568
- ret += name + ".get()." + v + ".set(" + s + ");\n";
78569
78608
  }
78570
- }
78609
+ };
78610
+ handle(val, name);
78571
78611
  return ret;
78572
78612
  }
78573
78613
  buildInternalName(name, def) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.6.40",
3
+ "version": "2.6.42",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,14 +25,14 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.6.40",
28
+ "@abaplint/transpiler": "^2.6.42",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",
32
- "@types/node": "^18.16.3",
33
- "@abaplint/core": "^2.99.3",
32
+ "@types/node": "^20.0.0",
33
+ "@abaplint/core": "^2.99.6",
34
34
  "progress": "^2.0.3",
35
- "webpack": "^5.81.0",
35
+ "webpack": "^5.82.0",
36
36
  "webpack-cli": "^5.0.2",
37
37
  "typescript": "^5.0.4"
38
38
  }