@abaplint/transpiler 2.8.27 → 2.8.29

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.
@@ -64,7 +64,7 @@ class MethodSourceTranspiler {
64
64
  else if (call.endsWith(".") === false) {
65
65
  call += ".";
66
66
  }
67
- call += second.getFirstToken().getStr().replace(/\'/g, "").toLowerCase().replace("~", "$").trimEnd();
67
+ call += second.getFirstToken().getStr().replace(/[\'\`]/g, "").toLowerCase().replace("~", "$").trimEnd();
68
68
  }
69
69
  else {
70
70
  ret.appendString("MethodSourceTranspiler-Unexpected");
@@ -5,5 +5,6 @@ export declare class Keywords {
5
5
  private readonly keywords;
6
6
  constructor(keywords?: string[]);
7
7
  handle(reg: abaplint.IRegistry): void;
8
+ private handleMacro;
8
9
  private traverse;
9
10
  }
@@ -43,7 +43,12 @@ class Keywords {
43
43
  for (const f of o.getABAPFiles()) {
44
44
  const tokens = [];
45
45
  for (const s of f.getStatements()) {
46
- tokens.push(...this.traverse(s, f));
46
+ if (s.get() instanceof abaplint.MacroCall) {
47
+ tokens.push(...this.handleMacro(s));
48
+ }
49
+ else {
50
+ tokens.push(...this.traverse(s, f));
51
+ }
47
52
  }
48
53
  if (tokens.length === 0) {
49
54
  continue;
@@ -59,6 +64,20 @@ class Keywords {
59
64
  }
60
65
  reg.parse();
61
66
  }
67
+ handleMacro(node) {
68
+ const tokens = [];
69
+ for (const token of node.getTokens()) {
70
+ for (const k of this.keywords) {
71
+ const lower = token.getStr().toLowerCase();
72
+ if (k === lower
73
+ || "!" + k === lower
74
+ || lower.endsWith("~" + k)) {
75
+ tokens.push(token);
76
+ }
77
+ }
78
+ }
79
+ return tokens;
80
+ }
62
81
  traverse(node, file) {
63
82
  const ret = [];
64
83
  for (const c of node.getChildren()) {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findConnection = exports.InsertDatabaseTranspiler = void 0;
3
+ exports.InsertDatabaseTranspiler = void 0;
4
+ exports.findConnection = findConnection;
4
5
  const abaplint = require("@abaplint/core");
5
6
  const chunk_1 = require("../chunk");
6
7
  const expressions_1 = require("../expressions");
@@ -44,5 +45,4 @@ function findConnection(connection) {
44
45
  }
45
46
  return con;
46
47
  }
47
- exports.findConnection = findConnection;
48
48
  //# sourceMappingURL=insert_database.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.8.27",
3
+ "version": "2.8.29",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -29,15 +29,15 @@
29
29
  "author": "abaplint",
30
30
  "license": "MIT",
31
31
  "dependencies": {
32
- "@abaplint/core": "^2.109.3",
32
+ "@abaplint/core": "^2.110.6",
33
33
  "source-map": "^0.7.4"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/chai": "^4.3.16",
37
- "@types/mocha": "^10.0.6",
37
+ "@types/mocha": "^10.0.7",
38
38
  "chai": "^4.4.1",
39
- "mocha": "^10.4.0",
39
+ "mocha": "^10.6.0",
40
40
  "source-map-support": "^0.5.21",
41
- "typescript": "^5.4.5"
41
+ "typescript": "^5.5.3"
42
42
  }
43
43
  }