greybel-interpreter 2.2.19 → 3.0.0

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 (36) hide show
  1. package/dist/context.d.ts +2 -1
  2. package/dist/context.js +8 -4
  3. package/dist/cps.d.ts +1 -1
  4. package/dist/cps.js +39 -69
  5. package/dist/operations/assign.d.ts +1 -1
  6. package/dist/operations/block.d.ts +1 -1
  7. package/dist/operations/break.d.ts +1 -1
  8. package/dist/operations/call.d.ts +1 -1
  9. package/dist/operations/chunk.d.ts +1 -1
  10. package/dist/operations/continue.d.ts +1 -1
  11. package/dist/operations/debugger-statement.d.ts +1 -1
  12. package/dist/operations/evaluate.d.ts +1 -1
  13. package/dist/operations/evaluate.js +56 -56
  14. package/dist/operations/for.d.ts +1 -1
  15. package/dist/operations/function-reference.d.ts +1 -1
  16. package/dist/operations/function.d.ts +1 -1
  17. package/dist/operations/function.js +3 -3
  18. package/dist/operations/if-statement.d.ts +1 -1
  19. package/dist/operations/if-statement.js +7 -7
  20. package/dist/operations/import.d.ts +1 -1
  21. package/dist/operations/include.d.ts +1 -1
  22. package/dist/operations/list.d.ts +1 -1
  23. package/dist/operations/literal.d.ts +1 -1
  24. package/dist/operations/literal.js +5 -5
  25. package/dist/operations/map.d.ts +1 -1
  26. package/dist/operations/negated-binary.d.ts +1 -1
  27. package/dist/operations/negated-binary.js +3 -3
  28. package/dist/operations/new-instance.d.ts +1 -1
  29. package/dist/operations/not.d.ts +1 -1
  30. package/dist/operations/operation.d.ts +1 -1
  31. package/dist/operations/resolve.d.ts +1 -1
  32. package/dist/operations/resolve.js +5 -5
  33. package/dist/operations/return.d.ts +1 -1
  34. package/dist/operations/while.d.ts +1 -1
  35. package/dist/utils/error.d.ts +1 -1
  36. package/package.json +3 -5
package/dist/context.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
- import { ASTBase } from 'greyscript-core';
3
+ import { ASTBase } from 'miniscript-core';
4
4
  import { CPS } from './cps';
5
5
  import { HandlerContainer } from './handler-container';
6
6
  import { Operation } from './operations/operation';
