greybel-interpreter 3.0.2 → 3.0.3

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.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare class CPSContext {
6
6
  readonly handler: HandlerContainer;
7
7
  constructor(target: string, handler: HandlerContainer);
8
8
  }
9
- export type CPSVisitCallback = (context: CPSContext, stack: string[], item: ASTBase) => Promise<Operation>;
9
+ export type CPSVisitCallback = (cpsVisit: CPSVisitCallback, context: CPSContext, stack: string[], item: ASTBase) => Promise<Operation>;
10
10
  export declare const defaultCPSVisit: CPSVisitCallback;
11
11
  export declare class CPS {
12
12
  private readonly context;
package/dist/cps.js CHANGED
@@ -44,9 +44,9 @@ class CPSContext {
44
44
  }
45
45
  }
46
46
  exports.CPSContext = CPSContext;
47
- const defaultCPSVisit = (context, stack, item) => __awaiter(void 0, void 0, void 0, function* () {
47
+ const defaultCPSVisit = (cpsVisit, context, stack, item) => __awaiter(void 0, void 0, void 0, function* () {
48
48
  const currentTarget = stack[stack.length - 1];
49
- const defaultVisit = exports.defaultCPSVisit.bind(null, context, stack);
49
+ const defaultVisit = cpsVisit.bind(null, cpsVisit, context, stack);
50
50
  switch (item.type) {
51
51
  case miniscript_core_1.ASTType.MapConstructorExpression:
52
52
  return new map_1.MapOperation(item, currentTarget).build(defaultVisit);
@@ -96,7 +96,7 @@ const defaultCPSVisit = (context, stack, item) => __awaiter(void 0, void 0, void
96
96
  });
97
97
  }
98
98
  try {
99
- const subVisit = exports.defaultCPSVisit.bind(null, context, [...stack, target]);
99
+ const subVisit = cpsVisit.bind(null, cpsVisit, context, [...stack, target]);
100
100
  const importStatement = yield new import_1.Import(importExpr, currentTarget, target, code).build(subVisit);
101
101
  return importStatement;
102
102
  }
@@ -126,7 +126,7 @@ const defaultCPSVisit = (context, stack, item) => __awaiter(void 0, void 0, void
126
126
  });
127
127
  }
128
128
  try {
129
- const subVisit = exports.defaultCPSVisit.bind(null, context, [...stack, target]);
129
+ const subVisit = cpsVisit.bind(null, cpsVisit, context, [...stack, target]);
130
130
  const importStatement = yield new include_1.Include(includeExpr, currentTarget, target, code).build(subVisit);
131
131
  return importStatement;
132
132
  }
@@ -192,7 +192,7 @@ exports.defaultCPSVisit = defaultCPSVisit;
192
192
  class CPS {
193
193
  constructor(context, cpsVisit = exports.defaultCPSVisit) {
194
194
  this.context = context;
195
- this.__visit = cpsVisit.bind(null, context, [context.target]);
195
+ this.__visit = cpsVisit.bind(null, cpsVisit, context, [context.target]);
196
196
  }
197
197
  visit(item) {
198
198
  return this.__visit(item);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",