greybel-interpreter 1.3.6 → 1.3.8
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/.editorconfig +14 -14
- package/.eslintrc +47 -47
- package/LICENSE +21 -21
- package/README.md +2 -2
- package/dist/context.d.ts +109 -109
- package/dist/context.js +383 -382
- package/dist/cps.d.ts +14 -14
- package/dist/cps.js +213 -213
- package/dist/handler/error.d.ts +6 -6
- package/dist/handler/error.js +35 -35
- package/dist/handler/output.d.ts +18 -18
- package/dist/handler/output.js +52 -52
- package/dist/handler/resource.d.ts +12 -12
- package/dist/handler/resource.js +51 -51
- package/dist/handler-container.d.ts +14 -14
- package/dist/handler-container.js +16 -16
- package/dist/index.d.ts +45 -45
- package/dist/index.js +131 -131
- package/dist/interpreter.d.ts +41 -41
- package/dist/interpreter.js +312 -312
- package/dist/intrinsics-container.d.ts +7 -7
- package/dist/intrinsics-container.js +19 -19
- package/dist/operations/assign.d.ts +13 -13
- package/dist/operations/assign.js +111 -111
- package/dist/operations/block.d.ts +12 -12
- package/dist/operations/block.js +108 -108
- package/dist/operations/break.d.ts +10 -10
- package/dist/operations/break.js +41 -41
- package/dist/operations/call.d.ts +13 -13
- package/dist/operations/call.js +124 -124
- package/dist/operations/chunk.d.ts +12 -12
- package/dist/operations/chunk.js +85 -85
- package/dist/operations/continue.d.ts +10 -10
- package/dist/operations/continue.js +41 -41
- package/dist/operations/debugger-statement.d.ts +10 -10
- package/dist/operations/debugger-statement.js +39 -39
- package/dist/operations/evaluate.d.ts +41 -39
- package/dist/operations/evaluate.js +433 -367
- package/dist/operations/for.d.ts +14 -14
- package/dist/operations/for.js +152 -152
- package/dist/operations/function-reference.d.ts +12 -12
- package/dist/operations/function-reference.js +103 -103
- package/dist/operations/function.d.ts +14 -14
- package/dist/operations/function.js +200 -200
- package/dist/operations/if-statement.d.ts +19 -19
- package/dist/operations/if-statement.js +181 -181
- package/dist/operations/import.d.ts +17 -17
- package/dist/operations/import.js +119 -119
- package/dist/operations/include.d.ts +13 -13
- package/dist/operations/include.js +95 -95
- package/dist/operations/list.d.ts +11 -11
- package/dist/operations/list.js +111 -111
- package/dist/operations/literal.d.ts +11 -11
- package/dist/operations/literal.js +58 -58
- package/dist/operations/map.d.ts +11 -11
- package/dist/operations/map.js +171 -171
- package/dist/operations/negated-binary.d.ts +11 -11
- package/dist/operations/negated-binary.js +109 -109
- package/dist/operations/new-instance.d.ts +11 -11
- package/dist/operations/new-instance.js +100 -100
- package/dist/operations/noop.d.ts +9 -9
- package/dist/operations/noop.js +36 -36
- package/dist/operations/not.d.ts +11 -11
- package/dist/operations/not.js +96 -96
- package/dist/operations/operation.d.ts +13 -13
- package/dist/operations/operation.js +11 -11
- package/dist/operations/reference.d.ts +9 -9
- package/dist/operations/reference.js +37 -37
- package/dist/operations/resolve.d.ts +38 -38
- package/dist/operations/resolve.js +330 -330
- package/dist/operations/return.d.ts +11 -11
- package/dist/operations/return.js +107 -107
- package/dist/operations/while.d.ts +13 -13
- package/dist/operations/while.js +136 -136
- package/dist/types/boolean.d.ts +11 -11
- package/dist/types/boolean.js +46 -46
- package/dist/types/default.d.ts +11 -11
- package/dist/types/default.js +20 -20
- package/dist/types/function.d.ts +32 -32
- package/dist/types/function.js +174 -174
- package/dist/types/generics.d.ts +18 -18
- package/dist/types/generics.js +40 -40
- package/dist/types/interface.d.ts +23 -23
- package/dist/types/interface.js +103 -103
- package/dist/types/list.d.ts +31 -31
- package/dist/types/list.js +209 -209
- package/dist/types/map.d.ts +37 -37
- package/dist/types/map.js +366 -366
- package/dist/types/nil.d.ts +10 -10
- package/dist/types/nil.js +46 -46
- package/dist/types/number.d.ts +11 -11
- package/dist/types/number.js +46 -46
- package/dist/types/string.d.ts +33 -33
- package/dist/types/string.js +145 -145
- package/dist/utils/deep-equal.d.ts +1 -1
- package/dist/utils/deep-equal.js +62 -62
- package/dist/utils/path.d.ts +10 -10
- package/dist/utils/path.js +59 -59
- package/package.json +58 -58
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
var default_1 = __importDefault(require("../types/default"));
|
|
22
|
-
var operation_1 = __importDefault(require("./operation"));
|
|
23
|
-
var DebuggerStatement = /** @class */ (function (_super) {
|
|
24
|
-
__extends(DebuggerStatement, _super);
|
|
25
|
-
function DebuggerStatement(item, target) {
|
|
26
|
-
var _this = _super.call(this, null, target) || this;
|
|
27
|
-
_this.item = item;
|
|
28
|
-
return _this;
|
|
29
|
-
}
|
|
30
|
-
DebuggerStatement.prototype.build = function (_visit) {
|
|
31
|
-
return Promise.resolve(this);
|
|
32
|
-
};
|
|
33
|
-
DebuggerStatement.prototype.handle = function (ctx) {
|
|
34
|
-
ctx.debugger.setBreakpoint(true);
|
|
35
|
-
return Promise.resolve(default_1.default.Void);
|
|
36
|
-
};
|
|
37
|
-
return DebuggerStatement;
|
|
38
|
-
}(operation_1.default));
|
|
39
|
-
exports.default = DebuggerStatement;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
var default_1 = __importDefault(require("../types/default"));
|
|
22
|
+
var operation_1 = __importDefault(require("./operation"));
|
|
23
|
+
var DebuggerStatement = /** @class */ (function (_super) {
|
|
24
|
+
__extends(DebuggerStatement, _super);
|
|
25
|
+
function DebuggerStatement(item, target) {
|
|
26
|
+
var _this = _super.call(this, null, target) || this;
|
|
27
|
+
_this.item = item;
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
DebuggerStatement.prototype.build = function (_visit) {
|
|
31
|
+
return Promise.resolve(this);
|
|
32
|
+
};
|
|
33
|
+
DebuggerStatement.prototype.handle = function (ctx) {
|
|
34
|
+
ctx.debugger.setBreakpoint(true);
|
|
35
|
+
return Promise.resolve(default_1.default.Void);
|
|
36
|
+
};
|
|
37
|
+
return DebuggerStatement;
|
|
38
|
+
}(operation_1.default));
|
|
39
|
+
exports.default = DebuggerStatement;
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { ASTEvaluationExpression } from 'greyscript-core';
|
|
2
|
-
import OperationContext from '../context';
|
|
3
|
-
import { CustomValue } from '../types/generics';
|
|
4
|
-
import Operation, { CPSVisit } from './operation';
|
|
5
|
-
export interface ProcessorHandlerFunction {
|
|
6
|
-
(op: string, a: CustomValue, b: CustomValue): CustomValue;
|
|
7
|
-
}
|
|
8
|
-
export interface ProcessorHandler {
|
|
9
|
-
[op: string]: (a: CustomValue, b: CustomValue) => CustomValue;
|
|
10
|
-
}
|
|
11
|
-
export declare const GenericProcessorHandler: ProcessorHandler;
|
|
12
|
-
export declare const NumberProcessorHandler: ProcessorHandler;
|
|
13
|
-
export declare const multiplyString: (a: CustomValue, b: CustomValue) => CustomValue;
|
|
14
|
-
export declare const StringProcessorHandler: ProcessorHandler;
|
|
15
|
-
export declare const ListProcessorHandler: ProcessorHandler;
|
|
16
|
-
export declare const MapProcessorHandler: ProcessorHandler;
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { ASTEvaluationExpression } from 'greyscript-core';
|
|
2
|
+
import OperationContext from '../context';
|
|
3
|
+
import { CustomValue } from '../types/generics';
|
|
4
|
+
import Operation, { CPSVisit } from './operation';
|
|
5
|
+
export interface ProcessorHandlerFunction {
|
|
6
|
+
(op: string, a: CustomValue, b: CustomValue): CustomValue;
|
|
7
|
+
}
|
|
8
|
+
export interface ProcessorHandler {
|
|
9
|
+
[op: string]: (a: CustomValue, b: CustomValue) => CustomValue;
|
|
10
|
+
}
|
|
11
|
+
export declare const GenericProcessorHandler: ProcessorHandler;
|
|
12
|
+
export declare const NumberProcessorHandler: ProcessorHandler;
|
|
13
|
+
export declare const multiplyString: (a: CustomValue, b: CustomValue) => CustomValue;
|
|
14
|
+
export declare const StringProcessorHandler: ProcessorHandler;
|
|
15
|
+
export declare const ListProcessorHandler: ProcessorHandler;
|
|
16
|
+
export declare const MapProcessorHandler: ProcessorHandler;
|
|
17
|
+
export declare const InterfaceProcessorHandler: ProcessorHandler;
|
|
18
|
+
export declare const NilProcessorHandler: ProcessorHandler;
|
|
19
|
+
export declare const FunctionProcessorHandler: ProcessorHandler;
|
|
20
|
+
export declare const handleNumber: ProcessorHandlerFunction;
|
|
21
|
+
export declare const handleString: ProcessorHandlerFunction;
|
|
22
|
+
export declare const handleBoolean: ProcessorHandlerFunction;
|
|
23
|
+
export declare const handleList: ProcessorHandlerFunction;
|
|
24
|
+
export declare const handleMap: ProcessorHandlerFunction;
|
|
25
|
+
export declare const handleInterface: ProcessorHandlerFunction;
|
|
26
|
+
export declare const handleNil: ProcessorHandlerFunction;
|
|
27
|
+
export declare const handleFunction: ProcessorHandlerFunction;
|
|
28
|
+
export declare const handle: (op: string, a: CustomValue, b: CustomValue) => CustomValue;
|
|
29
|
+
export default class Evaluate extends Operation {
|
|
30
|
+
readonly item: ASTEvaluationExpression;
|
|
31
|
+
type: string;
|
|
32
|
+
op: string;
|
|
33
|
+
left: Operation;
|
|
34
|
+
right: Operation;
|
|
35
|
+
constructor(item: ASTEvaluationExpression, target?: string);
|
|
36
|
+
build(visit: CPSVisit): Promise<Operation>;
|
|
37
|
+
resolveBinaryExpression(ctx: OperationContext, expr: Evaluate): Promise<CustomValue>;
|
|
38
|
+
resolveLogicalExpression(ctx: OperationContext, expr: Evaluate): Promise<CustomValue>;
|
|
39
|
+
resolve(ctx: OperationContext, op: Operation): Promise<CustomValue>;
|
|
40
|
+
handle(ctx: OperationContext): Promise<CustomValue>;
|
|
41
|
+
}
|