greybel-interpreter 4.0.20 → 4.1.0
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.
|
@@ -52,8 +52,21 @@ class BytecodeGenerator {
|
|
|
52
52
|
this.debugMode = (_a = options.debugMode) !== null && _a !== void 0 ? _a : false;
|
|
53
53
|
}
|
|
54
54
|
parse(code) {
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
try {
|
|
56
|
+
const parser = new greybel_core_1.Parser(code);
|
|
57
|
+
return parser.parseChunk();
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
if (err instanceof error_1.PrepareError) {
|
|
61
|
+
this.handler.errorHandler.raise(err);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.handler.errorHandler.raise(new error_1.PrepareError(err.message, {
|
|
65
|
+
range: err.range,
|
|
66
|
+
target: this.target.peek()
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
57
70
|
}
|
|
58
71
|
compile(code) {
|
|
59
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -4,8 +4,8 @@ exports.setImmediate = void 0;
|
|
|
4
4
|
function setImmediateProvider() {
|
|
5
5
|
var _a, _b;
|
|
6
6
|
const ctx = globalThis;
|
|
7
|
-
return (_b = (_a = ctx.setImmediate) !== null && _a !== void 0 ? _a : ctx.requestAnimationFrame) !== null && _b !== void 0 ? _b : function (callback, ...args) {
|
|
7
|
+
return ((_b = (_a = ctx.setImmediate) !== null && _a !== void 0 ? _a : ctx.requestAnimationFrame) !== null && _b !== void 0 ? _b : function (callback, ...args) {
|
|
8
8
|
return setTimeout(() => callback(...args), 0);
|
|
9
|
-
};
|
|
9
|
+
});
|
|
10
10
|
}
|
|
11
11
|
exports.setImmediate = setImmediateProvider();
|