@@ -92,6 +92,7 @@ export declare class OperationContext {
92
92
  injected: boolean;
93
93
  readonly api: OperationContext;
94
94
  readonly locals: OperationContext;
95
+ readonly outer: OperationContext;
95
96
  readonly globals: OperationContext;
96
97
  private static readonly lookupApiType;
97
98
  private static readonly lookupGlobalsType;
package/dist/context.js CHANGED
@@ -40,7 +40,7 @@ class Scope extends map_1.CustomMap {
40
40
  this.context = context;
41
41
  }
42
42
  get(path) {
43
- var _a, _b;
43
+ var _a, _b, _c;
44
44
  if (path instanceof base_1.CustomValue) {
45
45
  return this.get(new path_1.Path([path]));
46
46
  }
@@ -52,10 +52,13 @@ class Scope extends map_1.CustomMap {
52
52
  if (this.has(path)) {
53
53
  return super.get(path);
54
54
  }
55
- else if ((_a = this.context.globals) === null || _a === void 0 ? void 0 : _a.scope.has(path)) {
55
+ else if ((_a = this.context.outer) === null || _a === void 0 ? void 0 : _a.scope.has(path)) {
56
+ return this.context.outer.scope.get(path);
57
+ }
58
+ else if ((_b = this.context.globals) === null || _b === void 0 ? void 0 : _b.scope.has(path)) {
56
59
  return this.context.globals.scope.get(path);
57
60
  }
58
- else if ((_b = this.context.api) === null || _b === void 0 ? void 0 : _b.scope.has(path)) {
61
+ else if ((_c = this.context.api) === null || _c === void 0 ? void 0 : _c.scope.has(path)) {
59
62
  return this.context.api.scope.get(path);
60
63
  }
61
64
  else if (path.count() === 1 && map_1.CustomMap.getIntrinsics().has(current)) {
@@ -149,7 +152,7 @@ class FunctionState {
149
152
  exports.FunctionState = FunctionState;
150
153
  class OperationContext {
151
154
  constructor(options = {}) {
152
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
155
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
153
156
  this.target = (_a = options.target) !== null && _a !== void 0 ? _a : 'unknown';
154
157
  this.stackTrace = (_b = options.stackTrace) !== null && _b !== void 0 ? _b : [];
155
158
  this.previous = (_c = options.previous) !== null && _c !== void 0 ? _c : null;
@@ -168,6 +171,7 @@ class OperationContext {
168
171
  this.api = this.lookupApi();
169
172
  this.globals = this.lookupGlobals();
170
173
  this.locals = (_o = this.lookupLocals()) !== null && _o !== void 0 ? _o : this;
174
+ this.outer = (_q = (_p = this.locals.previous) === null || _p === void 0 ? void 0 : _p.lookupLocals()) !== null && _q !== void 0 ? _q : null;
171
175
  }
172
176
  isIgnoredInDebugging(op) {
173
177
  return op instanceof operation_1.OperationBlock || op instanceof noop_1.Noop;
package/dist/cps.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ASTBase } from 'greyscript-core';
1
+ import { ASTBase } from 'miniscript-core';
2
2
  import { HandlerContainer } from './handler-container';
3
3
  import { Operation } from './operations/operation';
4
4
  export declare class CPSContext {
package/dist/cps.js CHANGED
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CPS = exports.CPSContext = void 0;
13
13
  const greybel_core_1 = require("greybel-core");
14
- const greyscript_core_1 = require("greyscript-core");
14
+ const miniscript_core_1 = require("miniscript-core");
15
15
  const assign_1 = require("./operations/assign");
16
16
  const break_1 = require("./operations/break");
17
17
  const call_1 = require("./operations/call");
@@ -48,37 +48,37 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
48
48
  const currentTarget = stack[stack.length - 1];
49
49
  const defaultVisit = visit.bind(null, context, stack);
50
50
  switch (item.type) {
51
- case greyscript_core_1.ASTType.MapConstructorExpression:
51
+ case miniscript_core_1.ASTType.MapConstructorExpression:
52
52
  return new map_1.MapOperation(item, currentTarget).build(defaultVisit);
53
- case greyscript_core_1.ASTType.ListConstructorExpression:
53
+ case miniscript_core_1.ASTType.ListConstructorExpression:
54
54
  return new list_1.List(item, currentTarget).build(defaultVisit);
55
- case greyscript_core_1.ASTType.AssignmentStatement:
55
+ case miniscript_core_1.ASTType.AssignmentStatement:
56
56
  return new assign_1.Assign(item, currentTarget).build(defaultVisit);
57
- case greyscript_core_1.ASTType.MemberExpression:
58
- case greyscript_core_1.ASTType.Identifier:
59
- case greyscript_core_1.ASTType.IndexExpression:
60
- case greyscript_core_1.ASTType.SliceExpression:
57
+ case miniscript_core_1.ASTType.MemberExpression:
58
+ case miniscript_core_1.ASTType.Identifier:
59
+ case miniscript_core_1.ASTType.IndexExpression:
60
+ case miniscript_core_1.ASTType.SliceExpression:
61
61
  return new resolve_1.Resolve(item, currentTarget).build(defaultVisit);
62
- case greyscript_core_1.ASTType.FunctionDeclaration:
62
+ case miniscript_core_1.ASTType.FunctionDeclaration:
63
63
  return new function_1.FunctionOperation(item, currentTarget).build(defaultVisit);
64
- case greyscript_core_1.ASTType.InvalidCodeExpression:
64
+ case miniscript_core_1.ASTType.InvalidCodeExpression:
65
65
  return new noop_1.Noop(item, currentTarget).build(defaultVisit);
66
- case greyscript_core_1.ASTType.WhileStatement:
66
+ case miniscript_core_1.ASTType.WhileStatement:
67
67
  return new while_1.While(item, currentTarget).build(defaultVisit);
68
- case greyscript_core_1.ASTType.ForGenericStatement:
68
+ case miniscript_core_1.ASTType.ForGenericStatement:
69
69
  return new for_1.For(item, currentTarget).build(defaultVisit);
70
- case greyscript_core_1.ASTType.IfStatement:
71
- case greyscript_core_1.ASTType.IfShortcutStatement:
70
+ case miniscript_core_1.ASTType.IfStatement:
71
+ case miniscript_core_1.ASTType.IfShortcutStatement:
72
72
  return new if_statement_1.IfStatement(item, currentTarget).build(defaultVisit);
73
- case greyscript_core_1.ASTType.ReturnStatement:
73
+ case miniscript_core_1.ASTType.ReturnStatement:
74
74
  return new return_1.Return(item, currentTarget).build(defaultVisit);
75
- case greyscript_core_1.ASTType.BreakStatement:
75
+ case miniscript_core_1.ASTType.BreakStatement:
76
76
  return new break_1.Break(item, currentTarget).build(defaultVisit);
77
- case greyscript_core_1.ASTType.ContinueStatement:
77
+ case miniscript_core_1.ASTType.ContinueStatement:
78
78
  return new continue_1.Continue(item, currentTarget).build(defaultVisit);
79
- case greyscript_core_1.ASTType.CallExpression:
79
+ case miniscript_core_1.ASTType.CallExpression:
80
80
  return new call_1.Call(item, currentTarget).build(defaultVisit);
81
- case greyscript_core_1.ASTType.CallStatement:
81
+ case miniscript_core_1.ASTType.CallStatement:
82
82
  return defaultVisit(item.expression);
83
83
  case greybel_core_1.ASTType.FeatureImportExpression: {
84
84
  const importExpr = item;
@@ -89,7 +89,7 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
89
89
  }
90
90
  const code = yield context.handler.resourceHandler.get(target);
91
91
  if (code == null) {
92
- const range = new greyscript_core_1.ASTRange(item.start, item.end);
92
+ const range = new miniscript_core_1.ASTRange(item.start, item.end);
93
93
  throw new error_1.PrepareError(`Cannot find import "${currentTarget}"`, {
94
94
  target: currentTarget,
95
95
  range
@@ -106,7 +106,7 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
106
106
  }
107
107
  throw new error_1.PrepareError(err.message, {
108
108
  target,
109
- range: new greyscript_core_1.ASTRange(item.start, item.end)
109
+ range: new miniscript_core_1.ASTRange(item.start, item.end)
110
110
  }, err);
111
111
  }
112
112
  }
@@ -119,7 +119,7 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
119
119
  }
120
120
  const code = yield context.handler.resourceHandler.get(target);
121
121
  if (code == null) {
122
- const range = new greyscript_core_1.ASTRange(item.start, item.end);
122
+ const range = new miniscript_core_1.ASTRange(item.start, item.end);
123
123
  throw new error_1.PrepareError(`Cannot find include "${currentTarget}"`, {
124
124
  target: currentTarget,
125
125
  range
@@ -136,37 +136,7 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
136
136
  }
137
137
  throw new error_1.PrepareError(err.message, {
138
138
  target,
139
- range: new greyscript_core_1.ASTRange(item.start, item.end)
140
- }, err);
141
- }
142
- }
143
- case greyscript_core_1.ASTType.ImportCodeExpression: {
144
- const importExpr = item;
145
- const target = yield context.handler.resourceHandler.getTargetRelativeTo(currentTarget, importExpr.directory);
146
- if (stack.includes(target)) {
147
- console.warn(`Found circular dependency between "${currentTarget}" and "${target}" at line ${item.start.line}. Using noop instead to prevent overflow.`);
148
- return new noop_1.Noop(item, target);
149
- }
150
- const code = yield context.handler.resourceHandler.get(target);
151
- if (code == null) {
152
- const range = new greyscript_core_1.ASTRange(item.start, item.end);
153
- throw new error_1.PrepareError(`Cannot find native import "${currentTarget}"`, {
154
- target: currentTarget,
155
- range
156
- });
157
- }
158
- try {
159
- const subVisit = visit.bind(null, context, [...stack, target]);
160
- const importStatement = yield new include_1.Include(importExpr, currentTarget, target, code).build(subVisit);
161
- return importStatement;
162
- }
163
- catch (err) {
164
- if (err instanceof error_1.PrepareError) {
165
- throw err;
166
- }
167
- throw new error_1.PrepareError(err.message, {
168
- target,
169
- range: new greyscript_core_1.ASTRange(item.start, item.end)
139
+ range: new miniscript_core_1.ASTRange(item.start, item.end)
170
140
  }, err);
171
141
  }
172
142
  }
@@ -174,22 +144,22 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
174
144
  return new debugger_statement_1.DebuggerStatement(item, currentTarget);
175
145
  case greybel_core_1.ASTType.FeatureEnvarExpression:
176
146
  return new envar_1.EnvarExpression(item, currentTarget);
177
- case greyscript_core_1.ASTType.BooleanLiteral:
178
- case greyscript_core_1.ASTType.StringLiteral:
179
- case greyscript_core_1.ASTType.NumericLiteral:
180
- case greyscript_core_1.ASTType.NilLiteral:
147
+ case miniscript_core_1.ASTType.BooleanLiteral:
148
+ case miniscript_core_1.ASTType.StringLiteral:
149
+ case miniscript_core_1.ASTType.NumericLiteral:
150
+ case miniscript_core_1.ASTType.NilLiteral:
181
151
  return new literal_1.Literal(item, currentTarget).build(defaultVisit);
182
- case greyscript_core_1.ASTType.EmptyExpression:
152
+ case miniscript_core_1.ASTType.EmptyExpression:
183
153
  return new noop_1.Noop(item, currentTarget).build(defaultVisit);
184
- case greyscript_core_1.ASTType.IsaExpression:
185
- case greyscript_core_1.ASTType.BinaryExpression:
186
- case greyscript_core_1.ASTType.LogicalExpression:
154
+ case miniscript_core_1.ASTType.IsaExpression:
155
+ case miniscript_core_1.ASTType.BinaryExpression:
156
+ case miniscript_core_1.ASTType.LogicalExpression:
187
157
  return new evaluate_1.Evaluate(item, currentTarget).build(defaultVisit);
188
- case greyscript_core_1.ASTType.NegationExpression:
158
+ case miniscript_core_1.ASTType.NegationExpression:
189
159
  return new not_1.Not(item, currentTarget).build(defaultVisit);
190
- case greyscript_core_1.ASTType.BinaryNegatedExpression:
160
+ case miniscript_core_1.ASTType.BinaryNegatedExpression:
191
161
  return new negated_binary_1.NegatedBinary(item, currentTarget).build(defaultVisit);
192
- case greyscript_core_1.ASTType.UnaryExpression: {
162
+ case miniscript_core_1.ASTType.UnaryExpression: {
193
163
  const unaryExpr = item;
194
164
  if (unaryExpr.operator === 'new') {
195
165
  return new new_instance_1.NewInstance(unaryExpr).build(defaultVisit);
@@ -197,20 +167,20 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
197
167
  else if (unaryExpr.operator === '@') {
198
168
  return new function_reference_1.FunctionReference(unaryExpr).build(defaultVisit);
199
169
  }
200
- const range = new greyscript_core_1.ASTRange(item.start, item.end);
170
+ const range = new miniscript_core_1.ASTRange(item.start, item.end);
201
171
  throw new error_1.PrepareError(`Unknown unary expression`, {
202
172
  target: currentTarget,
203
173
  range
204
174
  });
205
175
  }
206
- case greyscript_core_1.ASTType.Chunk:
176
+ case miniscript_core_1.ASTType.Chunk:
207
177
  return new chunk_1.Chunk(item, currentTarget).build(defaultVisit);
208
- case greyscript_core_1.ASTType.Comment:
178
+ case miniscript_core_1.ASTType.Comment:
209
179
  return new noop_1.Noop(item, currentTarget);
210
- case greyscript_core_1.ASTType.ParenthesisExpression:
180
+ case miniscript_core_1.ASTType.ParenthesisExpression:
211
181
  return defaultVisit(item.expression);
212
182
  default: {
213
- const range = new greyscript_core_1.ASTRange(item.start, item.end);
183
+ const range = new miniscript_core_1.ASTRange(item.start, item.end);
214
184
  throw new error_1.PrepareError(`Unexpected AST type ${item.type}`, {
215
185
  target: currentTarget,
216
186
  range
@@ -1,4 +1,4 @@
1
- import { ASTAssignmentStatement } from 'greyscript-core';
1
+ import { ASTAssignmentStatement } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTBase } from 'greyscript-core';
1
+ import { ASTBase } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTBase } from 'greyscript-core';
1
+ import { ASTBase } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTCallExpression } from 'greyscript-core';
1
+ import { ASTCallExpression } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTChunk } from 'greyscript-core';
1
+ import { ASTChunk } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { Block } from './block';
@@ -1,4 +1,4 @@
1
- import { ASTBase } from 'greyscript-core';
1
+ import { ASTBase } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTBase } from 'greyscript-core';
1
+ import { ASTBase } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTEvaluationExpression } from 'greyscript-core';
1
+ import { ASTEvaluationExpression } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CustomBoolean } from '../types/boolean';
@@ -10,7 +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.Evaluate = exports.handle = exports.handleFunction = exports.handleNil = exports.handleMap = exports.handleList = exports.handleString = exports.handleNumber = exports.FunctionProcessorHandler = exports.NilProcessorHandler = exports.MapProcessorHandler = exports.ListProcessorHandler = exports.divideList = exports.multiplyList = exports.StringProcessorHandler = exports.divideString = exports.multiplyString = exports.minusString = exports.NumberProcessorHandler = exports.GenericProcessorHandler = void 0;
13
- const greyscript_core_1 = require("greyscript-core");
13
+ const miniscript_core_1 = require("miniscript-core");
14
14
  const boolean_1 = require("../types/boolean");
15
15
  const default_1 = require("../types/default");
16
16
  const function_1 = require("../types/function");
@@ -22,27 +22,27 @@ const string_1 = require("../types/string");
22
22
  const deep_equal_1 = require("../utils/deep-equal");
23
23
  const operation_1 = require("./operation");
24
24
  exports.GenericProcessorHandler = {
25
- [greyscript_core_1.Operator.And]: (a, b) => new boolean_1.CustomBoolean(a.toTruthy() && b.toTruthy()),
26
- [greyscript_core_1.Operator.Or]: (a, b) => new boolean_1.CustomBoolean(a.toTruthy() || b.toTruthy())
25
+ [miniscript_core_1.Operator.And]: (a, b) => new boolean_1.CustomBoolean(a.toTruthy() && b.toTruthy()),
26
+ [miniscript_core_1.Operator.Or]: (a, b) => new boolean_1.CustomBoolean(a.toTruthy() || b.toTruthy())
27
27
  };
28
28
  exports.NumberProcessorHandler = {
29
- [greyscript_core_1.Operator.Plus]: (a, b) => new number_1.CustomNumber(a.toNumber() + b.toNumber()),
30
- [greyscript_core_1.Operator.Minus]: (a, b) => new number_1.CustomNumber(a.toNumber() - b.toNumber()),
31
- [greyscript_core_1.Operator.Slash]: (a, b) => new number_1.CustomNumber(a.toNumber() / b.toNumber()),
32
- [greyscript_core_1.Operator.Asterik]: (a, b) => new number_1.CustomNumber(a.toNumber() * b.toNumber()),
33
- [greyscript_core_1.Operator.Power]: (a, b) => new number_1.CustomNumber(Math.pow(a.toNumber(), b.toNumber())),
34
- [greyscript_core_1.Operator.BitwiseOr]: (a, b) => new number_1.CustomNumber(a.toInt() | b.toInt()),
35
- [greyscript_core_1.Operator.LessThan]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() < b.toNumber()),
36
- [greyscript_core_1.Operator.GreaterThan]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() > b.toNumber()),
37
- [greyscript_core_1.Operator.LeftShift]: (a, b) => new number_1.CustomNumber(a.toInt() << b.toInt()),
38
- [greyscript_core_1.Operator.RightShift]: (a, b) => new number_1.CustomNumber(a.toInt() >> b.toInt()),
39
- [greyscript_core_1.Operator.UnsignedRightShift]: (a, b) => new number_1.CustomNumber(a.toInt() >> b.toInt()),
40
- [greyscript_core_1.Operator.BitwiseAnd]: (a, b) => new number_1.CustomNumber(a.toInt() & b.toInt()),
41
- [greyscript_core_1.Operator.PercentSign]: (a, b) => new number_1.CustomNumber(a.toNumber() % b.toNumber()),
42
- [greyscript_core_1.Operator.GreaterThanOrEqual]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() >= b.toNumber()),
43
- [greyscript_core_1.Operator.Equal]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() === b.toNumber()),
44
- [greyscript_core_1.Operator.LessThanOrEqual]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() <= b.toNumber()),
45
- [greyscript_core_1.Operator.NotEqual]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() !== b.toNumber())
29
+ [miniscript_core_1.Operator.Plus]: (a, b) => new number_1.CustomNumber(a.toNumber() + b.toNumber()),
30
+ [miniscript_core_1.Operator.Minus]: (a, b) => new number_1.CustomNumber(a.toNumber() - b.toNumber()),
31
+ [miniscript_core_1.Operator.Slash]: (a, b) => new number_1.CustomNumber(a.toNumber() / b.toNumber()),
32
+ [miniscript_core_1.Operator.Asterik]: (a, b) => new number_1.CustomNumber(a.toNumber() * b.toNumber()),
33
+ [miniscript_core_1.Operator.Power]: (a, b) => new number_1.CustomNumber(Math.pow(a.toNumber(), b.toNumber())),
34
+ [miniscript_core_1.Operator.BitwiseOr]: (a, b) => new number_1.CustomNumber(a.toInt() | b.toInt()),
35
+ [miniscript_core_1.Operator.LessThan]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() < b.toNumber()),
36
+ [miniscript_core_1.Operator.GreaterThan]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() > b.toNumber()),
37
+ [miniscript_core_1.Operator.LeftShift]: (a, b) => new number_1.CustomNumber(a.toInt() << b.toInt()),
38
+ [miniscript_core_1.Operator.RightShift]: (a, b) => new number_1.CustomNumber(a.toInt() >> b.toInt()),
39
+ [miniscript_core_1.Operator.UnsignedRightShift]: (a, b) => new number_1.CustomNumber(a.toInt() >> b.toInt()),
40
+ [miniscript_core_1.Operator.BitwiseAnd]: (a, b) => new number_1.CustomNumber(a.toInt() & b.toInt()),
41
+ [miniscript_core_1.Operator.PercentSign]: (a, b) => new number_1.CustomNumber(a.toNumber() % b.toNumber()),
42
+ [miniscript_core_1.Operator.GreaterThanOrEqual]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() >= b.toNumber()),
43
+ [miniscript_core_1.Operator.Equal]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() === b.toNumber()),
44
+ [miniscript_core_1.Operator.LessThanOrEqual]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() <= b.toNumber()),
45
+ [miniscript_core_1.Operator.NotEqual]: (a, b) => new boolean_1.CustomBoolean(a.toNumber() !== b.toNumber())
46
46
  };
