greybel-interpreter 1.1.7 → 1.2.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 (97) hide show
  1. package/.editorconfig +14 -14
  2. package/.eslintrc +47 -47
  3. package/LICENSE +21 -21
  4. package/README.md +2 -2
  5. package/dist/context.d.ts +109 -109
  6. package/dist/context.js +382 -382
  7. package/dist/cps.d.ts +14 -14
  8. package/dist/cps.js +213 -213
  9. package/dist/handler/error.d.ts +6 -6
  10. package/dist/handler/error.js +35 -35
  11. package/dist/handler/output.d.ts +6 -6
  12. package/dist/handler/output.js +35 -35
  13. package/dist/handler/resource.d.ts +12 -12
  14. package/dist/handler/resource.js +51 -51
  15. package/dist/handler-container.d.ts +14 -14
  16. package/dist/handler-container.js +16 -16
  17. package/dist/index.d.ts +44 -44
  18. package/dist/index.js +129 -129
  19. package/dist/interpreter.d.ts +41 -41
  20. package/dist/interpreter.js +315 -315
  21. package/dist/intrinsics-container.d.ts +7 -7
  22. package/dist/intrinsics-container.js +19 -19
  23. package/dist/operations/assign.d.ts +13 -13
  24. package/dist/operations/assign.js +111 -111
  25. package/dist/operations/block.d.ts +12 -12
  26. package/dist/operations/block.js +108 -108
  27. package/dist/operations/break.d.ts +10 -10
  28. package/dist/operations/break.js +41 -41
  29. package/dist/operations/call.d.ts +13 -13
  30. package/dist/operations/call.js +124 -124
  31. package/dist/operations/chunk.d.ts +12 -12
  32. package/dist/operations/chunk.js +85 -85
  33. package/dist/operations/continue.d.ts +10 -10
  34. package/dist/operations/continue.js +41 -41
  35. package/dist/operations/debugger-statement.d.ts +10 -10
  36. package/dist/operations/debugger-statement.js +39 -39
  37. package/dist/operations/evaluate.d.ts +39 -39
  38. package/dist/operations/evaluate.js +366 -366
  39. package/dist/operations/for.d.ts +14 -14
  40. package/dist/operations/for.js +152 -152
  41. package/dist/operations/function-reference.d.ts +12 -12
  42. package/dist/operations/function-reference.js +103 -103
  43. package/dist/operations/function.d.ts +14 -14
  44. package/dist/operations/function.js +200 -200
  45. package/dist/operations/if-statement.d.ts +19 -19
  46. package/dist/operations/if-statement.js +181 -181
  47. package/dist/operations/import.d.ts +17 -17
  48. package/dist/operations/import.js +119 -119
  49. package/dist/operations/include.d.ts +13 -13
  50. package/dist/operations/include.js +95 -95
  51. package/dist/operations/list.d.ts +11 -11
  52. package/dist/operations/list.js +111 -111
  53. package/dist/operations/literal.d.ts +11 -11
  54. package/dist/operations/literal.js +58 -58
  55. package/dist/operations/map.d.ts +11 -11
  56. package/dist/operations/map.js +171 -171
  57. package/dist/operations/negated-binary.d.ts +11 -11
  58. package/dist/operations/negated-binary.js +109 -109
  59. package/dist/operations/new-instance.d.ts +11 -11
  60. package/dist/operations/new-instance.js +100 -100
  61. package/dist/operations/noop.d.ts +9 -9
  62. package/dist/operations/noop.js +36 -36
  63. package/dist/operations/not.d.ts +11 -11
  64. package/dist/operations/not.js +96 -96
  65. package/dist/operations/operation.d.ts +13 -13
  66. package/dist/operations/operation.js +11 -11
  67. package/dist/operations/reference.d.ts +9 -9
  68. package/dist/operations/reference.js +37 -37
  69. package/dist/operations/resolve.d.ts +38 -38
  70. package/dist/operations/resolve.js +330 -330
  71. package/dist/operations/return.d.ts +11 -11
  72. package/dist/operations/return.js +107 -107
  73. package/dist/operations/while.d.ts +13 -13
  74. package/dist/operations/while.js +136 -136
  75. package/dist/types/boolean.d.ts +11 -11
  76. package/dist/types/boolean.js +46 -46
  77. package/dist/types/default.d.ts +11 -11
  78. package/dist/types/default.js +20 -20
  79. package/dist/types/function.d.ts +32 -32
  80. package/dist/types/function.js +174 -174
  81. package/dist/types/generics.d.ts +18 -18
  82. package/dist/types/generics.js +40 -40
  83. package/dist/types/interface.d.ts +23 -23
  84. package/dist/types/interface.js +103 -103
  85. package/dist/types/list.d.ts +31 -31
  86. package/dist/types/list.js +209 -209
  87. package/dist/types/map.d.ts +35 -35
  88. package/dist/types/map.js +287 -287
  89. package/dist/types/nil.d.ts +10 -10
  90. package/dist/types/nil.js +46 -46
  91. package/dist/types/number.d.ts +11 -11
  92. package/dist/types/number.js +46 -46
  93. package/dist/types/string.d.ts +33 -33
  94. package/dist/types/string.js +145 -145
  95. package/dist/utils/path.d.ts +10 -10
  96. package/dist/utils/path.js +59 -59
  97. package/package.json +58 -58
