@abaplint/core 2.97.3 → 2.97.4

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.
@@ -7,7 +7,7 @@ const version_1 = require("../../../version");
7
7
  class CallFunction {
8
8
  getMatcher() {
9
9
  const starting = (0, combi_1.seq)("STARTING NEW TASK", expressions_1.SimpleSource2);
10
- const update = (0, combi_1.str)("IN UPDATE TASK");
10
+ const update = (0, combi_1.verNot)(version_1.Version.Cloud, (0, combi_1.str)("IN UPDATE TASK"));
11
11
  const unit = (0, combi_1.seq)("UNIT", expressions_1.Source);
12
12
  const background = (0, combi_1.verNot)(version_1.Version.Cloud, (0, combi_1.seq)("IN BACKGROUND", (0, combi_1.altPrio)("TASK", unit)));
13
13
  const calling = (0, combi_1.seq)("CALLING", expressions_1.MethodName, "ON END OF TASK");
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.97.3";
66
+ return "2.97.4";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -51,7 +51,7 @@ class SQLEscapeHostVariables extends _abap_rule_1.ABAPRule {
51
51
  || s.get() instanceof Statements.SelectLoop
52
52
  || s.get() instanceof Statements.InsertDatabase
53
53
  || s.get() instanceof Statements.DeleteDatabase) {
54
- for (const o of s.findAllExpressions(Expressions.SQLSource)) {
54
+ for (const o of s.findAllExpressionsMulti([Expressions.SQLSource, Expressions.SQLSourceSimple])) {
55
55
  const first = o.getFirstChild();
56
56
  if (((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.Source && first.getChildren()[0].get() instanceof Expressions.FieldChain)
57
57
  || ((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.SimpleSource3 && first.getChildren()[0].get() instanceof Expressions.FieldChain)) {
@@ -53,6 +53,7 @@ Activates from v750 and up`,
53
53
  || s.get() instanceof Statements.SelectLoop) {
54
54
  const expr = s.findDirectExpression(Expressions.Select);
55
55
  const where = expr === null || expr === void 0 ? void 0 : expr.findDirectExpression(Expressions.SQLCond);
56
+ const order = expr === null || expr === void 0 ? void 0 : expr.findDirectExpression(Expressions.SQLOrderBy);
56
57
  const into = (expr === null || expr === void 0 ? void 0 : expr.findDirectExpression(Expressions.SQLIntoStructure))
57
58
  || (expr === null || expr === void 0 ? void 0 : expr.findDirectExpression(Expressions.SQLIntoTable));
58
59
  if (into === undefined || where === undefined) {
@@ -62,8 +63,11 @@ Activates from v750 and up`,
62
63
  continue;
63
64
  }
64
65
  const fix1 = edit_helper_1.EditHelper.deleteRange(file, into.getFirstToken().getStart(), into.getLastToken().getEnd());
65
- const whereLast = where.getLastToken();
66
- const fix2 = edit_helper_1.EditHelper.insertAt(file, whereLast.getEnd(), " " + into.concatTokens());
66
+ let last = where.getLastToken();
67
+ if (order && order.getLastToken().getEnd().isAfter(last.getEnd())) {
68
+ last = order.getLastToken();
69
+ }
70
+ const fix2 = edit_helper_1.EditHelper.insertAt(file, last.getEnd(), " " + into.concatTokens());
67
71
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
68
72
  const message = "INTO/APPENDING must be last in strict SQL";
69
73
  const issue = issue_1.Issue.atToken(file, s.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.97.3",
3
+ "version": "2.97.4",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",