@abaplint/transpiler 2.0.32 → 2.0.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.
- 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/requires.js +19 -1
- package/build/src/statements/data.d.ts +1 -0
- package/build/src/statements/data.js +13 -9
- package/build/src/statements/do.js +4 -4
- package/build/src/statements/field_symbol.js +14 -1
- package/build/src/structures/data.js +8 -0
- 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: {
|
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;
|
|
11
|
+
var _a, _b, _c, _d, _e, _f;
|
|
12
12
|
const ret = [];
|
|
13
13
|
if (obj.getType() === "INTF") {
|
|
14
14
|
return [];
|
|
@@ -85,6 +85,24 @@ class Requires {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
+
// include global super classes for local class definitions
|
|
89
|
+
for (const f of obj.getSequencedFiles()) {
|
|
90
|
+
for (const c of f.getInfo().listClassDefinitions()) {
|
|
91
|
+
if (c.superClassName === undefined) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const found = this.reg.getObject("CLAS", c.superClassName);
|
|
95
|
+
if (found && found instanceof abaplint.ABAPObject) {
|
|
96
|
+
const main = (_f = found.getMainABAPFile()) === null || _f === void 0 ? void 0 : _f.getFilename();
|
|
97
|
+
if (main) {
|
|
98
|
+
add({
|
|
99
|
+
filename: main,
|
|
100
|
+
name: found.getName().toLowerCase(),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
88
106
|
}
|
|
89
107
|
return ret;
|
|
90
108
|
}
|
|
@@ -4,4 +4,5 @@ import { Traversal } from "../traversal";
|
|
|
4
4
|
import { Chunk } from "../chunk";
|
|
5
5
|
export declare class DataTranspiler implements IStatementTranspiler {
|
|
6
6
|
transpile(node: abaplint.Nodes.StatementNode, traversal: Traversal): Chunk;
|
|
7
|
+
static buildValue(node: abaplint.Nodes.StatementNode, name: string, traversal: Traversal): string;
|
|
7
8
|
}
|
|
@@ -21,6 +21,16 @@ class DataTranspiler {
|
|
|
21
21
|
if (found === undefined) {
|
|
22
22
|
throw new Error("DataTranspiler, var not found, \"" + token.getStr() + "\"");
|
|
23
23
|
}
|
|
24
|
+
const value = DataTranspiler.buildValue(node, found.getName().toLowerCase(), traversal);
|
|
25
|
+
const ret = new chunk_1.Chunk()
|
|
26
|
+
.appendString("let ")
|
|
27
|
+
.append(found.getName().toLowerCase(), token, traversal)
|
|
28
|
+
.appendString(" = " + new transpile_types_1.TranspileTypes().toType(found.getType()))
|
|
29
|
+
.append(";", node.getLastToken(), traversal)
|
|
30
|
+
.append(value, node.getLastToken(), traversal);
|
|
31
|
+
return ret;
|
|
32
|
+
}
|
|
33
|
+
static buildValue(node, name, traversal) {
|
|
24
34
|
let value = "";
|
|
25
35
|
const val = node.findFirstExpression(abaplint.Expressions.Value);
|
|
26
36
|
if (val) {
|
|
@@ -30,20 +40,14 @@ class DataTranspiler {
|
|
|
30
40
|
}
|
|
31
41
|
if (int) {
|
|
32
42
|
const escaped = new constant_1.ConstantTranspiler().escape(int.concatTokens());
|
|
33
|
-
value = "\n" +
|
|
43
|
+
value = "\n" + name + ".set(" + escaped + ");";
|
|
34
44
|
}
|
|
35
45
|
else if (val.getChildren()[1].get() instanceof abaplint.Expressions.SimpleFieldChain) {
|
|
36
46
|
const s = new expressions_1.FieldChainTranspiler().transpile(val.getChildren()[1], traversal).getCode();
|
|
37
|
-
value = "\n" +
|
|
47
|
+
value = "\n" + name + ".set(" + s + ");";
|
|
38
48
|
}
|
|
39
49
|
}
|
|
40
|
-
|
|
41
|
-
.appendString("let ")
|
|
42
|
-
.append(found.getName().toLowerCase(), token, traversal)
|
|
43
|
-
.appendString(" = " + new transpile_types_1.TranspileTypes().toType(found.getType()))
|
|
44
|
-
.append(";", node.getLastToken(), traversal)
|
|
45
|
-
.append(value, node.getLastToken(), traversal);
|
|
46
|
-
return ret;
|
|
50
|
+
return value;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
exports.DataTranspiler = DataTranspiler;
|
|
@@ -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
|
}
|
|
@@ -4,14 +4,27 @@ exports.FieldSymbolTranspiler = void 0;
|
|
|
4
4
|
const abaplint = require("@abaplint/core");
|
|
5
5
|
const field_symbol_1 = require("../expressions/field_symbol");
|
|
6
6
|
const chunk_1 = require("../chunk");
|
|
7
|
+
const transpile_types_1 = require("../transpile_types");
|
|
7
8
|
class FieldSymbolTranspiler {
|
|
8
9
|
transpile(node, traversal) {
|
|
9
10
|
const name = node.findDirectExpression(abaplint.Expressions.FieldSymbol);
|
|
11
|
+
const token = name === null || name === void 0 ? void 0 : name.getFirstToken();
|
|
12
|
+
if (token === undefined) {
|
|
13
|
+
throw new Error("FieldSymbolTranspiler, token not found");
|
|
14
|
+
}
|
|
15
|
+
const scope = traversal.findCurrentScopeByToken(token);
|
|
16
|
+
if (scope === undefined) {
|
|
17
|
+
throw new Error("FieldSymbolTranspiler, scope not found");
|
|
18
|
+
}
|
|
19
|
+
const found = scope.findVariable(token.getStr());
|
|
20
|
+
if (found === undefined) {
|
|
21
|
+
throw new Error("FieldSymbolTranspiler, var not found, \"" + token.getStr() + "\"");
|
|
22
|
+
}
|
|
10
23
|
if (name) {
|
|
11
24
|
return new chunk_1.Chunk()
|
|
12
25
|
.append("let ", node, traversal)
|
|
13
26
|
.appendChunk(new field_symbol_1.FieldSymbolTranspiler().transpile(name, traversal))
|
|
14
|
-
.append(" = new abap.types.FieldSymbol();", node.getLastToken(), traversal);
|
|
27
|
+
.append(" = new abap.types.FieldSymbol(" + new transpile_types_1.TranspileTypes().toType(found.getType()) + ");", node.getLastToken(), traversal);
|
|
15
28
|
}
|
|
16
29
|
throw new Error("FieldSymbolTranspiler, name not found");
|
|
17
30
|
}
|
|
@@ -6,11 +6,19 @@ const statements_1 = require("../statements");
|
|
|
6
6
|
const chunk_1 = require("../chunk");
|
|
7
7
|
class DataTranspiler {
|
|
8
8
|
transpile(node, traversal) {
|
|
9
|
+
var _a, _b;
|
|
9
10
|
const begin = node.findDirectStatement(abaplint.Statements.DataBegin);
|
|
10
11
|
if (begin === undefined) {
|
|
11
12
|
return new chunk_1.Chunk("");
|
|
12
13
|
}
|
|
14
|
+
const topName = (_a = begin.findDirectExpression(abaplint.Expressions.DefinitionName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toLowerCase();
|
|
13
15
|
const chunk = new statements_1.DataTranspiler().transpile(begin, traversal);
|
|
16
|
+
for (const d of node.findDirectStatements(abaplint.Statements.Data)) {
|
|
17
|
+
const subName = (_b = d.findFirstExpression(abaplint.Expressions.DefinitionName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toLowerCase();
|
|
18
|
+
if (subName && topName) {
|
|
19
|
+
chunk.appendString(statements_1.DataTranspiler.buildValue(d, topName + ".get()." + subName, traversal));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
14
22
|
chunk.appendString("\n");
|
|
15
23
|
return chunk;
|
|
16
24
|
}
|
package/build/src/unit_test.js
CHANGED
|
@@ -6,11 +6,11 @@ const abaplint = require("@abaplint/core");
|
|
|
6
6
|
class UnitTest {
|
|
7
7
|
// todo, move this method somewhere else, its much more than just unit test relevant
|
|
8
8
|
initializationScript(reg, dbSetup, extraSetup) {
|
|
9
|
-
let ret = `/* eslint-disable import/newline-after-import */
|
|
10
|
-
import runtime from "@abaplint/runtime";
|
|
11
|
-
global.abap = new runtime.ABAP();
|
|
12
|
-
${this.buildImports(reg)}
|
|
13
|
-
|
|
9
|
+
let ret = `/* eslint-disable import/newline-after-import */
|
|
10
|
+
import runtime from "@abaplint/runtime";
|
|
11
|
+
global.abap = new runtime.ABAP();
|
|
12
|
+
${this.buildImports(reg)}
|
|
13
|
+
|
|
14
14
|
export async function initializeABAP() {\n`;
|
|
15
15
|
ret += ` const sqlite = \`${dbSetup.schemas.sqlite}\`;\n`;
|
|
16
16
|
ret += ` const hdb = \`${dbSetup.schemas.hdb}\`;\n`;
|
|
@@ -32,19 +32,19 @@ export async function initializeABAP() {\n`;
|
|
|
32
32
|
return filename.replace(/\//g, "%23");
|
|
33
33
|
}
|
|
34
34
|
unitTestScriptOpen(reg, _skip, _only) {
|
|
35
|
-
let ret = `/* eslint-disable curly */
|
|
36
|
-
import fs from "fs";
|
|
37
|
-
import path from "path";
|
|
38
|
-
import {fileURLToPath} from "url";
|
|
39
|
-
import {initializeABAP} from "./init.mjs";
|
|
40
|
-
|
|
41
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
42
|
-
|
|
43
|
-
async function run() {
|
|
44
|
-
await initializeABAP();
|
|
45
|
-
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":[]});
|
|
46
|
-
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})});
|
|
47
|
-
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()});
|
|
35
|
+
let ret = `/* eslint-disable curly */
|
|
36
|
+
import fs from "fs";
|
|
37
|
+
import path from "path";
|
|
38
|
+
import {fileURLToPath} from "url";
|
|
39
|
+
import {initializeABAP} from "./init.mjs";
|
|
40
|
+
|
|
41
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
42
|
+
|
|
43
|
+
async function run() {
|
|
44
|
+
await initializeABAP();
|
|
45
|
+
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":[]});
|
|
46
|
+
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})});
|
|
47
|
+
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
48
|
`;
|
|
49
49
|
for (const obj of reg.getObjects()) {
|
|
50
50
|
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
@@ -64,44 +64,44 @@ async function run() {
|
|
|
64
64
|
if (m.isForTesting === false) {
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
|
-
ret += ` ls_input.get().class_name.set("${obj.getName()}");
|
|
68
|
-
ls_input.get().testclass_name.set("${def.name.toUpperCase()}");
|
|
69
|
-
ls_input.get().method_name.set("${m.name.toUpperCase()}");
|
|
67
|
+
ret += ` ls_input.get().class_name.set("${obj.getName()}");
|
|
68
|
+
ls_input.get().testclass_name.set("${def.name.toUpperCase()}");
|
|
69
|
+
ls_input.get().method_name.set("${m.name.toUpperCase()}");
|
|
70
70
|
abap.statements.append({source: ls_input, target: lt_input});`;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
ret += `
|
|
76
|
-
|
|
77
|
-
ls_result.set(await abap.Classes["KERNEL_UNIT_RUNNER"].run({it_input: lt_input}));
|
|
78
|
-
fs.writeFileSync(__dirname + path.sep + "output.json", ls_result.get().json.get());
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
run().then(() => {
|
|
82
|
-
process.exit(0);
|
|
83
|
-
}).catch((err) => {
|
|
84
|
-
console.log(err);
|
|
85
|
-
process.exit(1);
|
|
75
|
+
ret += `
|
|
76
|
+
|
|
77
|
+
ls_result.set(await abap.Classes["KERNEL_UNIT_RUNNER"].run({it_input: lt_input}));
|
|
78
|
+
fs.writeFileSync(__dirname + path.sep + "output.json", ls_result.get().json.get());
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
run().then(() => {
|
|
82
|
+
process.exit(0);
|
|
83
|
+
}).catch((err) => {
|
|
84
|
+
console.log(err);
|
|
85
|
+
process.exit(1);
|
|
86
86
|
});`;
|
|
87
87
|
return ret;
|
|
88
88
|
}
|
|
89
89
|
unitTestScript(reg, skip, _only) {
|
|
90
|
-
let ret = `/* eslint-disable curly */
|
|
91
|
-
import fs from "fs";
|
|
92
|
-
import path from "path";
|
|
93
|
-
import {fileURLToPath} from "url";
|
|
94
|
-
import {initializeABAP} from "./init.mjs";
|
|
95
|
-
import runtime from "@abaplint/runtime";
|
|
96
|
-
|
|
97
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
98
|
-
|
|
99
|
-
async function run() {
|
|
100
|
-
await initializeABAP();
|
|
101
|
-
const unit = new runtime.UnitTestResult();
|
|
102
|
-
let clas;
|
|
103
|
-
let locl;
|
|
104
|
-
let meth;
|
|
90
|
+
let ret = `/* eslint-disable curly */
|
|
91
|
+
import fs from "fs";
|
|
92
|
+
import path from "path";
|
|
93
|
+
import {fileURLToPath} from "url";
|
|
94
|
+
import {initializeABAP} from "./init.mjs";
|
|
95
|
+
import runtime from "@abaplint/runtime";
|
|
96
|
+
|
|
97
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
98
|
+
|
|
99
|
+
async function run() {
|
|
100
|
+
await initializeABAP();
|
|
101
|
+
const unit = new runtime.UnitTestResult();
|
|
102
|
+
let clas;
|
|
103
|
+
let locl;
|
|
104
|
+
let meth;
|
|
105
105
|
try {\n`;
|
|
106
106
|
for (const obj of reg.getObjects()) {
|
|
107
107
|
if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
|
|
@@ -115,9 +115,9 @@ async function run() {
|
|
|
115
115
|
// todo, fix, there might be global test methods
|
|
116
116
|
continue;
|
|
117
117
|
}
|
|
118
|
-
ret += ` {
|
|
119
|
-
const {${def.name}} = await import("./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs");
|
|
120
|
-
locl = clas.addTestClass("${def.name}");
|
|
118
|
+
ret += ` {
|
|
119
|
+
const {${def.name}} = await import("./${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}.testclasses.mjs");
|
|
120
|
+
locl = clas.addTestClass("${def.name}");
|
|
121
121
|
if (${def.name}.class_setup) await ${def.name}.class_setup();\n`;
|
|
122
122
|
for (const m of def.methods) {
|
|
123
123
|
if (m.isForTesting === false) {
|
|
@@ -144,24 +144,24 @@ async function run() {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
ret += `// -------------------END-------------------
|
|
148
|
-
console.log(abap.console.get());
|
|
149
|
-
fs.writeFileSync(__dirname + path.sep + "output.xml", unit.xUnitXML());
|
|
150
|
-
} catch (e) {
|
|
151
|
-
if (meth) {
|
|
152
|
-
meth.fail();
|
|
153
|
-
}
|
|
154
|
-
console.log(abap.console.get());
|
|
155
|
-
fs.writeFileSync(__dirname + path.sep + "output.xml", unit.xUnitXML());
|
|
156
|
-
throw e;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
run().then(() => {
|
|
161
|
-
process.exit(0);
|
|
162
|
-
}).catch((err) => {
|
|
163
|
-
console.log(err);
|
|
164
|
-
process.exit(1);
|
|
147
|
+
ret += `// -------------------END-------------------
|
|
148
|
+
console.log(abap.console.get());
|
|
149
|
+
fs.writeFileSync(__dirname + path.sep + "output.xml", unit.xUnitXML());
|
|
150
|
+
} catch (e) {
|
|
151
|
+
if (meth) {
|
|
152
|
+
meth.fail();
|
|
153
|
+
}
|
|
154
|
+
console.log(abap.console.get());
|
|
155
|
+
fs.writeFileSync(__dirname + path.sep + "output.xml", unit.xUnitXML());
|
|
156
|
+
throw e;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
run().then(() => {
|
|
161
|
+
process.exit(0);
|
|
162
|
+
}).catch((err) => {
|
|
163
|
+
console.log(err);
|
|
164
|
+
process.exit(1);
|
|
165
165
|
});`;
|
|
166
166
|
return ret;
|
|
167
167
|
}
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.0.
|
|
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.
|
|
32
|
-
"source-map": "^0.7.4"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"@types/chai": "^4.3.1",
|
|
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.7.3"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@abaplint/transpiler",
|
|
3
|
+
"version": "2.0.35",
|
|
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.91.2",
|
|
32
|
+
"source-map": "^0.7.4"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/chai": "^4.3.1",
|
|
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.7.3"
|
|
41
|
+
}
|
|
42
|
+
}
|