@abaplint/core 2.99.3 → 2.99.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -239,7 +239,7 @@ class CurrentScope {
239
239
  return undefined;
240
240
  }
241
241
  const typePoolName = name.split("_")[0];
242
- if (typePoolName.length !== 4) {
242
+ if (typePoolName.length <= 2 || typePoolName.length > 5) {
243
243
  return undefined;
244
244
  }
245
245
  const typePool = this.reg.getObject("TYPE", typePoolName);
@@ -256,7 +256,10 @@ class CurrentScope {
256
256
  return undefined;
257
257
  }
258
258
  const typePoolName = name.split("_")[0];
259
- if (typePoolName.length !== 4 || new ddic_1.DDIC(this.reg).lookupNoVoid(name) !== undefined) {
259
+ if (typePoolName.length <= 2 || typePoolName.length > 5) {
260
+ return undefined;
261
+ }
262
+ if (new ddic_1.DDIC(this.reg).lookupNoVoid(name) !== undefined) {
260
263
  // this is tricky, it should not do recursion when parsing the type pool itself,
261
264
  // think about DTEL ABAP_ENCOD vs TYPE ABAP
262
265
  return undefined;
@@ -6,7 +6,7 @@ class CharacterType extends _abstract_type_1.AbstractType {
6
6
  constructor(length, extra) {
7
7
  super(extra);
8
8
  if (length <= 0) {
9
- throw new Error("Bad LENGTH");
9
+ throw new Error("Bad LENGTH, Character");
10
10
  }
11
11
  this.length = length;
12
12
  }
@@ -7,7 +7,7 @@ class FloatingPointType extends _abstract_type_1.AbstractType {
7
7
  constructor(length, qualifiedName) {
8
8
  super({ qualifiedName: qualifiedName });
9
9
  if (length <= 0) {
10
- throw new Error("Bad LENGTH");
10
+ throw new Error("Bad LENGTH, Floating Point");
11
11
  }
12
12
  this.length = length;
13
13
  }
@@ -6,7 +6,7 @@ class HexType extends _abstract_type_1.AbstractType {
6
6
  constructor(length, qualifiedName) {
7
7
  super({ qualifiedName: qualifiedName });
8
8
  if (length <= 0) {
9
- throw new Error("Bad LENGTH");
9
+ throw new Error("Bad LENGTHm, Hex");
10
10
  }
11
11
  this.length = length;
12
12
  }
@@ -6,7 +6,7 @@ class NumericType extends _abstract_type_1.AbstractType {
6
6
  constructor(length, qualifiedName) {
7
7
  super({ qualifiedName: qualifiedName });
8
8
  if (length <= 0) {
9
- throw new Error("Bad LENGTH");
9
+ throw new Error("Bad LENGTH, Numeric");
10
10
  }
11
11
  this.length = length;
12
12
  }
@@ -6,10 +6,10 @@ class PackedType extends _abstract_type_1.AbstractType {
6
6
  constructor(length, decimals, extra) {
7
7
  super(extra);
8
8
  if (length <= 0) {
9
- throw new Error("Bad LENGTH");
9
+ throw new Error("Bad LENGTH, Packed");
10
10
  }
11
11
  else if (decimals < 0) {
12
- throw new Error("Bad DECIMALS");
12
+ throw new Error("Bad DECIMALS, Packed");
13
13
  }
14
14
  this.length = length;
15
15
  this.decimals = decimals;
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.99.3";
66
+ return "2.99.5";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -6,6 +6,10 @@ const _basic_rule_config_1 = require("./_basic_rule_config");
6
6
  const _irule_1 = require("./_irule");
7
7
  const __1 = require("..");
8
8
  class SelectSingleFullKeyConf extends _basic_rule_config_1.BasicRuleConfig {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.allowPseudo = true;
12
+ }
9
13
  }
10
14
  exports.SelectSingleFullKeyConf = SelectSingleFullKeyConf;
11
15
  class SelectSingleFullKey {
@@ -27,6 +31,14 @@ class SelectSingleFullKey {
27
31
  return this;
28
32
  }
29
33
  getConfig() {
34
+ if (this.conf === undefined) {
35
+ this.conf = {
36
+ allowPseudo: true,
37
+ };
38
+ }
39
+ if (this.conf.allowPseudo === undefined) {
40
+ this.conf.allowPseudo = true;
41
+ }
30
42
  return this.conf;
31
43
  }
32
44
  setConfig(conf) {
@@ -58,7 +70,11 @@ class SelectSingleFullKey {
58
70
  continue;
59
71
  }
60
72
  const next = statements[i + 1];
61
- if ((next === null || next === void 0 ? void 0 : next.get()) instanceof __1.Comment && next.concatTokens().includes(this.getMetadata().pseudoComment + "")) {
73
+ if ((next === null || next === void 0 ? void 0 : next.get()) instanceof __1.Comment
74
+ && next.concatTokens().includes(this.getMetadata().pseudoComment + "")) {
75
+ if (this.getConfig().allowPseudo !== true) {
76
+ issues.push(issue_1.Issue.atStatement(file, s, "Pseudo comment not allowed", this.getMetadata().key, this.getConfig().severity));
77
+ }
62
78
  continue;
63
79
  }
64
80
  const tabl = this.findReference(databaseTable.getFirstToken().getStart(), syntax.spaghetti, file);
@@ -67,7 +83,6 @@ class SelectSingleFullKey {
67
83
  continue;
68
84
  }
69
85
  const keys = table.listKeys(this.reg);
70
- // const type = table.parseType(this.reg);
71
86
  const cond = s.findFirstExpression(__1.Expressions.SQLCond);
72
87
  const set = new Set();
73
88
  for (const key of keys) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.99.3",
3
+ "version": "2.99.5",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "homepage": "https://abaplint.org",
49
49
  "devDependencies": {
50
- "@microsoft/api-extractor": "^7.34.7",
50
+ "@microsoft/api-extractor": "^7.34.8",
51
51
  "@types/chai": "^4.3.5",
52
52
  "@types/mocha": "^10.0.1",
53
53
  "@types/node": "^18.16.3",