greybel-interpreter 0.3.3 → 0.3.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.
package/dist/context.d.ts CHANGED
@@ -2,6 +2,7 @@ import CustomMap from './custom-types/map';
2
2
  import { Operation } from './types/operation';
3
3
  import { Expression } from './types/expression';
4
4
  import { Callable } from './types/custom-type';
5
+ import { ASTPosition } from 'greyscript-core';
5
6
  import CPS from './cps';
6
7
  export declare enum ContextType {
7
8
  API = "API",
@@ -59,7 +60,7 @@ export interface OperationContextForkOptions {
59
60
  }
60
61
  export declare class OperationContext {
61
62
  target: string;
62
- line: number;
63
+ line: ASTPosition;
63
64
  debugger: Debugger;
64
65
  previous: OperationContext | null;
65
66
  type: ContextType;
package/dist/context.js CHANGED
@@ -292,7 +292,10 @@ var OperationContext = /** @class */ (function () {
292
292
  function OperationContext(options) {
293
293
  var me = this;
294
294
  me.target = options.target || 'unknown';
295
- me.line = -1;
295
+ me.line = {
296
+ line: 0,
297
+ character: 0
298
+ };
296
299
  me.previous = options.previous || null;
297
300
  me.type = options.type || ContextType.API;
298
301
  me.state = options.state || ContextState.DEFAULT;
@@ -21,6 +21,7 @@ export default class Interpreter extends EventEmitter {
21
21
  cps: CPS;
22
22
  constructor(options: InterpreterOptions);
23
23
  setTarget(target: string): Interpreter;
24
+ setDebugger(dbgr: Debugger): Interpreter;
24
25
  inject(code: string): Promise<Interpreter>;
25
26
  digest(customCode?: string): Promise<Interpreter>;
26
27
  exit(): Promise<OperationContext>;
@@ -92,6 +92,13 @@ var Interpreter = /** @class */ (function (_super) {
92
92
  });
93
93
  return me;
94
94
  };
95
+ Interpreter.prototype.setDebugger = function (dbgr) {
96
+ var me = this;
97
+ me.debugger = dbgr;
98
+ me.apiContext.debugger = dbgr;
99
+ me.globalContext.debugger = dbgr;
100
+ return me;
101
+ };
95
102
  Interpreter.prototype.inject = function (code) {
96
103
  return __awaiter(this, void 0, void 0, function () {
97
104
  var me, parser, chunk, body, context, err_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "0.3.3",
3
+ "version": "0.3.7",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",
@@ -35,8 +35,6 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "greybel-core": "^0.1.9",
38
- "greybel-interpreter": "^0.3.1",
39
- "greybel-intrinsics": "^0.2.1",
40
38
  "greyscript-core": "^0.1.7",
41
39
  "uuid": "^8.3.2"
42
40
  },