@abaplint/transpiler 2.11.33 → 2.11.35
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.
|
@@ -3,5 +3,6 @@ import { IOutputFile, ITranspilerOptions } from "../types";
|
|
|
3
3
|
export declare class HandleFUGR {
|
|
4
4
|
private readonly options;
|
|
5
5
|
constructor(options?: ITranspilerOptions);
|
|
6
|
+
static shouldSkip(obj: abaplint.ABAPObject, reg: abaplint.IRegistry): any;
|
|
6
7
|
runObject(obj: abaplint.ABAPObject, reg: abaplint.IRegistry): IOutputFile[];
|
|
7
8
|
}
|
|
@@ -10,12 +10,15 @@ class HandleFUGR {
|
|
|
10
10
|
constructor(options) {
|
|
11
11
|
this.options = options;
|
|
12
12
|
}
|
|
13
|
+
static shouldSkip(obj, reg) {
|
|
14
|
+
// @ts-ignore todo
|
|
15
|
+
return new abaplint.SkipLogic(reg).isGeneratedFunctionGroup(obj);
|
|
16
|
+
}
|
|
13
17
|
// function groups are compiled into a single file, with one closure for the function groups top variables
|
|
14
18
|
runObject(obj, reg) {
|
|
15
19
|
const spaghetti = new abaplint.SyntaxLogic(reg, obj).run().spaghetti;
|
|
16
20
|
const chunk = new chunk_1.Chunk().appendString("{\n");
|
|
17
|
-
|
|
18
|
-
if (new abaplint.SkipLogic(reg).isGeneratedFunctionGroup(obj)) {
|
|
21
|
+
if (HandleFUGR.shouldSkip(obj, reg)) {
|
|
19
22
|
return [];
|
|
20
23
|
}
|
|
21
24
|
for (const file of obj.getSequencedFiles()) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Initialization = void 0;
|
|
4
4
|
exports.escapeNamespaceFilename = escapeNamespaceFilename;
|
|
5
5
|
const abaplint = require("@abaplint/core");
|
|
6
|
+
const handle_fugr_1 = require("./handlers/handle_fugr");
|
|
6
7
|
function escapeNamespaceFilename(filename) {
|
|
7
8
|
// ES modules are resolved and cached as URLs. This means that special characters must be
|
|
8
9
|
// percent-encoded, such as # with %23 and ? with %3F.
|
|
@@ -90,6 +91,9 @@ export async function initializeABAP() {\n`;
|
|
|
90
91
|
else if (obj instanceof abaplint.Objects.Program && obj.isInclude() === true) {
|
|
91
92
|
continue;
|
|
92
93
|
}
|
|
94
|
+
else if (obj instanceof abaplint.Objects.FunctionGroup && handle_fugr_1.HandleFUGR.shouldSkip(obj, reg) === true) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
93
97
|
else if (obj instanceof abaplint.Objects.Interface
|
|
94
98
|
|| obj instanceof abaplint.Objects.FunctionGroup
|
|
95
99
|
|| (options?.importProg === true && obj instanceof abaplint.Objects.Program)
|
|
@@ -12,7 +12,7 @@ class SetHandlerTranspiler {
|
|
|
12
12
|
for (const m of node.findDirectExpressions(abaplint.Expressions.MethodSource)) {
|
|
13
13
|
methods.push(new expressions_1.MethodSourceTranspiler().transpile(m, traversal).getCode().replace("await ", "") + ".bind(this)");
|
|
14
14
|
if (eventClass === undefined) {
|
|
15
|
-
const nameToken = m.
|
|
15
|
+
const nameToken = m.getLastToken();
|
|
16
16
|
const scope = traversal.findCurrentScopeByToken(nameToken);
|
|
17
17
|
const method = traversal.findMethodReference(nameToken, scope);
|
|
18
18
|
if (method?.def.isEventHandler() !== true) {
|