@abaplint/runtime 2.6.44 → 2.7.1
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/build/src/{console.d.ts → console/console.d.ts} +2 -2
- package/build/src/console/console.js +3 -0
- package/build/src/console/memory_console.d.ts +9 -0
- package/build/src/{console.js → console/memory_console.js} +7 -4
- package/build/src/console/standard_out_console.d.ts +9 -0
- package/build/src/console/standard_out_console.js +26 -0
- package/build/src/context.d.ts +1 -1
- package/build/src/index.d.ts +4 -3
- package/build/src/index.js +6 -4
- package/build/src/statements/write.js +1 -1
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
class
|
|
3
|
+
exports.MemoryConsole = void 0;
|
|
4
|
+
class MemoryConsole {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.data = "";
|
|
7
7
|
}
|
|
@@ -14,9 +14,12 @@ class Console {
|
|
|
14
14
|
get() {
|
|
15
15
|
return this.data;
|
|
16
16
|
}
|
|
17
|
+
isEmpty() {
|
|
18
|
+
return this.data === "";
|
|
19
|
+
}
|
|
17
20
|
getTrimmed() {
|
|
18
21
|
return this.data.split("\n").map(a => a.trimEnd()).join("\n");
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
|
-
exports.
|
|
22
|
-
//# sourceMappingURL=
|
|
24
|
+
exports.MemoryConsole = MemoryConsole;
|
|
25
|
+
//# sourceMappingURL=memory_console.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StandardOutConsole = void 0;
|
|
4
|
+
class StandardOutConsole {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.empty = true;
|
|
7
|
+
}
|
|
8
|
+
clear() {
|
|
9
|
+
throw new Error("transpiler runtime: not supported for stdio console");
|
|
10
|
+
}
|
|
11
|
+
add(data) {
|
|
12
|
+
process.stdout.write(data);
|
|
13
|
+
this.empty = false;
|
|
14
|
+
}
|
|
15
|
+
get() {
|
|
16
|
+
return "";
|
|
17
|
+
}
|
|
18
|
+
isEmpty() {
|
|
19
|
+
return this.empty;
|
|
20
|
+
}
|
|
21
|
+
getTrimmed() {
|
|
22
|
+
throw new Error("transpiler runtime: not supported for stdio console");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.StandardOutConsole = StandardOutConsole;
|
|
26
|
+
//# sourceMappingURL=standard_out_console.js.map
|
package/build/src/context.d.ts
CHANGED
package/build/src/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Console } from "./console";
|
|
2
1
|
import { Context } from "./context";
|
|
3
2
|
import { OffsetLength } from "./offset_length";
|
|
4
3
|
import { Statements } from "./statements";
|
|
@@ -13,7 +12,9 @@ import * as types from "./types";
|
|
|
13
12
|
import { expandIN } from "./expand_in";
|
|
14
13
|
import { expandDynamic } from "./expand_dynamic";
|
|
15
14
|
import { ClassicError } from "./classic_error";
|
|
16
|
-
|
|
15
|
+
import { Console } from "./console/console";
|
|
16
|
+
import { MemoryConsole } from "./console/memory_console";
|
|
17
|
+
export { UnitTestResult, RFC, types, DB, MemoryConsole };
|
|
17
18
|
export declare class ABAP {
|
|
18
19
|
FunctionModules: {
|
|
19
20
|
[name: string]: any;
|
|
@@ -48,5 +49,5 @@ export declare class ABAP {
|
|
|
48
49
|
expandDynamic: typeof expandDynamic;
|
|
49
50
|
ClassicError: typeof ClassicError;
|
|
50
51
|
readonly context: Context;
|
|
51
|
-
constructor();
|
|
52
|
+
constructor(console?: Console);
|
|
52
53
|
}
|
package/build/src/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ABAP = exports.DB = exports.types = exports.RFC = exports.UnitTestResult = void 0;
|
|
4
|
-
const console_1 = require("./console");
|
|
3
|
+
exports.ABAP = exports.MemoryConsole = exports.DB = exports.types = exports.RFC = exports.UnitTestResult = void 0;
|
|
5
4
|
const context_1 = require("./context");
|
|
6
5
|
const offset_length_1 = require("./offset_length");
|
|
7
6
|
const statements_1 = require("./statements");
|
|
@@ -20,8 +19,11 @@ exports.types = types;
|
|
|
20
19
|
const expand_in_1 = require("./expand_in");
|
|
21
20
|
const expand_dynamic_1 = require("./expand_dynamic");
|
|
22
21
|
const classic_error_1 = require("./classic_error");
|
|
22
|
+
const standard_out_console_1 = require("./console/standard_out_console");
|
|
23
|
+
const memory_console_1 = require("./console/memory_console");
|
|
24
|
+
Object.defineProperty(exports, "MemoryConsole", { enumerable: true, get: function () { return memory_console_1.MemoryConsole; } });
|
|
23
25
|
class ABAP {
|
|
24
|
-
constructor() {
|
|
26
|
+
constructor(console) {
|
|
25
27
|
// global objects
|
|
26
28
|
this.FunctionModules = {};
|
|
27
29
|
this.Classes = {};
|
|
@@ -40,7 +42,7 @@ class ABAP {
|
|
|
40
42
|
this.expandDynamic = expand_dynamic_1.expandDynamic;
|
|
41
43
|
this.ClassicError = classic_error_1.ClassicError;
|
|
42
44
|
this.context = new context_1.Context();
|
|
43
|
-
this.console = new
|
|
45
|
+
this.console = console ? console : new standard_out_console_1.StandardOutConsole();
|
|
44
46
|
this.context.console = this.console;
|
|
45
47
|
this.statements = new statements_1.Statements(this.context);
|
|
46
48
|
// todo, this should not be a singleton, it should be part of this instance
|
|
@@ -12,7 +12,7 @@ class WriteStatement {
|
|
|
12
12
|
this.context.console.add("\n");
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
|
-
if ((options === null || options === void 0 ? void 0 : options.newLine) === true && this.context.console.
|
|
15
|
+
if ((options === null || options === void 0 ? void 0 : options.newLine) === true && this.context.console.isEmpty() === false) {
|
|
16
16
|
this.context.console.add("\n");
|
|
17
17
|
}
|
|
18
18
|
let result = "";
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/runtime",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "Transpiler - Runtime",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
7
|
+
"funding": "https://github.com/sponsors/larshp",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "git+https://github.com/abaplint/transpiler.git"
|