greybel-interpreter 2.1.7 → 2.1.9
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/dist/cps.js +1 -0
- package/dist/operations/resolve.js +21 -16
- package/package.json +3 -3
package/dist/cps.js
CHANGED
|
@@ -57,6 +57,7 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
|
|
|
57
57
|
case greyscript_core_1.ASTType.MemberExpression:
|
|
58
58
|
case greyscript_core_1.ASTType.Identifier:
|
|
59
59
|
case greyscript_core_1.ASTType.IndexExpression:
|
|
60
|
+
case greyscript_core_1.ASTType.SliceExpression:
|
|
60
61
|
return new resolve_1.Resolve(item, currentTarget).build(defaultVisit);
|
|
61
62
|
case greyscript_core_1.ASTType.FunctionDeclaration:
|
|
62
63
|
return new function_1.FunctionOperation(item, currentTarget).build(defaultVisit);
|
|
@@ -114,17 +114,17 @@ class Resolve extends operation_1.Operation {
|
|
|
114
114
|
case greyscript_core_1.ASTType.IndexExpression: {
|
|
115
115
|
const indexExpr = node;
|
|
116
116
|
yield this.buildProcessor(indexExpr.base, visit);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
117
|
+
const indexSegment = new IndexSegment(yield visit(indexExpr.index));
|
|
118
|
+
this.path.push(indexSegment);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case greyscript_core_1.ASTType.SliceExpression: {
|
|
122
|
+
const sliceExpr = node;
|
|
123
|
+
yield this.buildProcessor(sliceExpr.base, visit);
|
|
124
|
+
const left = yield visit(sliceExpr.left);
|
|
125
|
+
const right = yield visit(sliceExpr.right);
|
|
126
|
+
const sliceSegment = new SliceSegment(left, right);
|
|
127
|
+
this.path.push(sliceSegment);
|
|
128
128
|
break;
|
|
129
129
|
}
|
|
130
130
|
case greyscript_core_1.ASTType.Identifier: {
|
|
@@ -221,13 +221,18 @@ class Resolve extends operation_1.Operation {
|
|
|
221
221
|
}
|
|
222
222
|
if (result.handle instanceof with_intrinsics_1.CustomValueWithIntrinsics) {
|
|
223
223
|
const customValueCtx = result.handle;
|
|
224
|
+
if (this.path.isSuper() && customValueCtx instanceof map_1.CustomMap) {
|
|
225
|
+
const superChild = customValueCtx.isa.get(result.path);
|
|
226
|
+
if (autoCall && superChild instanceof function_1.CustomFunction) {
|
|
227
|
+
if (ctx.functionState.context) {
|
|
228
|
+
return superChild.run(ctx.functionState.context, [], ctx, customValueCtx.isa);
|
|
229
|
+
}
|
|
230
|
+
return superChild.run(customValueCtx, [], ctx);
|
|
231
|
+
}
|
|
232
|
+
return superChild;
|
|
233
|
+
}
|
|
224
234
|
const child = customValueCtx.get(result.path);
|
|
225
235
|
if (autoCall && child instanceof function_1.CustomFunction) {
|
|
226
|
-
if (this.path.isSuper() &&
|
|
227
|
-
ctx.functionState.context &&
|
|
228
|
-
customValueCtx instanceof map_1.CustomMap) {
|
|
229
|
-
return child.run(ctx.functionState.context, [], ctx, customValueCtx.isa);
|
|
230
|
-
}
|
|
231
236
|
return child.run(customValueCtx, [], ctx);
|
|
232
237
|
}
|
|
233
238
|
return child;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "greybel-interpreter",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"description": "Interpreter",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"typescript": "^5.0.4"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"greybel-core": "^0.9.
|
|
52
|
-
"greyscript-core": "^0.9.
|
|
51
|
+
"greybel-core": "^0.9.5",
|
|
52
|
+
"greyscript-core": "^0.9.7"
|
|
53
53
|
},
|
|
54
54
|
"keywords": [
|
|
55
55
|
"greyscript",
|