greybel-interpreter 1.6.6 → 1.6.7

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.
Files changed (2) hide show
  1. package/dist/cps.js +3 -9
  2. package/package.json +1 -1
package/dist/cps.js CHANGED
@@ -88,14 +88,12 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
88
88
  console.warn('Found circluar dependency. Using noop operation.');
89
89
  return new noop_1.default(item, target);
90
90
  }
91
- stack.push(target);
92
91
  const code = yield context.handler.resourceHandler.get(target);
93
92
  if (code == null) {
94
93
  throw new Error(`Cannot find import ${currentTarget}.`);
95
94
  }
96
- const subVisit = visit.bind(null, context, stack);
95
+ const subVisit = visit.bind(null, context, [...stack, target]);
97
96
  const importStatement = yield new import_1.default(importExpr, target, code).build(subVisit);
98
- stack.pop();
99
97
  return importStatement;
100
98
  }
101
99
  case greybel_core_1.ASTType.FeatureIncludeExpression: {
@@ -105,14 +103,12 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
105
103
  console.warn('Found circluar dependency. Using noop operation.');
106
104
  return new noop_1.default(item, target);
107
105
  }
108
- stack.push(target);
109
106
  const code = yield context.handler.resourceHandler.get(target);
110
107
  if (code == null) {
111
108
  throw new Error(`Cannot find include ${currentTarget}.`);
112
109
  }
113
- const subVisit = visit.bind(null, context, stack);
110
+ const subVisit = visit.bind(null, context, [...stack, target]);
114
111
  const importStatement = yield new include_1.default(includeExpr, target, code).build(subVisit);
115
- stack.pop();
116
112
  return importStatement;
117
113
  }
118
114
  case greyscript_core_1.ASTType.ImportCodeExpression: {
@@ -122,14 +118,12 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
122
118
  console.warn('Found circluar dependency. Using noop operation.');
123
119
  return new noop_1.default(item, target);
124
120
  }
125
- stack.push(target);
126
121
  const code = yield context.handler.resourceHandler.get(target);
127
122
  if (code == null) {
128
123
  throw new Error(`Cannot find native import ${currentTarget}.`);
129
124
  }
130
- const subVisit = visit.bind(null, context, stack);
125
+ const subVisit = visit.bind(null, context, [...stack, target]);
131
126
  const importStatement = yield new include_1.default(importExpr, target, code).build(subVisit);
132
- stack.pop();
133
127
  return importStatement;
134
128
  }
135
129
  case greybel_core_1.ASTType.FeatureDebuggerExpression:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",