47
47
  const minusString = (a, b) => {
48
48
  const origin = a.toString();
@@ -80,16 +80,16 @@ const divideString = (a, b) => {
80
80
  };
81
81
  exports.divideString = divideString;
82
82
  exports.StringProcessorHandler = {
83
- [greyscript_core_1.Operator.Plus]: (a, b) => new string_1.CustomString(a.toString() + b.toString()),
84
- [greyscript_core_1.Operator.Minus]: (a, b) => (0, exports.minusString)(a, b),
85
- [greyscript_core_1.Operator.Asterik]: (a, b) => (0, exports.multiplyString)(a, b),
86
- [greyscript_core_1.Operator.Slash]: (a, b) => (0, exports.divideString)(a, b),
87
- [greyscript_core_1.Operator.LessThan]: (a, b) => new boolean_1.CustomBoolean(a.toString() < b.toString()),
88
- [greyscript_core_1.Operator.GreaterThan]: (a, b) => new boolean_1.CustomBoolean(a.toString() > b.toString()),
89
- [greyscript_core_1.Operator.GreaterThanOrEqual]: (a, b) => new boolean_1.CustomBoolean(a.toString() >= b.toString()),
90
- [greyscript_core_1.Operator.Equal]: (a, b) => new boolean_1.CustomBoolean(a.toString() === b.toString()),
91
- [greyscript_core_1.Operator.LessThanOrEqual]: (a, b) => new boolean_1.CustomBoolean(a.toString() <= b.toString()),
92
- [greyscript_core_1.Operator.NotEqual]: (a, b) => new boolean_1.CustomBoolean(a.toString() !== b.toString())
83
+ [miniscript_core_1.Operator.Plus]: (a, b) => new string_1.CustomString(a.toString() + b.toString()),
84
+ [miniscript_core_1.Operator.Minus]: (a, b) => (0, exports.minusString)(a, b),
85
+ [miniscript_core_1.Operator.Asterik]: (a, b) => (0, exports.multiplyString)(a, b),
86
+ [miniscript_core_1.Operator.Slash]: (a, b) => (0, exports.divideString)(a, b),
87
+ [miniscript_core_1.Operator.LessThan]: (a, b) => new boolean_1.CustomBoolean(a.toString() < b.toString()),
88
+ [miniscript_core_1.Operator.GreaterThan]: (a, b) => new boolean_1.CustomBoolean(a.toString() > b.toString()),
89
+ [miniscript_core_1.Operator.GreaterThanOrEqual]: (a, b) => new boolean_1.CustomBoolean(a.toString() >= b.toString()),
90
+ [miniscript_core_1.Operator.Equal]: (a, b) => new boolean_1.CustomBoolean(a.toString() === b.toString()),
91
+ [miniscript_core_1.Operator.LessThanOrEqual]: (a, b) => new boolean_1.CustomBoolean(a.toString() <= b.toString()),
92
+ [miniscript_core_1.Operator.NotEqual]: (a, b) => new boolean_1.CustomBoolean(a.toString() !== b.toString())
93
93
  };
94
94
  const multiplyList = (a, b) => {
95
95
  const factor = b.toNumber();
@@ -118,31 +118,31 @@ const divideList = (a, b) => {
118
118
  };
119
119
  exports.divideList = divideList;
120
120
  exports.ListProcessorHandler = {
121
- [greyscript_core_1.Operator.Plus]: (left, right) => {
121
+ [miniscript_core_1.Operator.Plus]: (left, right) => {
122
122
  if (right instanceof list_1.CustomList) {
123
123
  return left.fork().extend(right);
124
124
  }
125
125
  return default_1.DefaultType.Void;
126
126
  },
127
- [greyscript_core_1.Operator.Equal]: (left, right) => {
127
+ [miniscript_core_1.Operator.Equal]: (left, right) => {
128
128
  if (right instanceof list_1.CustomList) {
129
129
  return new boolean_1.CustomBoolean((0, deep_equal_1.deepEqual)(left, right));
130
130
  }
131
131
  return default_1.DefaultType.Void;
132
132
  },
133
- [greyscript_core_1.Operator.NotEqual]: (left, right) => {
133
+ [miniscript_core_1.Operator.NotEqual]: (left, right) => {
134
134
  if (right instanceof list_1.CustomList) {
135
135
  return new boolean_1.CustomBoolean(!(0, deep_equal_1.deepEqual)(left, right));
136
136
  }
137
137
  return default_1.DefaultType.Void;
138
138
  },
139
- [greyscript_core_1.Operator.Asterik]: (left, right) => {
139
+ [miniscript_core_1.Operator.Asterik]: (left, right) => {
140
140
  if (right instanceof number_1.CustomNumber) {
141
141
  return (0, exports.multiplyList)(left, right);
142
142
  }
143
143
  return default_1.DefaultType.Void;
144
144
  },
145
- [greyscript_core_1.Operator.Slash]: (left, right) => {
145
+ [miniscript_core_1.Operator.Slash]: (left, right) => {
146
146
  if (right instanceof number_1.CustomNumber) {
147
147
  return (0, exports.divideList)(left, right);
148
148
  }
@@ -150,19 +150,19 @@ exports.ListProcessorHandler = {
150
150
  }
151
151
  };
152
152
  exports.MapProcessorHandler = {
153
- [greyscript_core_1.Operator.Plus]: (left, right) => {
153
+ [miniscript_core_1.Operator.Plus]: (left, right) => {
154
154
  if (right instanceof map_1.CustomMap) {
155
155
  return left.fork().extend(right);
156
156
  }
157
157
  return default_1.DefaultType.Void;
158
158
  },
159
- [greyscript_core_1.Operator.Equal]: (left, right) => {
159
+ [miniscript_core_1.Operator.Equal]: (left, right) => {
160
160
  if (right instanceof map_1.CustomMap) {
161
161
  return new boolean_1.CustomBoolean((0, deep_equal_1.deepEqual)(left, right));
162
162
  }
163
163
  return default_1.DefaultType.Void;
164
164
  },
165
- [greyscript_core_1.Operator.NotEqual]: (left, right) => {
165
+ [miniscript_core_1.Operator.NotEqual]: (left, right) => {
166
166
  if (right instanceof map_1.CustomMap) {
167
167
  return new boolean_1.CustomBoolean(!(0, deep_equal_1.deepEqual)(left, right));
168
168
  }
@@ -170,18 +170,18 @@ exports.MapProcessorHandler = {
170
170
  }
171
171
  };
172
172
  exports.NilProcessorHandler = {
173
- [greyscript_core_1.Operator.Plus]: () => default_1.DefaultType.Void,
174
- [greyscript_core_1.Operator.Minus]: () => default_1.DefaultType.Void,
175
- [greyscript_core_1.Operator.Slash]: () => default_1.DefaultType.Void,
176
- [greyscript_core_1.Operator.Asterik]: () => default_1.DefaultType.Void,
177
- [greyscript_core_1.Operator.Power]: () => default_1.DefaultType.Void,
178
- [greyscript_core_1.Operator.PercentSign]: () => default_1.DefaultType.Void,
179
- [greyscript_core_1.Operator.Equal]: (_a, b) => new boolean_1.CustomBoolean(b instanceof nil_1.CustomNil),
180
- [greyscript_core_1.Operator.NotEqual]: (_a, b) => new boolean_1.CustomBoolean(!(b instanceof nil_1.CustomNil))
173
+ [miniscript_core_1.Operator.Plus]: () => default_1.DefaultType.Void,
174
+ [miniscript_core_1.Operator.Minus]: () => default_1.DefaultType.Void,
175
+ [miniscript_core_1.Operator.Slash]: () => default_1.DefaultType.Void,
176
+ [miniscript_core_1.Operator.Asterik]: () => default_1.DefaultType.Void,
177
+ [miniscript_core_1.Operator.Power]: () => default_1.DefaultType.Void,
178
+ [miniscript_core_1.Operator.PercentSign]: () => default_1.DefaultType.Void,
179
+ [miniscript_core_1.Operator.Equal]: (_a, b) => new boolean_1.CustomBoolean(b instanceof nil_1.CustomNil),
180
+ [miniscript_core_1.Operator.NotEqual]: (_a, b) => new boolean_1.CustomBoolean(!(b instanceof nil_1.CustomNil))
181
181
  };
182
182
  exports.FunctionProcessorHandler = {
183
- [greyscript_core_1.Operator.Equal]: (a, b) => new boolean_1.CustomBoolean(a === b),
184
- [greyscript_core_1.Operator.NotEqual]: (a, b) => new boolean_1.CustomBoolean(a !== b)
183
+ [miniscript_core_1.Operator.Equal]: (a, b) => new boolean_1.CustomBoolean(a === b),
184
+ [miniscript_core_1.Operator.NotEqual]: (a, b) => new boolean_1.CustomBoolean(a !== b)
185
185
  };
186
186
  const handleNumber = (op, a, b) => {
187
187
  if (b instanceof nil_1.CustomNil)
@@ -256,15 +256,15 @@ const handle = (op, a, b) => {
256
256
  if (b instanceof boolean_1.CustomBoolean) {
257
257
  b = new number_1.CustomNumber(b.toInt());
258
258
  }
259
- if (op === greyscript_core_1.Operator.Equal && a.getCustomType() !== b.getCustomType()) {
259
+ if (op === miniscript_core_1.Operator.Equal && a.getCustomType() !== b.getCustomType()) {
260
260
  return default_1.DefaultType.False;
261
261
  }
262
- else if (op === greyscript_core_1.Operator.NotEqual &&
262
+ else if (op === miniscript_core_1.Operator.NotEqual &&
263
263
  a.getCustomType() !== b.getCustomType()) {
264
264
  return default_1.DefaultType.True;
265
265
  }
266
266
  if ((a instanceof string_1.CustomString || b instanceof string_1.CustomString) &&
267
- op === greyscript_core_1.Operator.Plus) {
267
+ op === miniscript_core_1.Operator.Plus) {
268
268
  return (0, exports.handleString)(op, a, b);
269
269
  }
270
270
  else if (a instanceof number_1.CustomNumber) {
@@ -312,10 +312,10 @@ class Evaluate extends operation_1.Operation {
312
312
  resolveLogicalExpression(ctx, expr) {
313
313
  return __awaiter(this, void 0, void 0, function* () {
314
314
  const left = yield this.resolve(ctx, expr.left);
315
- if (expr.op === greyscript_core_1.Operator.And && !left.toTruthy()) {
315
+ if (expr.op === miniscript_core_1.Operator.And && !left.toTruthy()) {
316
316
  return new boolean_1.CustomBoolean(false);
317
317
  }
318
- else if (expr.op === greyscript_core_1.Operator.Or && left.toTruthy()) {
318
+ else if (expr.op === miniscript_core_1.Operator.Or && left.toTruthy()) {
319
319
  return new boolean_1.CustomBoolean(true);
320
320
  }
321
321
  const right = yield this.resolve(ctx, expr.right);
@@ -327,14 +327,14 @@ class Evaluate extends operation_1.Operation {
327
327
  if (op instanceof Evaluate) {
328
328
  const expr = op;
329
329
  switch (expr.type) {
330
- case greyscript_core_1.ASTType.IsaExpression: {
330
+ case miniscript_core_1.ASTType.IsaExpression: {
331
331
  const left = yield this.resolve(ctx, expr.left);
332
332
  const right = yield this.resolve(ctx, expr.right);
333
333
  return new boolean_1.CustomBoolean(left.instanceOf(right));
334
334
  }
335
- case greyscript_core_1.ASTType.BinaryExpression:
335
+ case miniscript_core_1.ASTType.BinaryExpression:
336
336
  return this.resolveBinaryExpression(ctx, expr);
337
- case greyscript_core_1.ASTType.LogicalExpression:
337
+ case miniscript_core_1.ASTType.LogicalExpression:
338
338
  return this.resolveLogicalExpression(ctx, expr);
339
339
  default:
340
340
  break;
@@ -1,4 +1,4 @@
1
- import { ASTForGenericStatement, ASTIdentifier } from 'greyscript-core';
1
+ import { ASTForGenericStatement, ASTIdentifier } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { Block } from './block';
@@ -1,4 +1,4 @@
1
- import { ASTUnaryExpression } from 'greyscript-core';
1
+ import { ASTUnaryExpression } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTFunctionStatement } from 'greyscript-core';
1
+ import { ASTFunctionStatement } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CustomString } from '../types/string';
@@ -10,7 +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.FunctionOperation = exports.SUPER_PROPERTY = exports.SELF_PROPERTY = void 0;
13
- const greyscript_core_1 = require("greyscript-core");
13
+ const miniscript_core_1 = require("miniscript-core");
14
14
  const context_1 = require("../context");
15
15
  const default_1 = require("../types/default");
16
16
  const function_1 = require("../types/function");
@@ -31,7 +31,7 @@ class FunctionOperation extends operation_1.Operation {
31
31
  this.block = new block_1.Block(this.item, stack);
32
32
  this.args = yield Promise.all(this.item.parameters.map((child) => __awaiter(this, void 0, void 0, function* () {
33
33
  switch (child.type) {
34
- case greyscript_core_1.ASTType.AssignmentStatement: {
34
+ case miniscript_core_1.ASTType.AssignmentStatement: {
35
35
  const assignStatement = child;
36
36
  const assignKey = assignStatement.variable;
37
37
  return {
@@ -39,7 +39,7 @@ class FunctionOperation extends operation_1.Operation {
39
39
  op: yield visit(assignStatement.init)
40
40
  };
41
41
  }
42
- case greyscript_core_1.ASTType.Identifier: {
42
+ case miniscript_core_1.ASTType.Identifier: {
43
43
  const identifierKey = child;
44
44
  return {
45
45
  name: identifierKey.name,
@@ -1,4 +1,4 @@
1
- import { ASTElseClause, ASTIfClause, ASTIfStatement } from 'greyscript-core';
1
+ import { ASTElseClause, ASTIfClause, ASTIfStatement } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { Block } from './block';
@@ -10,7 +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.IfStatement = exports.Clause = void 0;
13
- const greyscript_core_1 = require("greyscript-core");
13
+ const miniscript_core_1 = require("miniscript-core");
14
14
  const boolean_1 = require("../types/boolean");
15
15
  const default_1 = require("../types/default");
16
16
  const block_1 = require("./block");
@@ -50,14 +50,14 @@ class IfStatement extends operation_1.OperationBlock {
50
50
  for (let index = 0; index < this.item.clauses.length; index++) {
51
51
  const child = this.item.clauses[index];
52
52
  switch (child.type) {
53
- case greyscript_core_1.ASTType.IfClause:
54
- case greyscript_core_1.ASTType.IfShortcutClause:
55
- case greyscript_core_1.ASTType.ElseifClause:
56
- case greyscript_core_1.ASTType.ElseifShortcutClause:
53
+ case miniscript_core_1.ASTType.IfClause:
54
+ case miniscript_core_1.ASTType.IfShortcutClause:
55
+ case miniscript_core_1.ASTType.ElseifClause:
56
+ case miniscript_core_1.ASTType.ElseifShortcutClause:
57
57
  yield this.buildIfClause(child, visit);
58
58
  break;
59
- case greyscript_core_1.ASTType.ElseClause:
60
- case greyscript_core_1.ASTType.ElseShortcutClause:
59
+ case miniscript_core_1.ASTType.ElseClause:
60
+ case miniscript_core_1.ASTType.ElseShortcutClause:
61
61
  yield this.buildElseClause(child, visit);
62
62
  break;
63
63
  }
@@ -1,5 +1,5 @@
1
1
  import { ASTFeatureImportExpression } from 'greybel-core';
2
- import { ASTBase } from 'greyscript-core';
2
+ import { ASTBase } from 'miniscript-core';
3
3
  import { OperationContext } from '../context';
4
4
  import { CustomValue } from '../types/base';
5
5
  import { CustomString } from '../types/string';
@@ -1,4 +1,4 @@
1
- import { ASTBase } from 'greyscript-core';
1
+ import { ASTBase } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTListConstructorExpression } from 'greyscript-core';
1
+ import { ASTListConstructorExpression } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTLiteral } from 'greyscript-core';
1
+ import { ASTLiteral } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Literal = void 0;
4
- const greyscript_core_1 = require("greyscript-core");
4
+ const miniscript_core_1 = require("miniscript-core");
5
5
  const boolean_1 = require("../types/boolean");
6
6
  const default_1 = require("../types/default");
7
7
  const number_1 = require("../types/number");
@@ -14,16 +14,16 @@ class Literal extends operation_1.Operation {
14
14
  }
15
15
  build(_visit) {
16
16
  switch (this.item.type) {
17
- case greyscript_core_1.ASTType.BooleanLiteral:
17
+ case miniscript_core_1.ASTType.BooleanLiteral:
18
18
  this.value = new boolean_1.CustomBoolean(this.item.value);
19
19
  break;
20
- case greyscript_core_1.ASTType.StringLiteral:
20
+ case miniscript_core_1.ASTType.StringLiteral:
21
21
  this.value = new string_1.CustomString(this.item.value);
22
22
  break;
23
- case greyscript_core_1.ASTType.NumericLiteral:
23
+ case miniscript_core_1.ASTType.NumericLiteral:
24
24
  this.value = new number_1.CustomNumber(this.item.value);
25
25
  break;
26
- case greyscript_core_1.ASTType.NilLiteral:
26
+ case miniscript_core_1.ASTType.NilLiteral:
27
27
  this.value = default_1.DefaultType.Void;
28
28
  break;
29
29
  default:
@@ -1,4 +1,4 @@
1
- import { ASTMapConstructorExpression } from 'greyscript-core';
1
+ import { ASTMapConstructorExpression } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTUnaryExpression } from 'greyscript-core';
1
+ import { ASTUnaryExpression } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -10,7 +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.NegatedBinary = void 0;
13
- const greyscript_core_1 = require("greyscript-core");
13
+ const miniscript_core_1 = require("miniscript-core");
14
14
  const number_1 = require("../types/number");
15
15
  const operation_1 = require("./operation");
16
16
  class NegatedBinary extends operation_1.Operation {
@@ -27,9 +27,9 @@ class NegatedBinary extends operation_1.Operation {
27
27
  handle(ctx) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
29
  switch (this.item.operator) {
30
- case greyscript_core_1.Operator.Minus:
30
+ case miniscript_core_1.Operator.Minus:
31
31
  return new number_1.CustomNumber(-(yield this.arg.handle(ctx)).toNumber());
32
- case greyscript_core_1.Operator.Plus:
32
+ case miniscript_core_1.Operator.Plus:
33
33
  return new number_1.CustomNumber(+(yield this.arg.handle(ctx)).toNumber());
34
34
  default:
35
35
  throw new Error('Unexpected negation operator.');
@@ -1,4 +1,4 @@
1
- import { ASTUnaryExpression } from 'greyscript-core';
1
+ import { ASTUnaryExpression } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTUnaryExpression } from 'greyscript-core';
1
+ import { ASTUnaryExpression } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTBase } from 'greyscript-core';
1
+ import { ASTBase } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  export interface CPSVisit {
@@ -1,4 +1,4 @@
1
- import { ASTBase } from 'greyscript-core';
1
+ import { ASTBase } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CustomNil } from '../types/nil';
@@ -10,7 +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.Resolve = exports.ResolveResult = exports.ResolveNil = exports.SegmentContainer = exports.OperationSegment = exports.IndexSegment = exports.IdentifierSegment = exports.PathSegment = exports.SliceSegment = void 0;
13
- const greyscript_core_1 = require("greyscript-core");
13
+ const miniscript_core_1 = require("miniscript-core");
14
14
  const default_1 = require("../types/default");
15
15
  const function_1 = require("../types/function");
16
16
  const list_1 = require("../types/list");
@@ -105,20 +105,20 @@ class Resolve extends operation_1.Operation {
105
105
  buildProcessor(node, visit) {
106
106
  return __awaiter(this, void 0, void 0, function* () {
107
107
  switch (node.type) {
108
- case greyscript_core_1.ASTType.MemberExpression: {
108
+ case miniscript_core_1.ASTType.MemberExpression: {
109
109
  const memberExpr = node;
110
110
  yield this.buildProcessor(memberExpr.base, visit);
111
111
  yield this.buildProcessor(memberExpr.identifier, visit);
112
112
  break;
113
113
  }
114
- case greyscript_core_1.ASTType.IndexExpression: {
114
+ case miniscript_core_1.ASTType.IndexExpression: {
115
115
  const indexExpr = node;
116
116
  yield this.buildProcessor(indexExpr.base, visit);
117
117
  const indexSegment = new IndexSegment(yield visit(indexExpr.index));
118
118
  this.path.push(indexSegment);
119
119
  break;
120
120
  }
121
- case greyscript_core_1.ASTType.SliceExpression: {
121
+ case miniscript_core_1.ASTType.SliceExpression: {
122
122
  const sliceExpr = node;
123
123
  yield this.buildProcessor(sliceExpr.base, visit);
124
124
  const left = yield visit(sliceExpr.left);
@@ -127,7 +127,7 @@ class Resolve extends operation_1.Operation {
127
127
  this.path.push(sliceSegment);
128
128
  break;
129
129
  }
130
- case greyscript_core_1.ASTType.Identifier: {
130
+ case miniscript_core_1.ASTType.Identifier: {
131
131
  const identifier = node;
132
132
  const identifierSegment = new IdentifierSegment(identifier.name);
133
133
  this.path.push(identifierSegment);
@@ -1,4 +1,4 @@
1
- import { ASTReturnStatement } from 'greyscript-core';
1
+ import { ASTReturnStatement } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { CPSVisit, Operation } from './operation';
@@ -1,4 +1,4 @@
1
- import { ASTWhileStatement } from 'greyscript-core';
1
+ import { ASTWhileStatement } from 'miniscript-core';
2
2
  import { OperationContext } from '../context';
3
3
  import { CustomValue } from '../types/base';
4
4
  import { Block } from './block';
@@ -1,4 +1,4 @@
1
- import { ASTRange } from 'greyscript-core';
1
+ import { ASTRange } from 'miniscript-core';
2
2
  import { Operation } from '../operations/operation';
3
3
  interface RuntimeContext {
4
4
  stackTrace?: Operation[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "2.2.19",
3
+ "version": "3.0.0",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",
@@ -48,11 +48,9 @@
48
48
  "typescript": "^5.0.4"
49
49
  },
50
50
  "dependencies": {
51
- "greybel-core": "^0.9.11",
52
- "greyscript-core": "^0.9.12"
51
+ "greybel-core": "^1.0.0"
53
52
  },
54
53
  "keywords": [
55
- "greyscript",
56
- "greyhack"
54
+ "miniscript"
57
55
  ]
58
56
  }