greybel-interpreter 0.4.8 → 0.5.2
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/LICENSE +21 -21
- package/README.md +2 -2
- package/dist/context.d.ts +96 -96
- package/dist/context.js +392 -392
- package/dist/cps.d.ts +15 -15
- package/dist/cps.js +849 -849
- package/dist/custom-types/boolean.d.ts +10 -10
- package/dist/custom-types/boolean.js +41 -41
- package/dist/custom-types/list.d.ts +25 -25
- package/dist/custom-types/list.js +288 -292
- package/dist/custom-types/map.d.ts +28 -28
- package/dist/custom-types/map.js +238 -238
- package/dist/custom-types/nil.d.ts +8 -8
- package/dist/custom-types/nil.js +38 -38
- package/dist/custom-types/number.d.ts +10 -10
- package/dist/custom-types/number.js +41 -41
- package/dist/custom-types/string.d.ts +21 -21
- package/dist/custom-types/string.js +131 -131
- package/dist/expressions/assign.d.ts +13 -13
- package/dist/expressions/assign.js +174 -174
- package/dist/expressions/binary-negated-expression.d.ts +19 -19
- package/dist/expressions/binary-negated-expression.js +131 -131
- package/dist/expressions/call.d.ts +14 -14
- package/dist/expressions/call.js +207 -207
- package/dist/expressions/import.d.ts +14 -14
- package/dist/expressions/import.js +155 -155
- package/dist/expressions/include.d.ts +13 -13
- package/dist/expressions/include.js +132 -132
- package/dist/expressions/list.d.ts +14 -14
- package/dist/expressions/list.js +134 -134
- package/dist/expressions/logical-and-binary.d.ts +23 -23
- package/dist/expressions/logical-and-binary.js +216 -212
- package/dist/expressions/map.d.ts +19 -19
- package/dist/expressions/map.js +190 -190
- package/dist/expressions/path.d.ts +31 -31
- package/dist/expressions/path.js +364 -364
- package/dist/index.d.ts +36 -36
- package/dist/index.js +89 -89
- package/dist/interpreter.d.ts +29 -29
- package/dist/interpreter.js +210 -210
- package/dist/operations/argument.d.ts +8 -8
- package/dist/operations/argument.js +145 -145
- package/dist/operations/body.d.ts +8 -8
- package/dist/operations/body.js +140 -140
- package/dist/operations/break.d.ts +7 -7
- package/dist/operations/break.js +34 -34
- package/dist/operations/continue.d.ts +7 -7
- package/dist/operations/continue.js +34 -34
- package/dist/operations/debugger.d.ts +7 -7
- package/dist/operations/debugger.js +32 -32
- package/dist/operations/else-if.d.ts +12 -12
- package/dist/operations/else-if.js +31 -31
- package/dist/operations/else.d.ts +10 -10
- package/dist/operations/else.js +30 -30
- package/dist/operations/for.d.ts +16 -16
- package/dist/operations/for.js +143 -143
- package/dist/operations/function.d.ts +21 -21
- package/dist/operations/function.js +133 -133
- package/dist/operations/if-statement.d.ts +8 -8
- package/dist/operations/if-statement.js +153 -153
- package/dist/operations/if.d.ts +12 -12
- package/dist/operations/if.js +31 -31
- package/dist/operations/new.d.ts +11 -11
- package/dist/operations/new.js +96 -96
- package/dist/operations/not.d.ts +11 -11
- package/dist/operations/not.js +95 -95
- package/dist/operations/reference.d.ts +11 -11
- package/dist/operations/reference.js +102 -102
- package/dist/operations/return.d.ts +11 -11
- package/dist/operations/return.js +102 -102
- package/dist/operations/while.d.ts +14 -14
- package/dist/operations/while.js +127 -127
- package/dist/resource.d.ts +9 -9
- package/dist/resource.js +29 -29
- package/dist/typer.d.ts +6 -6
- package/dist/typer.js +95 -95
- package/dist/types/custom-type.d.ts +19 -19
- package/dist/types/custom-type.js +58 -58
- package/dist/types/expression.d.ts +6 -6
- package/dist/types/expression.js +9 -9
- package/dist/types/operation.d.ts +9 -9
- package/dist/types/operation.js +38 -38
- package/package.json +45 -45
package/dist/typer.js
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.cast = exports.isCustomNumber = exports.isCustomString = exports.isCustomList = exports.isCustomMap = exports.isCustomValue = void 0;
|
|
23
|
-
var boolean_1 = __importDefault(require("./custom-types/boolean"));
|
|
24
|
-
var list_1 = __importDefault(require("./custom-types/list"));
|
|
25
|
-
var map_1 = __importDefault(require("./custom-types/map"));
|
|
26
|
-
var nil_1 = __importDefault(require("./custom-types/nil"));
|
|
27
|
-
var number_1 = __importDefault(require("./custom-types/number"));
|
|
28
|
-
var string_1 = __importDefault(require("./custom-types/string"));
|
|
29
|
-
var operation_1 = require("./types/operation");
|
|
30
|
-
var isCustomValue = function (value) {
|
|
31
|
-
return value instanceof boolean_1.default ||
|
|
32
|
-
value instanceof number_1.default ||
|
|
33
|
-
value instanceof list_1.default ||
|
|
34
|
-
value instanceof map_1.default ||
|
|
35
|
-
value instanceof nil_1.default ||
|
|
36
|
-
value instanceof string_1.default;
|
|
37
|
-
};
|
|
38
|
-
exports.isCustomValue = isCustomValue;
|
|
39
|
-
var isCustomMap = function (value) {
|
|
40
|
-
return value instanceof map_1.default;
|
|
41
|
-
};
|
|
42
|
-
exports.isCustomMap = isCustomMap;
|
|
43
|
-
var isCustomList = function (value) {
|
|
44
|
-
return value instanceof list_1.default;
|
|
45
|
-
};
|
|
46
|
-
exports.isCustomList = isCustomList;
|
|
47
|
-
var isCustomString = function (value) {
|
|
48
|
-
return value instanceof string_1.default;
|
|
49
|
-
};
|
|
50
|
-
exports.isCustomString = isCustomString;
|
|
51
|
-
var isCustomNumber = function (value) {
|
|
52
|
-
return value instanceof number_1.default;
|
|
53
|
-
};
|
|
54
|
-
exports.isCustomNumber = isCustomNumber;
|
|
55
|
-
var cast = function (value) {
|
|
56
|
-
if (value == null)
|
|
57
|
-
return new nil_1.default();
|
|
58
|
-
if ((0, exports.isCustomValue)(value) || value instanceof operation_1.Operation) {
|
|
59
|
-
return value;
|
|
60
|
-
}
|
|
61
|
-
var type = typeof value;
|
|
62
|
-
if (type === 'string') {
|
|
63
|
-
return new string_1.default(value);
|
|
64
|
-
}
|
|
65
|
-
else if (type === 'number') {
|
|
66
|
-
return new number_1.default(value);
|
|
67
|
-
}
|
|
68
|
-
else if (type === 'boolean') {
|
|
69
|
-
return new boolean_1.default(value);
|
|
70
|
-
}
|
|
71
|
-
else if (type === 'object') {
|
|
72
|
-
if (Array.isArray(value)) {
|
|
73
|
-
value = value.map(exports.cast);
|
|
74
|
-
return new list_1.default(value);
|
|
75
|
-
}
|
|
76
|
-
var result_1 = new Map();
|
|
77
|
-
if (value instanceof Map) {
|
|
78
|
-
value.forEach(function (item, key) {
|
|
79
|
-
result_1.set(key, (0, exports.cast)(item));
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
Object.entries(value).forEach(function (_a) {
|
|
84
|
-
var _b = __read(_a, 2), key = _b[0], item = _b[1];
|
|
85
|
-
result_1.set(key, (0, exports.cast)(item));
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
return new map_1.default(result_1);
|
|
89
|
-
}
|
|
90
|
-
else if (type === 'function') {
|
|
91
|
-
return value;
|
|
92
|
-
}
|
|
93
|
-
throw new Error("Unexpected type ".concat(type));
|
|
94
|
-
};
|
|
95
|
-
exports.cast = cast;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.cast = exports.isCustomNumber = exports.isCustomString = exports.isCustomList = exports.isCustomMap = exports.isCustomValue = void 0;
|
|
23
|
+
var boolean_1 = __importDefault(require("./custom-types/boolean"));
|
|
24
|
+
var list_1 = __importDefault(require("./custom-types/list"));
|
|
25
|
+
var map_1 = __importDefault(require("./custom-types/map"));
|
|
26
|
+
var nil_1 = __importDefault(require("./custom-types/nil"));
|
|
27
|
+
var number_1 = __importDefault(require("./custom-types/number"));
|
|
28
|
+
var string_1 = __importDefault(require("./custom-types/string"));
|
|
29
|
+
var operation_1 = require("./types/operation");
|
|
30
|
+
var isCustomValue = function (value) {
|
|
31
|
+
return value instanceof boolean_1.default ||
|
|
32
|
+
value instanceof number_1.default ||
|
|
33
|
+
value instanceof list_1.default ||
|
|
34
|
+
value instanceof map_1.default ||
|
|
35
|
+
value instanceof nil_1.default ||
|
|
36
|
+
value instanceof string_1.default;
|
|
37
|
+
};
|
|
38
|
+
exports.isCustomValue = isCustomValue;
|
|
39
|
+
var isCustomMap = function (value) {
|
|
40
|
+
return value instanceof map_1.default;
|
|
41
|
+
};
|
|
42
|
+
exports.isCustomMap = isCustomMap;
|
|
43
|
+
var isCustomList = function (value) {
|
|
44
|
+
return value instanceof list_1.default;
|
|
45
|
+
};
|
|
46
|
+
exports.isCustomList = isCustomList;
|
|
47
|
+
var isCustomString = function (value) {
|
|
48
|
+
return value instanceof string_1.default;
|
|
49
|
+
};
|
|
50
|
+
exports.isCustomString = isCustomString;
|
|
51
|
+
var isCustomNumber = function (value) {
|
|
52
|
+
return value instanceof number_1.default;
|
|
53
|
+
};
|
|
54
|
+
exports.isCustomNumber = isCustomNumber;
|
|
55
|
+
var cast = function (value) {
|
|
56
|
+
if (value == null)
|
|
57
|
+
return new nil_1.default();
|
|
58
|
+
if ((0, exports.isCustomValue)(value) || value instanceof operation_1.Operation) {
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
var type = typeof value;
|
|
62
|
+
if (type === 'string') {
|
|
63
|
+
return new string_1.default(value);
|
|
64
|
+
}
|
|
65
|
+
else if (type === 'number') {
|
|
66
|
+
return new number_1.default(value);
|
|
67
|
+
}
|
|
68
|
+
else if (type === 'boolean') {
|
|
69
|
+
return new boolean_1.default(value);
|
|
70
|
+
}
|
|
71
|
+
else if (type === 'object') {
|
|
72
|
+
if (Array.isArray(value)) {
|
|
73
|
+
value = value.map(exports.cast);
|
|
74
|
+
return new list_1.default(value);
|
|
75
|
+
}
|
|
76
|
+
var result_1 = new Map();
|
|
77
|
+
if (value instanceof Map) {
|
|
78
|
+
value.forEach(function (item, key) {
|
|
79
|
+
result_1.set(key, (0, exports.cast)(item));
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
Object.entries(value).forEach(function (_a) {
|
|
84
|
+
var _b = __read(_a, 2), key = _b[0], item = _b[1];
|
|
85
|
+
result_1.set(key, (0, exports.cast)(item));
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return new map_1.default(result_1);
|
|
89
|
+
}
|
|
90
|
+
else if (type === 'function') {
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
throw new Error("Unexpected type ".concat(type));
|
|
94
|
+
};
|
|
95
|
+
exports.cast = cast;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export declare abstract class CustomType {
|
|
2
|
-
static intrinsics: Map<string, Function>;
|
|
3
|
-
getType(): string;
|
|
4
|
-
valueOf(): any;
|
|
5
|
-
toString(): string;
|
|
6
|
-
}
|
|
7
|
-
export declare abstract class CustomLiteralType extends CustomType {
|
|
8
|
-
value: any;
|
|
9
|
-
}
|
|
10
|
-
export declare abstract class CustomObjectType extends CustomType {
|
|
11
|
-
value: any;
|
|
12
|
-
set(path: any[], value: any): Promise<void>;
|
|
13
|
-
get(path: any[]): Promise<any>;
|
|
14
|
-
getCallable(path: any[]): Promise<Callable>;
|
|
15
|
-
}
|
|
16
|
-
export interface Callable {
|
|
17
|
-
origin: any;
|
|
18
|
-
context: any;
|
|
19
|
-
}
|
|
1
|
+
export declare abstract class CustomType {
|
|
2
|
+
static intrinsics: Map<string, Function>;
|
|
3
|
+
getType(): string;
|
|
4
|
+
valueOf(): any;
|
|
5
|
+
toString(): string;
|
|
6
|
+
}
|
|
7
|
+
export declare abstract class CustomLiteralType extends CustomType {
|
|
8
|
+
value: any;
|
|
9
|
+
}
|
|
10
|
+
export declare abstract class CustomObjectType extends CustomType {
|
|
11
|
+
value: any;
|
|
12
|
+
set(path: any[], value: any): Promise<void>;
|
|
13
|
+
get(path: any[]): Promise<any>;
|
|
14
|
+
getCallable(path: any[]): Promise<Callable>;
|
|
15
|
+
}
|
|
16
|
+
export interface Callable {
|
|
17
|
+
origin: any;
|
|
18
|
+
context: any;
|
|
19
|
+
}
|
|
@@ -1,58 +1,58 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.CustomObjectType = exports.CustomLiteralType = exports.CustomType = void 0;
|
|
19
|
-
var CustomType = /** @class */ (function () {
|
|
20
|
-
function CustomType() {
|
|
21
|
-
}
|
|
22
|
-
CustomType.prototype.getType = function () {
|
|
23
|
-
throw new Error('Implentation of "getType" missing');
|
|
24
|
-
};
|
|
25
|
-
CustomType.prototype.valueOf = function () {
|
|
26
|
-
throw new Error('Implentation of "valueOf" missing');
|
|
27
|
-
};
|
|
28
|
-
CustomType.prototype.toString = function () {
|
|
29
|
-
throw new Error('Implentation of "toString" missing');
|
|
30
|
-
};
|
|
31
|
-
return CustomType;
|
|
32
|
-
}());
|
|
33
|
-
exports.CustomType = CustomType;
|
|
34
|
-
var CustomLiteralType = /** @class */ (function (_super) {
|
|
35
|
-
__extends(CustomLiteralType, _super);
|
|
36
|
-
function CustomLiteralType() {
|
|
37
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
38
|
-
}
|
|
39
|
-
return CustomLiteralType;
|
|
40
|
-
}(CustomType));
|
|
41
|
-
exports.CustomLiteralType = CustomLiteralType;
|
|
42
|
-
var CustomObjectType = /** @class */ (function (_super) {
|
|
43
|
-
__extends(CustomObjectType, _super);
|
|
44
|
-
function CustomObjectType() {
|
|
45
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
46
|
-
}
|
|
47
|
-
CustomObjectType.prototype.set = function (path, value) {
|
|
48
|
-
throw new Error('Implentation of "set" missing');
|
|
49
|
-
};
|
|
50
|
-
CustomObjectType.prototype.get = function (path) {
|
|
51
|
-
throw new Error('Implentation of "get" missing');
|
|
52
|
-
};
|
|
53
|
-
CustomObjectType.prototype.getCallable = function (path) {
|
|
54
|
-
throw new Error('Implentation of "getCallable" missing');
|
|
55
|
-
};
|
|
56
|
-
return CustomObjectType;
|
|
57
|
-
}(CustomType));
|
|
58
|
-
exports.CustomObjectType = CustomObjectType;
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.CustomObjectType = exports.CustomLiteralType = exports.CustomType = void 0;
|
|
19
|
+
var CustomType = /** @class */ (function () {
|
|
20
|
+
function CustomType() {
|
|
21
|
+
}
|
|
22
|
+
CustomType.prototype.getType = function () {
|
|
23
|
+
throw new Error('Implentation of "getType" missing');
|
|
24
|
+
};
|
|
25
|
+
CustomType.prototype.valueOf = function () {
|
|
26
|
+
throw new Error('Implentation of "valueOf" missing');
|
|
27
|
+
};
|
|
28
|
+
CustomType.prototype.toString = function () {
|
|
29
|
+
throw new Error('Implentation of "toString" missing');
|
|
30
|
+
};
|
|
31
|
+
return CustomType;
|
|
32
|
+
}());
|
|
33
|
+
exports.CustomType = CustomType;
|
|
34
|
+
var CustomLiteralType = /** @class */ (function (_super) {
|
|
35
|
+
__extends(CustomLiteralType, _super);
|
|
36
|
+
function CustomLiteralType() {
|
|
37
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
38
|
+
}
|
|
39
|
+
return CustomLiteralType;
|
|
40
|
+
}(CustomType));
|
|
41
|
+
exports.CustomLiteralType = CustomLiteralType;
|
|
42
|
+
var CustomObjectType = /** @class */ (function (_super) {
|
|
43
|
+
__extends(CustomObjectType, _super);
|
|
44
|
+
function CustomObjectType() {
|
|
45
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
46
|
+
}
|
|
47
|
+
CustomObjectType.prototype.set = function (path, value) {
|
|
48
|
+
throw new Error('Implentation of "set" missing');
|
|
49
|
+
};
|
|
50
|
+
CustomObjectType.prototype.get = function (path) {
|
|
51
|
+
throw new Error('Implentation of "get" missing');
|
|
52
|
+
};
|
|
53
|
+
CustomObjectType.prototype.getCallable = function (path) {
|
|
54
|
+
throw new Error('Implentation of "getCallable" missing');
|
|
55
|
+
};
|
|
56
|
+
return CustomObjectType;
|
|
57
|
+
}(CustomType));
|
|
58
|
+
exports.CustomObjectType = CustomObjectType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OperationContext } from '../context';
|
|
2
|
-
export declare abstract class Expression {
|
|
3
|
-
ast: any;
|
|
4
|
-
expr: any;
|
|
5
|
-
abstract get(operationContext: OperationContext, parentExpr?: any): any;
|
|
6
|
-
}
|
|
1
|
+
import { OperationContext } from '../context';
|
|
2
|
+
export declare abstract class Expression {
|
|
3
|
+
ast: any;
|
|
4
|
+
expr: any;
|
|
5
|
+
abstract get(operationContext: OperationContext, parentExpr?: any): any;
|
|
6
|
+
}
|
package/dist/types/expression.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Expression = void 0;
|
|
4
|
-
var Expression = /** @class */ (function () {
|
|
5
|
-
function Expression() {
|
|
6
|
-
}
|
|
7
|
-
return Expression;
|
|
8
|
-
}());
|
|
9
|
-
exports.Expression = Expression;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Expression = void 0;
|
|
4
|
+
var Expression = /** @class */ (function () {
|
|
5
|
+
function Expression() {
|
|
6
|
+
}
|
|
7
|
+
return Expression;
|
|
8
|
+
}());
|
|
9
|
+
exports.Expression = Expression;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OperationContext } from '../context';
|
|
2
|
-
export declare abstract class Operation {
|
|
3
|
-
ast: any;
|
|
4
|
-
get(operationContext: OperationContext): any;
|
|
5
|
-
run(operationContext: OperationContext): any | void;
|
|
6
|
-
}
|
|
7
|
-
export declare abstract class FunctionOperationBase extends Operation {
|
|
8
|
-
abstract fork(context: any): FunctionOperationBase;
|
|
9
|
-
}
|
|
1
|
+
import { OperationContext } from '../context';
|
|
2
|
+
export declare abstract class Operation {
|
|
3
|
+
ast: any;
|
|
4
|
+
get(operationContext: OperationContext): any;
|
|
5
|
+
run(operationContext: OperationContext): any | void;
|
|
6
|
+
}
|
|
7
|
+
export declare abstract class FunctionOperationBase extends Operation {
|
|
8
|
+
abstract fork(context: any): FunctionOperationBase;
|
|
9
|
+
}
|
package/dist/types/operation.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.FunctionOperationBase = exports.Operation = void 0;
|
|
19
|
-
var Operation = /** @class */ (function () {
|
|
20
|
-
function Operation() {
|
|
21
|
-
}
|
|
22
|
-
Operation.prototype.get = function (operationContext) {
|
|
23
|
-
throw new Error('Implentation of "get" missing');
|
|
24
|
-
};
|
|
25
|
-
Operation.prototype.run = function (operationContext) {
|
|
26
|
-
throw new Error('Implentation of "run" missing');
|
|
27
|
-
};
|
|
28
|
-
return Operation;
|
|
29
|
-
}());
|
|
30
|
-
exports.Operation = Operation;
|
|
31
|
-
var FunctionOperationBase = /** @class */ (function (_super) {
|
|
32
|
-
__extends(FunctionOperationBase, _super);
|
|
33
|
-
function FunctionOperationBase() {
|
|
34
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
-
}
|
|
36
|
-
return FunctionOperationBase;
|
|
37
|
-
}(Operation));
|
|
38
|
-
exports.FunctionOperationBase = FunctionOperationBase;
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.FunctionOperationBase = exports.Operation = void 0;
|
|
19
|
+
var Operation = /** @class */ (function () {
|
|
20
|
+
function Operation() {
|
|
21
|
+
}
|
|
22
|
+
Operation.prototype.get = function (operationContext) {
|
|
23
|
+
throw new Error('Implentation of "get" missing');
|
|
24
|
+
};
|
|
25
|
+
Operation.prototype.run = function (operationContext) {
|
|
26
|
+
throw new Error('Implentation of "run" missing');
|
|
27
|
+
};
|
|
28
|
+
return Operation;
|
|
29
|
+
}());
|
|
30
|
+
exports.Operation = Operation;
|
|
31
|
+
var FunctionOperationBase = /** @class */ (function (_super) {
|
|
32
|
+
__extends(FunctionOperationBase, _super);
|
|
33
|
+
function FunctionOperationBase() {
|
|
34
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
+
}
|
|
36
|
+
return FunctionOperationBase;
|
|
37
|
+
}(Operation));
|
|
38
|
+
exports.FunctionOperationBase = FunctionOperationBase;
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "greybel-interpreter",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Interpreter",
|
|
5
|
-
"main": "dist/index",
|
|
6
|
-
"typings": "dist/index",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"prepublishOnly": "npm run build",
|
|
9
|
-
"build": "npm run clean && tsc -p .",
|
|
10
|
-
"watch": "tsc -w -p .",
|
|
11
|
-
"clean": "rm -rf dist",
|
|
12
|
-
"test": "jest ./tests"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/ayecue/greybel-interpreter.git"
|
|
17
|
-
},
|
|
18
|
-
"author": {
|
|
19
|
-
"name": "ayecue",
|
|
20
|
-
"email": "soerenwehmeier@googlemail.com"
|
|
21
|
-
},
|
|
22
|
-
"license": "MIT",
|
|
23
|
-
"bugs": {
|
|
24
|
-
"url": "https://github.com/ayecue/greybel-interpreter/issues"
|
|
25
|
-
},
|
|
26
|
-
"homepage": "https://github.com/ayecue/greybel-interpreter#readme",
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@types/jest": "^27.0.3",
|
|
29
|
-
"@types/node": "^17.0.0",
|
|
30
|
-
"@types/uuid": "^8.3.3",
|
|
31
|
-
"jest": "^27.4.5",
|
|
32
|
-
"nodemon": "^2.0.15",
|
|
33
|
-
"ts-node": "^10.4.0",
|
|
34
|
-
"typescript": "^4.5.4"
|
|
35
|
-
},
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"greybel-core": "^0.2.
|
|
38
|
-
"greyscript-core": "^0.2.
|
|
39
|
-
"uuid": "^8.3.2"
|
|
40
|
-
},
|
|
41
|
-
"keywords": [
|
|
42
|
-
"greyscript",
|
|
43
|
-
"greyhack"
|
|
44
|
-
]
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "greybel-interpreter",
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "Interpreter",
|
|
5
|
+
"main": "dist/index",
|
|
6
|
+
"typings": "dist/index",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prepublishOnly": "npm run build",
|
|
9
|
+
"build": "npm run clean && tsc -p .",
|
|
10
|
+
"watch": "tsc -w -p .",
|
|
11
|
+
"clean": "rm -rf dist",
|
|
12
|
+
"test": "jest ./tests"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/ayecue/greybel-interpreter.git"
|
|
17
|
+
},
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "ayecue",
|
|
20
|
+
"email": "soerenwehmeier@googlemail.com"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/ayecue/greybel-interpreter/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/ayecue/greybel-interpreter#readme",
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/jest": "^27.0.3",
|
|
29
|
+
"@types/node": "^17.0.0",
|
|
30
|
+
"@types/uuid": "^8.3.3",
|
|
31
|
+
"jest": "^27.4.5",
|
|
32
|
+
"nodemon": "^2.0.15",
|
|
33
|
+
"ts-node": "^10.4.0",
|
|
34
|
+
"typescript": "^4.5.4"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"greybel-core": "^0.2.3",
|
|
38
|
+
"greyscript-core": "^0.2.4",
|
|
39
|
+
"uuid": "^8.3.2"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"greyscript",
|
|
43
|
+
"greyhack"
|
|
44
|
+
]
|
|
45
|
+
}
|