@@ -1,41 +1,41 @@
1
- /// <reference types="node" />
2
- import EventEmitter from 'events';
3
- import OperationContext, { Debugger } from './context';
4
- import CPS from './cps';
5
- import HandlerContainer from './handler-container';
6
- import Operation from './operations/operation';
7
- import { CustomValue } from './types/generics';
8
- import CustomString from './types/string';
9
- export declare const PARAMS_PROPERTY: CustomString;
10
- export interface InterpreterOptions {
11
- target?: string;
12
- api?: Map<string, CustomValue>;
13
- params?: Array<string>;
14
- handler?: HandlerContainer;
15
- debugger?: Debugger;
16
- }
17
- export default class Interpreter extends EventEmitter {
18
- target: string;
19
- api: Map<string, CustomValue>;
20
- params: Array<string>;
21
- handler: HandlerContainer;
22
- debugger: Debugger;
23
- apiContext: OperationContext;
24
- globalContext: OperationContext;
25
- cps: CPS;
26
- constructor(options: InterpreterOptions);
27
- setTarget(target: string): Interpreter;
28
- setDebugger(dbgr: Debugger): Interpreter;
29
- setApi(newApi: Map<string, CustomValue>): Interpreter;
30
- setHandler(handler: HandlerContainer): Interpreter;
31
- prepare(code: string): Promise<Operation>;
32
- inject(code: string, context?: OperationContext): Promise<Interpreter>;
33
- injectInLastContext(code: string): Promise<Interpreter>;
34
- run(customCode?: string): Promise<Interpreter>;
35
- start(top: Operation): Promise<Interpreter>;
36
- resume(): Interpreter;
37
- pause(): Interpreter;
38
- exit(): Promise<OperationContext>;
39
- setGlobalVariable(path: string, value: CustomValue): Interpreter;
40
- getGlobalVariable(path: string): CustomValue;
41
- }
1
+ /// <reference types="node" />
2
+ import EventEmitter from 'events';
3
+ import OperationContext, { Debugger } from './context';
4
+ import CPS from './cps';
5
+ import HandlerContainer from './handler-container';
6
+ import Operation from './operations/operation';
7
+ import { CustomValue } from './types/generics';
8
+ import CustomString from './types/string';
9
+ export declare const PARAMS_PROPERTY: CustomString;
10
+ export interface InterpreterOptions {
11
+ target?: string;
12
+ api?: Map<string, CustomValue>;
13
+ params?: Array<string>;
14
+ handler?: HandlerContainer;
15
+ debugger?: Debugger;
16
+ }
17
+ export default class Interpreter extends EventEmitter {
18
+ target: string;
19
+ api: Map<string, CustomValue>;
20
+ params: Array<string>;
21
+ handler: HandlerContainer;
22
+ debugger: Debugger;
23
+ apiContext: OperationContext;
24
+ globalContext: OperationContext;
25
+ cps: CPS;
26
+ constructor(options: InterpreterOptions);
27
+ setTarget(target: string): Interpreter;
28
+ setDebugger(dbgr: Debugger): Interpreter;
29
+ setApi(newApi: Map<string, CustomValue>): Interpreter;
30
+ setHandler(handler: HandlerContainer): Interpreter;
31
+ prepare(code: string): Promise<Operation>;
32
+ inject(code: string, context?: OperationContext): Promise<Interpreter>;
33
+ injectInLastContext(code: string): Promise<Interpreter>;
34
+ run(customCode?: string): Promise<Interpreter>;
35
+ start(top: Operation): Promise<Interpreter>;
36
+ resume(): Interpreter;
37
+ pause(): Interpreter;
38
+ exit(): Promise<OperationContext>;
39
+ setGlobalVariable(path: string, value: CustomValue): Interpreter;
40
+ getGlobalVariable(path: string): CustomValue;
41
+ }