@abaplint/transpiler 2.1.61 → 2.1.63
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.
- package/README.md +2 -2
- package/build/src/handle_data_element.js +5 -5
- package/build/src/handle_table.js +4 -4
- package/build/src/handle_table_type.js +3 -3
- package/build/src/statements/call.js +20 -14
- package/build/src/statements/class_implementation.js +2 -2
- package/build/src/statements/do.js +4 -4
- package/build/src/statements/select.js +8 -8
- package/build/src/structures/class_definition.js +8 -8
- package/build/src/traversal.js +2 -9
- package/build/src/unit_test.js +68 -68
- package/package.json +42 -42
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# @abaplint/transpiler
|
|
2
|
-
|
|
1
|
+
# @abaplint/transpiler
|
|
2
|
+
|
|
3
3
|
Transpiler
|
|
@@ -18,11 +18,11 @@ class HandleDataElement {
|
|
|
18
18
|
fixedValues = doma.getFixedValues();
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
|
|
22
|
-
"objectType": "DTEL",
|
|
23
|
-
"type": ${new transpile_types_1.TranspileTypes().toType(type)},
|
|
24
|
-
"domain": ${JSON.stringify(obj.getDomainName())},
|
|
25
|
-
"fixedValues": ${JSON.stringify(fixedValues)},
|
|
21
|
+
const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
|
|
22
|
+
"objectType": "DTEL",
|
|
23
|
+
"type": ${new transpile_types_1.TranspileTypes().toType(type)},
|
|
24
|
+
"domain": ${JSON.stringify(obj.getDomainName())},
|
|
25
|
+
"fixedValues": ${JSON.stringify(fixedValues)},
|
|
26
26
|
};`);
|
|
27
27
|
const output = {
|
|
28
28
|
object: {
|
|
@@ -12,10 +12,10 @@ class HandleTable {
|
|
|
12
12
|
return [];
|
|
13
13
|
}
|
|
14
14
|
const type = obj.parseType(reg);
|
|
15
|
-
const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
|
|
16
|
-
"objectType": "TABL",
|
|
17
|
-
"type": ${new transpile_types_1.TranspileTypes().toType(type)},
|
|
18
|
-
"keyFields": ${JSON.stringify(obj.listKeys())},
|
|
15
|
+
const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
|
|
16
|
+
"objectType": "TABL",
|
|
17
|
+
"type": ${new transpile_types_1.TranspileTypes().toType(type)},
|
|
18
|
+
"keyFields": ${JSON.stringify(obj.listKeys())},
|
|
19
19
|
};`);
|
|
20
20
|
const output = {
|
|
21
21
|
object: {
|
|
@@ -11,9 +11,9 @@ class HandleTableType {
|
|
|
11
11
|
return [];
|
|
12
12
|
}
|
|
13
13
|
const type = obj.parseType(reg);
|
|
14
|
-
const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
|
|
15
|
-
"objectType": "TTYP",
|
|
16
|
-
"type": ${new transpile_types_1.TranspileTypes().toType(type)},
|
|
14
|
+
const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
|
|
15
|
+
"objectType": "TTYP",
|
|
16
|
+
"type": ${new transpile_types_1.TranspileTypes().toType(type)},
|
|
17
17
|
};`);
|
|
18
18
|
const output = {
|
|
19
19
|
object: {
|
|
@@ -7,10 +7,6 @@ const expressions_1 = require("../expressions");
|
|
|
7
7
|
class CallTranspiler {
|
|
8
8
|
transpile(node, traversal) {
|
|
9
9
|
var _a, _b, _c, _d;
|
|
10
|
-
if (node.concatTokens().toLowerCase().includes("super->constructor")) {
|
|
11
|
-
// todo, https://github.com/abaplint/transpiler/issues/133
|
|
12
|
-
return new chunk_1.Chunk("");
|
|
13
|
-
}
|
|
14
10
|
const chain = node.findDirectExpression(abaplint.Expressions.MethodCallChain);
|
|
15
11
|
if (chain) {
|
|
16
12
|
let pre = "";
|
|
@@ -26,9 +22,9 @@ class CallTranspiler {
|
|
|
26
22
|
}
|
|
27
23
|
post += ";";
|
|
28
24
|
if (exceptions) {
|
|
29
|
-
post += `\nabap.builtin.sy.get().subrc.set(0);
|
|
30
|
-
} catch (e) {
|
|
31
|
-
if (e.classic) {
|
|
25
|
+
post += `\nabap.builtin.sy.get().subrc.set(0);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
if (e.classic) {
|
|
32
28
|
switch (e.classic.toUpperCase()) {\n`;
|
|
33
29
|
for (const e of exceptions.findAllExpressions(abaplint.Expressions.ParameterException)) {
|
|
34
30
|
const name = e.getFirstToken().getStr().toUpperCase();
|
|
@@ -43,15 +39,21 @@ if (e.classic) {
|
|
|
43
39
|
post += `case "${name}": abap.builtin.sy.get().subrc.set(${value}); break;\n`;
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
|
-
post += ` }
|
|
47
|
-
} else {
|
|
48
|
-
throw e;
|
|
49
|
-
}
|
|
42
|
+
post += ` }
|
|
43
|
+
} else {
|
|
44
|
+
throw e;
|
|
45
|
+
}
|
|
50
46
|
}`;
|
|
51
47
|
}
|
|
48
|
+
const chainChunk = traversal.traverse(chain);
|
|
49
|
+
let chainCode = chainChunk.getCode();
|
|
50
|
+
if (chainCode.startsWith("await super.constructor(")) {
|
|
51
|
+
// semantics of constructors in JS vs ABAP is different, so the "constructor_" has been introduced,
|
|
52
|
+
chainCode = chainCode.replace("await super.constructor(", "await super.constructor_(");
|
|
53
|
+
}
|
|
52
54
|
return new chunk_1.Chunk()
|
|
53
55
|
.appendString(pre)
|
|
54
|
-
.
|
|
56
|
+
.appendString(chainCode)
|
|
55
57
|
.append(post, node.getLastToken(), traversal);
|
|
56
58
|
}
|
|
57
59
|
const methodSource = node.findDirectExpression(abaplint.Expressions.MethodSource);
|
|
@@ -69,8 +71,12 @@ if (e.classic) {
|
|
|
69
71
|
pre = target.getCode() + ".set(";
|
|
70
72
|
post = ")";
|
|
71
73
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
let ms = new expressions_1.MethodSourceTranspiler(pre).transpile(methodSource, traversal).getCode();
|
|
75
|
+
if (ms === "await super.get().constructor") {
|
|
76
|
+
// semantics of constructors in JS vs ABAP is different, so the "constructor_" has been introduced,
|
|
77
|
+
ms = "await super.constructor_";
|
|
78
|
+
}
|
|
79
|
+
return new chunk_1.Chunk().appendString(ms).appendString("(" + body + ")" + post + ";");
|
|
74
80
|
}
|
|
75
81
|
throw new Error("CallTranspiler, todo");
|
|
76
82
|
}
|
|
@@ -17,8 +17,8 @@ class ClassImplementationTranspiler {
|
|
|
17
17
|
else if (def === null || def === void 0 ? void 0 : def.getSuperClass()) {
|
|
18
18
|
ret += " extends " + ((_a = def === null || def === void 0 ? void 0 : def.getSuperClass()) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
19
19
|
}
|
|
20
|
-
return new chunk_1.Chunk().append(ret + ` {
|
|
21
|
-
static INTERNAL_TYPE = 'CLAS';
|
|
20
|
+
return new chunk_1.Chunk().append(ret + ` {
|
|
21
|
+
static INTERNAL_TYPE = 'CLAS';
|
|
22
22
|
static IMPLEMENTED_INTERFACES = [${def === null || def === void 0 ? void 0 : def.getImplementing().map(e => `"` + e.name.toUpperCase() + `"`).join(",")}];`, node, traversal);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -12,14 +12,14 @@ class DoTranspiler {
|
|
|
12
12
|
const source = new expressions_1.SourceTranspiler(true).transpile(found, traversal).getCode();
|
|
13
13
|
const idSource = unique_identifier_1.UniqueIdentifier.get();
|
|
14
14
|
const id = unique_identifier_1.UniqueIdentifier.get();
|
|
15
|
-
return new chunk_1.Chunk(`const ${idSource} = ${source};
|
|
16
|
-
for (let ${id} = 0; ${id} < ${idSource}; ${id}++) {
|
|
15
|
+
return new chunk_1.Chunk(`const ${idSource} = ${source};
|
|
16
|
+
for (let ${id} = 0; ${id} < ${idSource}; ${id}++) {
|
|
17
17
|
abap.builtin.sy.get().index.set(${id} + 1);`);
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
20
|
const unique = unique_identifier_1.UniqueIdentifier.get();
|
|
21
|
-
return new chunk_1.Chunk(`let ${unique} = 1;
|
|
22
|
-
while (true) {
|
|
21
|
+
return new chunk_1.Chunk(`let ${unique} = 1;
|
|
22
|
+
while (true) {
|
|
23
23
|
abap.builtin.sy.get().index.set(${unique}++);`);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -69,14 +69,14 @@ class SelectTranspiler {
|
|
|
69
69
|
const faeName = (_d = (_c = (_b = node.findFirstExpression(abaplint.Expressions.SQLForAllEntries)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(abaplint.Expressions.SQLSource)) === null || _c === void 0 ? void 0 : _c.concatTokens()) === null || _d === void 0 ? void 0 : _d.toLowerCase();
|
|
70
70
|
select = select.replace(new RegExp(" " + faeName, "g"), " " + unique);
|
|
71
71
|
select = select.replace(unique + ".get().table_line.get()", unique + ".get()"); // there can be only one?
|
|
72
|
-
const code = `if (${faeName}.array().length === 0) {
|
|
73
|
-
throw "FAE, todo, empty table";
|
|
74
|
-
} else {
|
|
75
|
-
abap.statements.clear(${target});
|
|
76
|
-
for await (const ${unique} of abap.statements.loop(${faeName})) {
|
|
77
|
-
await abap.statements.select(${target}, {select: "${select.trim()}"${extra}}, {appending: true});
|
|
78
|
-
}
|
|
79
|
-
abap.builtin.sy.get().dbcnt.set(${target}.array().length);
|
|
72
|
+
const code = `if (${faeName}.array().length === 0) {
|
|
73
|
+
throw "FAE, todo, empty table";
|
|
74
|
+
} else {
|
|
75
|
+
abap.statements.clear(${target});
|
|
76
|
+
for await (const ${unique} of abap.statements.loop(${faeName})) {
|
|
77
|
+
await abap.statements.select(${target}, {select: "${select.trim()}"${extra}}, {appending: true});
|
|
78
|
+
}
|
|
79
|
+
abap.builtin.sy.get().dbcnt.set(${target}.array().length);
|
|
80
80
|
}`;
|
|
81
81
|
return new chunk_1.Chunk().append(code, node, traversal);
|
|
82
82
|
}
|
|
@@ -20,14 +20,14 @@ class ClassDefinitionTranspiler {
|
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
22
|
// its an abstract class with only abstract methods
|
|
23
|
-
return new chunk_1.Chunk(`
|
|
24
|
-
class ${className === null || className === void 0 ? void 0 : className.toLowerCase()} {
|
|
25
|
-
static INTERNAL_TYPE = 'CLAS';
|
|
26
|
-
async constructor_() {
|
|
27
|
-
this.me = new abap.types.ABAPObject();
|
|
28
|
-
this.me.set(this);
|
|
29
|
-
return this;
|
|
30
|
-
}
|
|
23
|
+
return new chunk_1.Chunk(`
|
|
24
|
+
class ${className === null || className === void 0 ? void 0 : className.toLowerCase()} {
|
|
25
|
+
static INTERNAL_TYPE = 'CLAS';
|
|
26
|
+
async constructor_() {
|
|
27
|
+
this.me = new abap.types.ABAPObject();
|
|
28
|
+
this.me.set(this);
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
31
|
}`);
|
|
32
32
|
}
|
|
33
33
|
}
|
package/build/src/traversal.js
CHANGED
|
@@ -251,16 +251,9 @@ class Traversal {
|
|
|
251
251
|
return undefined;
|
|
252
252
|
}
|
|
253
253
|
buildConstructorContents(scope, def) {
|
|
254
|
-
/*
|
|
255
|
-
const vars = scope?.getData().vars;
|
|
256
|
-
if (vars === undefined || Object.keys(vars).length === 0) {
|
|
257
|
-
return "";
|
|
258
|
-
}
|
|
259
|
-
*/
|
|
260
254
|
let ret = "";
|
|
261
|
-
if (def.getSuperClass() !== undefined
|
|
262
|
-
|
|
263
|
-
// for now just pass the same input
|
|
255
|
+
if (def.getSuperClass() !== undefined
|
|
256
|
+
&& def.getMethodDefinitions().getByName("CONSTRUCTOR") === undefined) {
|
|
264
257
|
ret += `await super.constructor_(INPUT);\n`;
|
|
265
258
|
}
|
|
266
259
|
ret += "this.me = new abap.types.ABAPObject();\n";
|
package/build/src/unit_test.js
CHANGED
|
@@ -8,16 +8,16 @@ class UnitTest {
|
|
|
8
8
|
initializationScript(reg, dbSetup, extraSetup, useImport) {
|
|
9
9
|
let ret = "";
|
|
10
10
|
if (useImport === true) {
|
|
11
|
-
ret = `/* eslint-disable import/newline-after-import */
|
|
11
|
+
ret = `/* eslint-disable import/newline-after-import */
|
|
12
12
|
import "./_top.mjs";\n`;
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
|
-
ret = `/* eslint-disable import/newline-after-import */
|
|
16
|
-
import runtime from "@abaplint/runtime";
|
|
15
|
+
ret = `/* eslint-disable import/newline-after-import */
|
|
16
|
+
import runtime from "@abaplint/runtime";
|
|
17
17
|
globalThis.abap = new runtime.ABAP();\n`;
|
|
18
18
|
}
|
|
19
|
-
ret += `${this.buildImports(reg, useImport)}
|
|
20
|
-
|
|
19
|
+
ret += `${this.buildImports(reg, useImport)}
|
|
20
|
+
|
|
21
21
|
export async function initializeABAP() {\n`;
|
|
22
22
|
ret += ` const sqlite = [];\n`;
|
|
23
23
|
for (const i of dbSetup.schemas.sqlite) {
|
|
@@ -45,19 +45,19 @@ export async function initializeABAP() {\n`;
|
|
|
45
45
|
return filename.replace(/\//g, "%23");
|
|
46
46
|
}
|
|
47
47
|
unitTestScriptOpen(reg, _skip, _only) {
|
|
48
|
-
let ret = `/* eslint-disable curly */
|
|
49
|
-
import fs from "fs";
|
|
50
|
-
import path from "path";
|
|
51
|
-
import {fileURLToPath} from "url";
|
|
52
|
-
import {initializeABAP} from "./init.mjs";
|
|
53
|
-
|
|
54
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
55
|
-
|
|
56
|
-
async function run() {
|
|
57
|
-
await initializeABAP();
|
|
58
|
-
let lt_input = new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30})}), {"withHeader":false,"type":"STANDARD","isUnique":false,"keyFields":[]});
|
|
59
|
-
let ls_input = new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30})});
|
|
60
|
-
let ls_result = new abap.types.Structure({list: new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30}), expected: new abap.types.String(), actual: new abap.types.String(), status: new abap.types.String(), runtime: new abap.types.Integer(), message: new abap.types.String(), js_location: new abap.types.String()}), {"withHeader":false,"type":"STANDARD","isUnique":false,"keyFields":[]}), json: new abap.types.String()});
|
|
48
|
+
let ret = `/* eslint-disable curly */
|
|
49
|
+
import fs from "fs";
|
|
50
|
+
import path from "path";
|
|
51
|
+
import {fileURLToPath} from "url";
|
|
52
|
+
import {initializeABAP} from "./init.mjs";
|
|
53
|
+
|
|
54
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
55
|
+
|
|
56
|
+
async function run() {
|
|
57
|
+
await initializeABAP();
|
|
58
|
+
let lt_input = new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30})}), {"withHeader":false,"type":"STANDARD","isUnique":false,"keyFields":[]});
|
|
59
|
+
let ls_input = new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30})});
|
|
60
|
+
let ls_result = new abap.types.Structure({list: new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30}), expected: new abap.types.String(), actual: new abap.types.String(), status: new abap.types.String(), runtime: new abap.types.Integer(), message: new abap.types.String(), js_location: new abap.types.String()}), {"withHeader":false,"type":"STANDARD","isUnique":false,"keyFields":[]}), json: new abap.types.String()});
|
|
61
61
|
`;
|
|
62
62
|
for (const obj of reg.getObjects()) {
|
|
63
63
|
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
@@ -77,44 +77,44 @@ async function run() {
|
|
|
77
77
|
if (m.isForTesting === false) {
|
|
78
78
|
continue;
|
|
79
79
|
}
|
|
80
|
-
ret += ` ls_input.get().class_name.set("${obj.getName()}");
|
|
81
|
-
ls_input.get().testclass_name.set("${def.name.toUpperCase()}");
|
|
82
|
-
ls_input.get().method_name.set("${m.name.toUpperCase()}");
|
|
80
|
+
ret += ` ls_input.get().class_name.set("${obj.getName()}");
|
|
81
|
+
ls_input.get().testclass_name.set("${def.name.toUpperCase()}");
|
|
82
|
+
ls_input.get().method_name.set("${m.name.toUpperCase()}");
|
|
83
83
|
abap.statements.append({source: ls_input, target: lt_input});\n`;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
ret += `
|
|
89
|
-
|
|
90
|
-
ls_result.set(await abap.Classes["KERNEL_UNIT_RUNNER"].run({it_input: lt_input}));
|
|
91
|
-
fs.writeFileSync(__dirname + path.sep + "output.json", ls_result.get().json.get());
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
run().then(() => {
|
|
95
|
-
process.exit(0);
|
|
96
|
-
}).catch((err) => {
|
|
97
|
-
console.log(err);
|
|
98
|
-
process.exit(1);
|
|
88
|
+
ret += `
|
|
89
|
+
|
|
90
|
+
ls_result.set(await abap.Classes["KERNEL_UNIT_RUNNER"].run({it_input: lt_input}));
|
|
91
|
+
fs.writeFileSync(__dirname + path.sep + "output.json", ls_result.get().json.get());
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
run().then(() => {
|
|
95
|
+
process.exit(0);
|
|
96
|
+
}).catch((err) => {
|
|
97
|
+
console.log(err);
|
|
98
|
+
process.exit(1);
|
|
99
99
|
});`;
|
|
100
100
|
return ret;
|
|
101
101
|
}
|
|
102
102
|
unitTestScript(reg, skip, _only) {
|
|
103
|
-
let ret = `/* eslint-disable curly */
|
|
104
|
-
import fs from "fs";
|
|
105
|
-
import path from "path";
|
|
106
|
-
import {fileURLToPath} from "url";
|
|
107
|
-
import {initializeABAP} from "./init.mjs";
|
|
108
|
-
import runtime from "@abaplint/runtime";
|
|
109
|
-
|
|
110
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
111
|
-
|
|
112
|
-
async function run() {
|
|
113
|
-
await initializeABAP();
|
|
114
|
-
const unit = new runtime.UnitTestResult();
|
|
115
|
-
let clas;
|
|
116
|
-
let locl;
|
|
117
|
-
let meth;
|
|
103
|
+
let ret = `/* eslint-disable curly */
|
|
104
|
+
import fs from "fs";
|
|
105
|
+
import path from "path";
|
|
106
|
+
import {fileURLToPath} from "url";
|
|
107
|
+
import {initializeABAP} from "./init.mjs";
|
|
108
|
+
import runtime from "@abaplint/runtime";
|
|
109
|
+
|
|
110
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
111
|
+
|
|
112
|
+
async function run() {
|
|
113
|
+
await initializeABAP();
|
|
114
|
+
const unit = new runtime.UnitTestResult();
|
|
115
|
+
let clas;
|
|
116
|
+
let locl;
|
|
117
|
+
let meth;
|
|
118
118
|
try {\n`;
|
|
119
119
|
for (const obj of reg.getObjects()) {
|
|
120
120
|
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
@@ -128,9 +128,9 @@ async function run() {
|
|
|
128
128
|
// todo, fix, there might be global test methods
|
|
129
129
|
continue;
|
|
130
130
|
}
|
|
131
|
-
ret += ` {
|
|
132
|
-
const {${def.name}} = await import("./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs");
|
|
133
|
-
locl = clas.addTestClass("${def.name}");
|
|
131
|
+
ret += ` {
|
|
132
|
+
const {${def.name}} = await import("./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs");
|
|
133
|
+
locl = clas.addTestClass("${def.name}");
|
|
134
134
|
if (${def.name}.class_setup) await ${def.name}.class_setup();\n`;
|
|
135
135
|
for (const m of def.methods) {
|
|
136
136
|
if (m.isForTesting === false) {
|
|
@@ -157,24 +157,24 @@ async function run() {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
ret += `// -------------------END-------------------
|
|
161
|
-
console.log(abap.console.get());
|
|
162
|
-
fs.writeFileSync(__dirname + path.sep + "_output.xml", unit.xUnitXML());
|
|
163
|
-
} catch (e) {
|
|
164
|
-
if (meth) {
|
|
165
|
-
meth.fail();
|
|
166
|
-
}
|
|
167
|
-
console.log(abap.console.get());
|
|
168
|
-
fs.writeFileSync(__dirname + path.sep + "_output.xml", unit.xUnitXML());
|
|
169
|
-
throw e;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
run().then(() => {
|
|
174
|
-
process.exit(0);
|
|
175
|
-
}).catch((err) => {
|
|
176
|
-
console.log(err);
|
|
177
|
-
process.exit(1);
|
|
160
|
+
ret += `// -------------------END-------------------
|
|
161
|
+
console.log(abap.console.get());
|
|
162
|
+
fs.writeFileSync(__dirname + path.sep + "_output.xml", unit.xUnitXML());
|
|
163
|
+
} catch (e) {
|
|
164
|
+
if (meth) {
|
|
165
|
+
meth.fail();
|
|
166
|
+
}
|
|
167
|
+
console.log(abap.console.get());
|
|
168
|
+
fs.writeFileSync(__dirname + path.sep + "_output.xml", unit.xUnitXML());
|
|
169
|
+
throw e;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
run().then(() => {
|
|
174
|
+
process.exit(0);
|
|
175
|
+
}).catch((err) => {
|
|
176
|
+
console.log(err);
|
|
177
|
+
process.exit(1);
|
|
178
178
|
});`;
|
|
179
179
|
return ret;
|
|
180
180
|
}
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"description": "Transpiler",
|
|
5
|
-
"main": "build/src/index.js",
|
|
6
|
-
"typings": "build/src/index.d.ts",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/abaplint/transpiler.git"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"compile": "tsc",
|
|
13
|
-
"publish:major": "npm --no-git-tag-version version major && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
14
|
-
"publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
15
|
-
"publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
16
|
-
"test": "npm run compile && mocha"
|
|
17
|
-
},
|
|
18
|
-
"mocha": {
|
|
19
|
-
"recursive": true,
|
|
20
|
-
"reporter": "progress",
|
|
21
|
-
"spec": "build/test/**/*.js",
|
|
22
|
-
"require": "source-map-support/register"
|
|
23
|
-
},
|
|
24
|
-
"keywords": [
|
|
25
|
-
"ABAP",
|
|
26
|
-
"abaplint"
|
|
27
|
-
],
|
|
28
|
-
"author": "abaplint",
|
|
29
|
-
"license": "MIT",
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@abaplint/core": "^2.93.
|
|
32
|
-
"source-map": "^0.7.4"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"@types/chai": "^4.3.3",
|
|
36
|
-
"@types/mocha": "^9.1.1",
|
|
37
|
-
"chai": "^4.3.6",
|
|
38
|
-
"mocha": "^10.0.0",
|
|
39
|
-
"source-map-support": "^0.5.21",
|
|
40
|
-
"typescript": "^4.8.3"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@abaplint/transpiler",
|
|
3
|
+
"version": "2.1.63",
|
|
4
|
+
"description": "Transpiler",
|
|
5
|
+
"main": "build/src/index.js",
|
|
6
|
+
"typings": "build/src/index.d.ts",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/abaplint/transpiler.git"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"compile": "tsc",
|
|
13
|
+
"publish:major": "npm --no-git-tag-version version major && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
14
|
+
"publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
15
|
+
"publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
16
|
+
"test": "npm run compile && mocha"
|
|
17
|
+
},
|
|
18
|
+
"mocha": {
|
|
19
|
+
"recursive": true,
|
|
20
|
+
"reporter": "progress",
|
|
21
|
+
"spec": "build/test/**/*.js",
|
|
22
|
+
"require": "source-map-support/register"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"ABAP",
|
|
26
|
+
"abaplint"
|
|
27
|
+
],
|
|
28
|
+
"author": "abaplint",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@abaplint/core": "^2.93.14",
|
|
32
|
+
"source-map": "^0.7.4"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/chai": "^4.3.3",
|
|
36
|
+
"@types/mocha": "^9.1.1",
|
|
37
|
+
"chai": "^4.3.6",
|
|
38
|
+
"mocha": "^10.0.0",
|
|
39
|
+
"source-map-support": "^0.5.21",
|
|
40
|
+
"typescript": "^4.8.3"
|
|
41
|
+
}
|
|
42
|
+
}
|