greybel-interpreter 2.2.18 → 2.2.19
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.
|
@@ -29,6 +29,9 @@ class Assign extends operation_1.Operation {
|
|
|
29
29
|
handle(ctx) {
|
|
30
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
31
|
const resolveResult = yield this.left.getResult(ctx);
|
|
32
|
+
if (ctx.isExit()) {
|
|
33
|
+
return default_1.DefaultType.Void;
|
|
34
|
+
}
|
|
32
35
|
const rightValue = yield this.right.handle(ctx);
|
|
33
36
|
if (!(resolveResult.handle instanceof resolve_1.ResolveNil)) {
|
|
34
37
|
const resultValueCtx = resolveResult.handle;
|
package/dist/operations/call.js
CHANGED
|
@@ -32,6 +32,9 @@ class Call extends operation_1.Operation {
|
|
|
32
32
|
handle(ctx) {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
34
|
const resolveResult = yield this.fnRef.getResult(ctx);
|
|
35
|
+
if (ctx.isExit()) {
|
|
36
|
+
return default_1.DefaultType.Void;
|
|
37
|
+
}
|
|
35
38
|
const valueRef = yield this.fnRef.handle(ctx, resolveResult, false);
|
|
36
39
|
const fnArgs = [];
|
|
37
40
|
for (let index = 0; index < this.args.length; index++) {
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.FunctionReference = void 0;
|
|
13
|
+
const default_1 = require("../types/default");
|
|
13
14
|
const operation_1 = require("./operation");
|
|
14
15
|
const resolve_1 = require("./resolve");
|
|
15
16
|
class FunctionReference extends operation_1.Operation {
|
|
@@ -27,6 +28,9 @@ class FunctionReference extends operation_1.Operation {
|
|
|
27
28
|
handle(ctx) {
|
|
28
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
30
|
const refResult = yield this.ref.getResult(ctx);
|
|
31
|
+
if (ctx.isExit()) {
|
|
32
|
+
return default_1.DefaultType.Void;
|
|
33
|
+
}
|
|
30
34
|
if (!(refResult.handle instanceof resolve_1.ResolveNil)) {
|
|
31
35
|
if (refResult.path.count() === 0) {
|
|
32
36
|
return refResult.handle;
|
|
@@ -50,6 +50,6 @@ export declare class Resolve extends Operation {
|
|
|
50
50
|
constructor(item: ASTBase, target?: string);
|
|
51
51
|
buildProcessor(node: ASTBase, visit: CPSVisit): Promise<void>;
|
|
52
52
|
build(visit: CPSVisit): Promise<Resolve>;
|
|
53
|
-
getResult(ctx: OperationContext): Promise<ResolveResult>;
|
|
53
|
+
getResult(ctx: OperationContext): Promise<ResolveResult | null>;
|
|
54
54
|
handle(ctx: OperationContext, result?: ResolveResult, autoCall?: boolean): Promise<CustomValue>;
|
|
55
55
|
}
|
|
@@ -157,7 +157,7 @@ class Resolve extends operation_1.Operation {
|
|
|
157
157
|
const lastIndex = maxIndex - 1;
|
|
158
158
|
for (let index = 0; index < maxIndex; index++) {
|
|
159
159
|
if (ctx.isExit()) {
|
|
160
|
-
return null;
|
|
160
|
+
return new ResolveResult(null, default_1.DefaultType.Void);
|
|
161
161
|
}
|
|
162
162
|
const current = this.path.at(index);
|
|
163
163
|
if (current instanceof OperationSegment) {
|
|
@@ -215,7 +215,7 @@ class Resolve extends operation_1.Operation {
|
|
|
215
215
|
return __awaiter(this, void 0, void 0, function* () {
|
|
216
216
|
if (result === null) {
|
|
217
217
|
result = yield this.getResult(ctx);
|
|
218
|
-
if (
|
|
218
|
+
if (ctx.isExit()) {
|
|
219
219
|
return default_1.DefaultType.Void;
|
|
220
220
|
}
|
|
221
221
|
}
|