@abaplint/core 2.90.6 → 2.90.7

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.
@@ -69,6 +69,12 @@ class Stream {
69
69
  nextNextChar() {
70
70
  return this.raw.substr(this.offset + 1, 2);
71
71
  }
72
+ getRaw() {
73
+ return this.raw;
74
+ }
75
+ getOffset() {
76
+ return this.offset;
77
+ }
72
78
  }
73
79
  class Lexer {
74
80
  static run(file, virtual) {
@@ -84,10 +90,7 @@ class Lexer {
84
90
  const col = this.stream.getCol();
85
91
  const row = this.stream.getRow();
86
92
  let whiteBefore = false;
87
- let prev = this.stream.prevChar();
88
- if (s.length === 2) {
89
- prev = this.stream.prevPrevChar().substr(0, 1);
90
- }
93
+ const prev = this.stream.getRaw().substr(this.stream.getOffset() - s.length, 1);
91
94
  if (prev === " " || prev === "\n" || prev === "\t" || prev === ":") {
92
95
  whiteBefore = true;
93
96
  }
@@ -113,13 +116,13 @@ class Lexer {
113
116
  if (first === "|" && last === "|") {
114
117
  tok = new Tokens.StringTemplate(pos, s);
115
118
  }
116
- else if (first === "|" && last === "{") {
119
+ else if (first === "|" && last === "{" && whiteAfter === true) {
117
120
  tok = new Tokens.StringTemplateBegin(pos, s);
118
121
  }
119
- else if (first === "}" && last === "|") {
122
+ else if (first === "}" && last === "|" && whiteBefore === true) {
120
123
  tok = new Tokens.StringTemplateEnd(pos, s);
121
124
  }
122
- else if (first === "}" && last === "{") {
125
+ else if (first === "}" && last === "{" && whiteAfter === true && whiteBefore === true) {
123
126
  tok = new Tokens.StringTemplateMiddle(pos, s);
124
127
  }
125
128
  else {
@@ -4,7 +4,7 @@ exports.MethodParamName = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  class MethodParamName extends combi_1.Expression {
6
6
  getRunnable() {
7
- const field = (0, combi_1.regex)(/^!?(\/\w+\/)?\w+$/);
7
+ const field = (0, combi_1.regex)(/^!?\w*(\/\w+\/)?\w+$/);
8
8
  return field;
9
9
  }
10
10
  }
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.90.6";
71
+ return "2.90.7";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -24,7 +24,7 @@ class DangerousStatementConf extends _basic_rule_config_1.BasicRuleConfig {
24
24
  this.deleteReport = true;
25
25
  this.deleteTextpool = true;
26
26
  this.deleteDynpro = true;
27
- this.importDynpro = true;
27
+ this.exportDynpro = true;
28
28
  /** Finds instances of dynamic SQL: SELECT, UPDATE, DELETE, INSERT, MODIFY */
29
29
  this.dynamicSQL = true;
30
30
  }
@@ -89,8 +89,8 @@ dynamic SQL can potentially create SQL injection problems`,
89
89
  else if (this.conf.deleteDynpro && statement instanceof Statements.DeleteDynpro) {
90
90
  message = "DELETE DYNPRO";
91
91
  }
92
- else if (this.conf.importDynpro && statement instanceof Statements.ImportDynpro) {
93
- message = "IMPORT DYNPRO";
92
+ else if (this.conf.exportDynpro && statement instanceof Statements.ExportDynpro) {
93
+ message = "EXPORT DYNPRO";
94
94
  }
95
95
  if (message) {
96
96
  issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity));
@@ -112,7 +112,8 @@ dynamic SQL can potentially create SQL injection problems`,
112
112
  || statement instanceof Statements.InsertDatabase
113
113
  || statement instanceof Statements.ModifyDatabase
114
114
  || statement instanceof Statements.DeleteDatabase) {
115
- if (statementNode.findFirstExpression(Expressions.Dynamic)) {
115
+ const dyn = statementNode.findFirstExpression(Expressions.Dynamic);
116
+ if (dyn && dyn.findDirectExpression(Expressions.Constant) === undefined) {
116
117
  return "Dynamic SQL";
117
118
  }
118
119
  }
@@ -19,7 +19,7 @@ class SlowParameterPassing {
19
19
  return {
20
20
  key: "slow_parameter_passing",
21
21
  title: "Slow Parameter Passing",
22
- shortDescription: `Detects show pass by value passing for methods where parameter is not changed`,
22
+ shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
23
23
  tags: [_irule_1.RuleTag.Performance],
24
24
  };
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.90.6",
3
+ "version": "2.90.7",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -45,12 +45,12 @@
45
45
  },
46
46
  "homepage": "https://abaplint.org",
47
47
  "devDependencies": {
48
- "@microsoft/api-extractor": "=7.23.2",
48
+ "@microsoft/api-extractor": "^7.24.1",
49
49
  "@types/chai": "^4.3.1",
50
50
  "@types/mocha": "^9.1.1",
51
- "@types/node": "^17.0.34",
51
+ "@types/node": "^17.0.35",
52
52
  "chai": "^4.3.6",
53
- "eslint": "^8.15.0",
53
+ "eslint": "^8.16.0",
54
54
  "mocha": "^10.0.0",
55
55
  "c8": "^7.11.3",
56
56
  "source-map-support": "^0.5.21",