@abaplint/core 2.93.15 → 2.93.16

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.
@@ -104,18 +104,21 @@ class StatementParser {
104
104
  const result = [];
105
105
  for (let statement of wa.statements) {
106
106
  // dont use CALL METHOD, when executing lazy, it easily gives a Move for the last statment if lazy logic is evaluated
107
- if (statement.get() instanceof _statement_1.Unknown
108
- && statement.concatTokens().toUpperCase().startsWith("CALL METHOD ") === false
109
- && statement.concatTokens().toUpperCase().startsWith("CALL FUNCTION ") === false) {
110
- for (const { first, second } of this.buildSplits(statement.getTokens())) {
111
- if (second.length === 1) {
112
- continue; // probably punctuation
113
- }
114
- const s = this.categorizeStatement(new nodes_1.StatementNode(new _statement_1.Unknown()).setChildren(this.tokensToNodes(second)));
115
- if (!(s.get() instanceof _statement_1.Unknown)) {
116
- result.push(new nodes_1.StatementNode(new _statement_1.Unknown()).setChildren(this.tokensToNodes(first)));
117
- statement = s;
118
- break;
107
+ if (statement.get() instanceof _statement_1.Unknown) {
108
+ const concat = statement.concatTokens().toUpperCase();
109
+ if (concat.startsWith("CALL METHOD ") === false
110
+ && concat.startsWith("RAISE EXCEPTION TYPE ") === false
111
+ && concat.startsWith("CALL FUNCTION ") === false) {
112
+ for (const { first, second } of this.buildSplits(statement.getTokens())) {
113
+ if (second.length === 1) {
114
+ continue; // probably punctuation
115
+ }
116
+ const s = this.categorizeStatement(new nodes_1.StatementNode(new _statement_1.Unknown()).setChildren(this.tokensToNodes(second)));
117
+ if (!(s.get() instanceof _statement_1.Unknown)) {
118
+ result.push(new nodes_1.StatementNode(new _statement_1.Unknown()).setChildren(this.tokensToNodes(first)));
119
+ statement = s;
120
+ break;
121
+ }
119
122
  }
120
123
  }
121
124
  }
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.93.15";
66
+ return "2.93.16";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -9,6 +9,13 @@ const _abap_rule_1 = require("./_abap_rule");
9
9
  const _basic_rule_config_1 = require("./_basic_rule_config");
10
10
  const _irule_1 = require("./_irule");
11
11
  class ChangeIfToCaseConf extends _basic_rule_config_1.BasicRuleConfig {
12
+ constructor() {
13
+ super(...arguments);
14
+ /** skip specific names, case insensitive regular expression
15
+ * @uniqueItems true
16
+ */
17
+ this.skipNames = [];
18
+ }
12
19
  }
13
20
  exports.ChangeIfToCaseConf = ChangeIfToCaseConf;
14
21
  class ChangeIfToCase extends _abap_rule_1.ABAPRule {
@@ -113,6 +120,12 @@ ENDCASE.`,
113
120
  else {
114
121
  return false;
115
122
  }
123
+ for (const skip of this.getConfig().skipNames || []) {
124
+ const reg = new RegExp(skip, "i");
125
+ if (chain.match(reg)) {
126
+ return false;
127
+ }
128
+ }
116
129
  for (const t of tuples) {
117
130
  if (t.left !== chain && t.right !== chain) {
118
131
  return false;
@@ -139,6 +139,7 @@ Only one transformation is applied to a statement at a time, so multiple steps m
139
139
  const message = "Internal Error: Statement lengths does not match";
140
140
  ret.push(Issue.atStatement(lowFile, lowStatements[0], message, this.getMetadata().key));
141
141
  */
142
+ // hmm, add some way to disable lazyUnknown() in statement_parser.ts
142
143
  continue;
143
144
  }
144
145
  for (let i = 0; i < lowStatements.length; i++) {
@@ -8,7 +8,9 @@ const position_1 = require("../position");
8
8
  class SICFConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {
9
9
  constructor() {
10
10
  super(...arguments);
11
- /** skip specific names, case insensitive */
11
+ /** skip specific names, case insensitive
12
+ * @uniqueItems true
13
+ */
12
14
  this.skipNames = [];
13
15
  }
14
16
  }
@@ -39,7 +39,9 @@ class WorkArea {
39
39
  class UnusedTypesConf extends _basic_rule_config_1.BasicRuleConfig {
40
40
  constructor() {
41
41
  super(...arguments);
42
- /** skip specific names, case insensitive */
42
+ /** skip specific names, case insensitive
43
+ * @uniqueItems true
44
+ */
43
45
  this.skipNames = [];
44
46
  }
45
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.93.15",
3
+ "version": "2.93.16",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://abaplint.org",
48
48
  "devDependencies": {
49
- "@microsoft/api-extractor": "^7.31.0",
49
+ "@microsoft/api-extractor": "^7.31.1",
50
50
  "@types/chai": "^4.3.3",
51
51
  "@types/mocha": "^9.1.1",
52
52
  "@types/node": "^18.7.18",