greybel-interpreter 2.1.7 → 2.1.8

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 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
- if (indexExpr.index.type === greyscript_core_1.ASTType.SliceExpression) {
118
- const sliceExpr = indexExpr.index;
119
- const left = yield visit(sliceExpr.left);
120
- const right = yield visit(sliceExpr.right);
121
- const sliceSegment = new SliceSegment(left, right);
122
- this.path.push(sliceSegment);
123
- }
124
- else {
125
- const indexSegment = new IndexSegment(yield visit(indexExpr.index));
126
- this.path.push(indexSegment);
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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "2.1.7",
3
+ "version": "2.1.8",
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.4",
52
- "greyscript-core": "^0.9.6"
51
+ "greybel-core": "^0.9.5",
52
+ "greyscript-core": "^0.9.7"
53
53
  },
54
54
  "keywords": [
55
55
  "greyscript",