@abaplint/transpiler 2.1.84 → 2.1.85
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TargetTranspiler = void 0;
|
|
4
4
|
const core_1 = require("@abaplint/core");
|
|
5
|
+
const traversal_1 = require("../traversal");
|
|
5
6
|
const _1 = require(".");
|
|
6
7
|
const chunk_1 = require("../chunk");
|
|
7
8
|
class TargetTranspiler {
|
|
@@ -22,9 +23,9 @@ class TargetTranspiler {
|
|
|
22
23
|
}
|
|
23
24
|
else if (c.get() instanceof core_1.Expressions.AttributeName) {
|
|
24
25
|
const intf = traversal.isInterfaceAttribute(c.getFirstToken());
|
|
25
|
-
let name = c.getFirstToken().getStr().replace("~", "$").toLowerCase();
|
|
26
|
+
let name = traversal_1.Traversal.escapeClassName(c.getFirstToken().getStr()).replace("~", "$").toLowerCase();
|
|
26
27
|
if (intf && name.startsWith(intf) === false) {
|
|
27
|
-
name = intf + "$" + name;
|
|
28
|
+
name = traversal_1.Traversal.escapeClassName(intf) + "$" + name;
|
|
28
29
|
}
|
|
29
30
|
ret.append(name, c, traversal);
|
|
30
31
|
}
|
package/build/src/requires.js
CHANGED
|
@@ -8,7 +8,7 @@ class Requires {
|
|
|
8
8
|
}
|
|
9
9
|
// todo, refactor this method
|
|
10
10
|
find(obj, _node, filename) {
|
|
11
|
-
var _a, _b, _c, _d, _e, _f;
|
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
12
12
|
const ret = [];
|
|
13
13
|
if (obj.getType() === "INTF") {
|
|
14
14
|
return [];
|
|
@@ -28,18 +28,18 @@ class Requires {
|
|
|
28
28
|
if (obj.getType() === "CLAS") {
|
|
29
29
|
// add the superclass
|
|
30
30
|
const clas = obj;
|
|
31
|
-
const sup = (_b = (_a = clas.getDefinition()) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toLowerCase().replace(/\//g, "
|
|
31
|
+
const sup = (_b = (_a = clas.getDefinition()) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toLowerCase().replace(/\//g, "#");
|
|
32
32
|
if (sup) {
|
|
33
|
-
add({ filename: sup + ".clas.abap", name:
|
|
33
|
+
add({ filename: sup + ".clas.abap", name: (_d = (_c = clas.getDefinition()) === null || _c === void 0 ? void 0 : _c.getSuperClass()) === null || _d === void 0 ? void 0 : _d.toLowerCase() });
|
|
34
34
|
}
|
|
35
35
|
for (const f of clas.getSequencedFiles()) {
|
|
36
36
|
if (filename.endsWith(".testclasses.abap")) {
|
|
37
37
|
// add the global class, in case its inherited by a local testclass
|
|
38
|
-
add({ filename: ((
|
|
38
|
+
add({ filename: ((_e = clas.getMainABAPFile()) === null || _e === void 0 ? void 0 : _e.getFilename()) || "", name: obj.getName().toLowerCase() });
|
|
39
39
|
}
|
|
40
40
|
if (f.getFilename() === filename
|
|
41
41
|
|| f.getFilename().endsWith(".clas.testclasses.abap")
|
|
42
|
-
|| f.getFilename() === ((
|
|
42
|
+
|| f.getFilename() === ((_f = clas.getMainABAPFile()) === null || _f === void 0 ? void 0 : _f.getFilename())) {
|
|
43
43
|
continue;
|
|
44
44
|
}
|
|
45
45
|
let foo = f.getFilename();
|
|
@@ -77,7 +77,7 @@ class Requires {
|
|
|
77
77
|
if (obj.getType() !== "INTF") {
|
|
78
78
|
const cx = this.reg.getObject("CLAS", "CX_ROOT");
|
|
79
79
|
if (cx && cx instanceof abaplint.ABAPObject) {
|
|
80
|
-
const main = (
|
|
80
|
+
const main = (_g = cx.getMainABAPFile()) === null || _g === void 0 ? void 0 : _g.getFilename();
|
|
81
81
|
if (main) {
|
|
82
82
|
add({
|
|
83
83
|
filename: main,
|
|
@@ -93,7 +93,7 @@ class Requires {
|
|
|
93
93
|
}
|
|
94
94
|
const found = this.reg.getObject("CLAS", c.superClassName);
|
|
95
95
|
if (found && found instanceof abaplint.ABAPObject) {
|
|
96
|
-
const main = (
|
|
96
|
+
const main = (_h = found.getMainABAPFile()) === null || _h === void 0 ? void 0 : _h.getFilename();
|
|
97
97
|
if (main) {
|
|
98
98
|
add({
|
|
99
99
|
filename: main,
|
|
@@ -15,7 +15,7 @@ class ClassImplementationTranspiler {
|
|
|
15
15
|
ret += " extends Error";
|
|
16
16
|
}
|
|
17
17
|
else if (def === null || def === void 0 ? void 0 : def.getSuperClass()) {
|
|
18
|
-
ret += " extends " + ((_a = def === null || def === void 0 ? void 0 : def.getSuperClass()) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
18
|
+
ret += " extends " + traversal_1.Traversal.escapeClassName((_a = def === null || def === void 0 ? void 0 : def.getSuperClass()) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
19
19
|
}
|
|
20
20
|
return new chunk_1.Chunk().append(ret + ` {
|
|
21
21
|
static INTERNAL_TYPE = 'CLAS';
|