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/expressions/path.js
CHANGED
|
@@ -1,364 +1,364 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.ExpressionSegment = exports.PathSegment = exports.IndexSegment = exports.SliceSegment = void 0;
|
|
55
|
-
var greyscript_core_1 = require("greyscript-core");
|
|
56
|
-
var operation_1 = require("../types/operation");
|
|
57
|
-
var expression_1 = require("../types/expression");
|
|
58
|
-
var typer_1 = require("../typer");
|
|
59
|
-
var SliceSegment = /** @class */ (function () {
|
|
60
|
-
function SliceSegment(left, right) {
|
|
61
|
-
this.left = left;
|
|
62
|
-
this.right = right;
|
|
63
|
-
}
|
|
64
|
-
return SliceSegment;
|
|
65
|
-
}());
|
|
66
|
-
exports.SliceSegment = SliceSegment;
|
|
67
|
-
var IndexSegment = /** @class */ (function () {
|
|
68
|
-
function IndexSegment(value) {
|
|
69
|
-
this.value = value;
|
|
70
|
-
}
|
|
71
|
-
return IndexSegment;
|
|
72
|
-
}());
|
|
73
|
-
exports.IndexSegment = IndexSegment;
|
|
74
|
-
var PathSegment = /** @class */ (function () {
|
|
75
|
-
function PathSegment(value) {
|
|
76
|
-
this.value = value;
|
|
77
|
-
}
|
|
78
|
-
return PathSegment;
|
|
79
|
-
}());
|
|
80
|
-
exports.PathSegment = PathSegment;
|
|
81
|
-
var ExpressionSegment = /** @class */ (function () {
|
|
82
|
-
function ExpressionSegment() {
|
|
83
|
-
this.value = [];
|
|
84
|
-
}
|
|
85
|
-
ExpressionSegment.prototype.append = function (val) {
|
|
86
|
-
var me = this;
|
|
87
|
-
if (val instanceof ExpressionSegment) {
|
|
88
|
-
me.value = me.value.concat(val.value);
|
|
89
|
-
return me;
|
|
90
|
-
}
|
|
91
|
-
me.value = me.value.concat(val);
|
|
92
|
-
return me;
|
|
93
|
-
};
|
|
94
|
-
return ExpressionSegment;
|
|
95
|
-
}());
|
|
96
|
-
exports.ExpressionSegment = ExpressionSegment;
|
|
97
|
-
var PathExpression = /** @class */ (function (_super) {
|
|
98
|
-
__extends(PathExpression, _super);
|
|
99
|
-
function PathExpression(ast) {
|
|
100
|
-
var _this = _super.call(this) || this;
|
|
101
|
-
var me = _this;
|
|
102
|
-
me.ast = ast;
|
|
103
|
-
me.expr = null;
|
|
104
|
-
return _this;
|
|
105
|
-
}
|
|
106
|
-
PathExpression.prototype.prepare = function (visit) {
|
|
107
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
108
|
-
var me, buildExpression, _a;
|
|
109
|
-
return __generator(this, function (_b) {
|
|
110
|
-
switch (_b.label) {
|
|
111
|
-
case 0:
|
|
112
|
-
me = this;
|
|
113
|
-
buildExpression = function (node) {
|
|
114
|
-
var _a;
|
|
115
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
116
|
-
var expression, _b, memberExpression, _c, _d, _e, _f, indexExpression, _g, _h, sliceExpression, _j, _k, _l, _m, _o, _p, _q, identifier, _r, _s;
|
|
117
|
-
return __generator(this, function (_t) {
|
|
118
|
-
switch (_t.label) {
|
|
119
|
-
case 0:
|
|
120
|
-
expression = new ExpressionSegment();
|
|
121
|
-
_b = node.type;
|
|
122
|
-
switch (_b) {
|
|
123
|
-
case greyscript_core_1.ASTType.MemberExpression: return [3 /*break*/, 1];
|
|
124
|
-
case greyscript_core_1.ASTType.IndexExpression: return [3 /*break*/, 4];
|
|
125
|
-
case greyscript_core_1.ASTType.Identifier: return [3 /*break*/, 11];
|
|
126
|
-
}
|
|
127
|
-
return [3 /*break*/, 12];
|
|
128
|
-
case 1:
|
|
129
|
-
memberExpression = node;
|
|
130
|
-
_d = (_c = expression).append;
|
|
131
|
-
return [4 /*yield*/, buildExpression(memberExpression.base)];
|
|
132
|
-
case 2:
|
|
133
|
-
_d.apply(_c, [_t.sent()]);
|
|
134
|
-
_f = (_e = expression).append;
|
|
135
|
-
return [4 /*yield*/, buildExpression(memberExpression.identifier)];
|
|
136
|
-
case 3:
|
|
137
|
-
_f.apply(_e, [_t.sent()]);
|
|
138
|
-
return [3 /*break*/, 14];
|
|
139
|
-
case 4:
|
|
140
|
-
indexExpression = node;
|
|
141
|
-
_h = (_g = expression).append;
|
|
142
|
-
return [4 /*yield*/, buildExpression(indexExpression.base)];
|
|
143
|
-
case 5:
|
|
144
|
-
_h.apply(_g, [_t.sent()]);
|
|
145
|
-
if (!(((_a = indexExpression.index) === null || _a === void 0 ? void 0 : _a.type) === 'SliceExpression')) return [3 /*break*/, 8];
|
|
146
|
-
sliceExpression = indexExpression.index;
|
|
147
|
-
_k = (_j = expression).append;
|
|
148
|
-
_l = SliceSegment.bind;
|
|
149
|
-
return [4 /*yield*/, visit(sliceExpression.left)];
|
|
150
|
-
case 6:
|
|
151
|
-
_m = [void 0, _t.sent()];
|
|
152
|
-
return [4 /*yield*/, visit(sliceExpression.right)];
|
|
153
|
-
case 7:
|
|
154
|
-
_k.apply(_j, [new (_l.apply(SliceSegment, _m.concat([_t.sent()])))()]);
|
|
155
|
-
return [3 /*break*/, 10];
|
|
156
|
-
case 8:
|
|
157
|
-
_p = (_o = expression).append;
|
|
158
|
-
_q = IndexSegment.bind;
|
|
159
|
-
return [4 /*yield*/, visit(indexExpression.index)];
|
|
160
|
-
case 9:
|
|
161
|
-
_p.apply(_o, [new (_q.apply(IndexSegment, [void 0, _t.sent()]))()]);
|
|
162
|
-
_t.label = 10;
|
|
163
|
-
case 10: return [3 /*break*/, 14];
|
|
164
|
-
case 11:
|
|
165
|
-
identifier = node;
|
|
166
|
-
expression.append(new PathSegment(identifier.name));
|
|
167
|
-
return [3 /*break*/, 14];
|
|
168
|
-
case 12:
|
|
169
|
-
_s = (_r = expression).append;
|
|
170
|
-
return [4 /*yield*/, visit(node)];
|
|
171
|
-
case 13:
|
|
172
|
-
_s.apply(_r, [_t.sent()]);
|
|
173
|
-
_t.label = 14;
|
|
174
|
-
case 14: return [2 /*return*/, expression];
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
};
|
|
179
|
-
_a = me;
|
|
180
|
-
return [4 /*yield*/, buildExpression(me.ast)];
|
|
181
|
-
case 1:
|
|
182
|
-
_a.expr = _b.sent();
|
|
183
|
-
return [2 /*return*/, me];
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
};
|
|
188
|
-
PathExpression.prototype.get = function (operationContext, parentExpr) {
|
|
189
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
190
|
-
var me, evaluate, resultExpr, context, value_1, _a, value, callable, _b;
|
|
191
|
-
return __generator(this, function (_c) {
|
|
192
|
-
switch (_c.label) {
|
|
193
|
-
case 0:
|
|
194
|
-
me = this;
|
|
195
|
-
evaluate = function (node) {
|
|
196
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
197
|
-
var traverselPath, traversedPath, position, handle, current, functionContext, origin, value, left, right;
|
|
198
|
-
return __generator(this, function (_a) {
|
|
199
|
-
switch (_a.label) {
|
|
200
|
-
case 0:
|
|
201
|
-
traverselPath = [].concat(node.value);
|
|
202
|
-
traversedPath = [];
|
|
203
|
-
position = 0;
|
|
204
|
-
_a.label = 1;
|
|
205
|
-
case 1:
|
|
206
|
-
if (!(current = traverselPath.shift())) return [3 /*break*/, 28];
|
|
207
|
-
if (!(0, typer_1.isCustomValue)(current)) return [3 /*break*/, 2];
|
|
208
|
-
handle = current;
|
|
209
|
-
return [3 /*break*/, 27];
|
|
210
|
-
case 2:
|
|
211
|
-
if (!(current instanceof expression_1.Expression)) return [3 /*break*/, 4];
|
|
212
|
-
return [4 /*yield*/, current.get(operationContext, me.expr)];
|
|
213
|
-
case 3:
|
|
214
|
-
handle = _a.sent();
|
|
215
|
-
return [3 /*break*/, 27];
|
|
216
|
-
case 4:
|
|
217
|
-
if (!(current instanceof operation_1.Operation)) return [3 /*break*/, 6];
|
|
218
|
-
return [4 /*yield*/, current.get(operationContext)];
|
|
219
|
-
case 5:
|
|
220
|
-
handle = _a.sent();
|
|
221
|
-
return [3 /*break*/, 27];
|
|
222
|
-
case 6:
|
|
223
|
-
if (!(current instanceof PathSegment)) return [3 /*break*/, 12];
|
|
224
|
-
if (!(current.value === 'self' && position === 0)) return [3 /*break*/, 7];
|
|
225
|
-
functionContext = operationContext.getMemory('functionContext');
|
|
226
|
-
if (functionContext === null || functionContext === void 0 ? void 0 : functionContext.context) {
|
|
227
|
-
handle = functionContext.context;
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
operationContext.debugger.raise('Unexpected self', me, current);
|
|
231
|
-
}
|
|
232
|
-
return [3 /*break*/, 11];
|
|
233
|
-
case 7:
|
|
234
|
-
traversedPath.push(current.value);
|
|
235
|
-
if (!(traverselPath.length > 0)) return [3 /*break*/, 11];
|
|
236
|
-
return [4 /*yield*/, (handle || operationContext).get(traversedPath)];
|
|
237
|
-
case 8:
|
|
238
|
-
origin = _a.sent();
|
|
239
|
-
if (!(0, typer_1.isCustomValue)(origin)) return [3 /*break*/, 9];
|
|
240
|
-
handle = origin;
|
|
241
|
-
traversedPath = [];
|
|
242
|
-
return [3 /*break*/, 11];
|
|
243
|
-
case 9:
|
|
244
|
-
if (!(origin instanceof Function)) return [3 /*break*/, 11];
|
|
245
|
-
return [4 /*yield*/, origin.call(handle)];
|
|
246
|
-
case 10:
|
|
247
|
-
handle = _a.sent();
|
|
248
|
-
traversedPath = [];
|
|
249
|
-
_a.label = 11;
|
|
250
|
-
case 11: return [3 /*break*/, 27];
|
|
251
|
-
case 12:
|
|
252
|
-
if (!(current instanceof IndexSegment)) return [3 /*break*/, 17];
|
|
253
|
-
current = current.value;
|
|
254
|
-
if (!(0, typer_1.isCustomValue)(current)) return [3 /*break*/, 13];
|
|
255
|
-
traversedPath.push(current.valueOf());
|
|
256
|
-
return [3 /*break*/, 16];
|
|
257
|
-
case 13:
|
|
258
|
-
if (!(current instanceof expression_1.Expression)) return [3 /*break*/, 15];
|
|
259
|
-
return [4 /*yield*/, current.get(operationContext)];
|
|
260
|
-
case 14:
|
|
261
|
-
value = _a.sent();
|
|
262
|
-
traversedPath.push(value);
|
|
263
|
-
return [3 /*break*/, 16];
|
|
264
|
-
case 15:
|
|
265
|
-
operationContext.debugger.raise('Unexpected index', me, current);
|
|
266
|
-
_a.label = 16;
|
|
267
|
-
case 16: return [3 /*break*/, 27];
|
|
268
|
-
case 17:
|
|
269
|
-
if (!(current instanceof SliceSegment)) return [3 /*break*/, 26];
|
|
270
|
-
if (!!handle) return [3 /*break*/, 19];
|
|
271
|
-
return [4 /*yield*/, operationContext.get(traversedPath)];
|
|
272
|
-
case 18:
|
|
273
|
-
handle = _a.sent();
|
|
274
|
-
traversedPath = [];
|
|
275
|
-
_a.label = 19;
|
|
276
|
-
case 19:
|
|
277
|
-
if (!(0, typer_1.isCustomList)(handle) && !(0, typer_1.isCustomString)(handle)) {
|
|
278
|
-
operationContext.debugger.raise('Invalid type for slice', me, handle);
|
|
279
|
-
}
|
|
280
|
-
left = current.left;
|
|
281
|
-
if (!(0, typer_1.isCustomValue)(left)) return [3 /*break*/, 20];
|
|
282
|
-
left = left;
|
|
283
|
-
return [3 /*break*/, 22];
|
|
284
|
-
case 20:
|
|
285
|
-
if (!(left instanceof expression_1.Expression)) return [3 /*break*/, 22];
|
|
286
|
-
return [4 /*yield*/, left.get(operationContext)];
|
|
287
|
-
case 21:
|
|
288
|
-
left = _a.sent();
|
|
289
|
-
_a.label = 22;
|
|
290
|
-
case 22:
|
|
291
|
-
right = current.right;
|
|
292
|
-
if (!(0, typer_1.isCustomValue)(right)) return [3 /*break*/, 23];
|
|
293
|
-
right = right;
|
|
294
|
-
return [3 /*break*/, 25];
|
|
295
|
-
case 23:
|
|
296
|
-
if (!(right instanceof expression_1.Expression)) return [3 /*break*/, 25];
|
|
297
|
-
return [4 /*yield*/, right.get(operationContext)];
|
|
298
|
-
case 24:
|
|
299
|
-
right = _a.sent();
|
|
300
|
-
_a.label = 25;
|
|
301
|
-
case 25:
|
|
302
|
-
handle = handle.slice(left, right);
|
|
303
|
-
return [3 /*break*/, 27];
|
|
304
|
-
case 26:
|
|
305
|
-
operationContext.debugger.raise('Unexpected handle', me, current);
|
|
306
|
-
_a.label = 27;
|
|
307
|
-
case 27:
|
|
308
|
-
position++;
|
|
309
|
-
return [3 /*break*/, 1];
|
|
310
|
-
case 28: return [2 /*return*/, {
|
|
311
|
-
handle: handle,
|
|
312
|
-
path: traversedPath
|
|
313
|
-
}];
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
};
|
|
318
|
-
operationContext.debugger.debug('Line', me.ast.start.line, 'PathExpression', 'get', 'expr', me.expr);
|
|
319
|
-
return [4 /*yield*/, evaluate(me.expr)];
|
|
320
|
-
case 1:
|
|
321
|
-
resultExpr = _c.sent();
|
|
322
|
-
if (!!parentExpr) return [3 /*break*/, 14];
|
|
323
|
-
if (!resultExpr.handle) return [3 /*break*/, 8];
|
|
324
|
-
if (!(resultExpr.path.length === 0)) return [3 /*break*/, 2];
|
|
325
|
-
return [2 /*return*/, resultExpr.handle];
|
|
326
|
-
case 2:
|
|
327
|
-
if (!(0, typer_1.isCustomMap)(resultExpr.handle)) return [3 /*break*/, 7];
|
|
328
|
-
context = resultExpr.handle;
|
|
329
|
-
return [4 /*yield*/, context.get(resultExpr.path)];
|
|
330
|
-
case 3:
|
|
331
|
-
value_1 = _c.sent();
|
|
332
|
-
if (!(value_1 instanceof operation_1.Operation)) return [3 /*break*/, 4];
|
|
333
|
-
return [2 /*return*/, value_1.run(operationContext)];
|
|
334
|
-
case 4:
|
|
335
|
-
if (!(value_1 instanceof Function)) return [3 /*break*/, 6];
|
|
336
|
-
_a = typer_1.cast;
|
|
337
|
-
return [4 /*yield*/, value_1.call(context)];
|
|
338
|
-
case 5: return [2 /*return*/, _a.apply(void 0, [_c.sent()])];
|
|
339
|
-
case 6: return [2 /*return*/, value_1];
|
|
340
|
-
case 7: return [2 /*return*/, (0, typer_1.cast)(resultExpr.handle.callMethod(resultExpr.path))];
|
|
341
|
-
case 8: return [4 /*yield*/, operationContext.get(resultExpr.path)];
|
|
342
|
-
case 9:
|
|
343
|
-
value = _c.sent();
|
|
344
|
-
if (!(value instanceof Function)) return [3 /*break*/, 12];
|
|
345
|
-
return [4 /*yield*/, operationContext.getCallable(resultExpr.path)];
|
|
346
|
-
case 10:
|
|
347
|
-
callable = _c.sent();
|
|
348
|
-
_b = typer_1.cast;
|
|
349
|
-
return [4 /*yield*/, callable.origin.call(callable.context)];
|
|
350
|
-
case 11: return [2 /*return*/, _b.apply(void 0, [_c.sent()])];
|
|
351
|
-
case 12:
|
|
352
|
-
if (value instanceof operation_1.Operation) {
|
|
353
|
-
return [2 /*return*/, value.run(operationContext)];
|
|
354
|
-
}
|
|
355
|
-
_c.label = 13;
|
|
356
|
-
case 13: return [2 /*return*/, value];
|
|
357
|
-
case 14: return [2 /*return*/, resultExpr];
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
};
|
|
362
|
-
return PathExpression;
|
|
363
|
-
}(expression_1.Expression));
|
|
364
|
-
exports.default = PathExpression;
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.ExpressionSegment = exports.PathSegment = exports.IndexSegment = exports.SliceSegment = void 0;
|
|
55
|
+
var greyscript_core_1 = require("greyscript-core");
|
|
56
|
+
var operation_1 = require("../types/operation");
|
|
57
|
+
var expression_1 = require("../types/expression");
|
|
58
|
+
var typer_1 = require("../typer");
|
|
59
|
+
var SliceSegment = /** @class */ (function () {
|
|
60
|
+
function SliceSegment(left, right) {
|
|
61
|
+
this.left = left;
|
|
62
|
+
this.right = right;
|
|
63
|
+
}
|
|
64
|
+
return SliceSegment;
|
|
65
|
+
}());
|
|
66
|
+
exports.SliceSegment = SliceSegment;
|
|
67
|
+
var IndexSegment = /** @class */ (function () {
|
|
68
|
+
function IndexSegment(value) {
|
|
69
|
+
this.value = value;
|
|
70
|
+
}
|
|
71
|
+
return IndexSegment;
|
|
72
|
+
}());
|
|
73
|
+
exports.IndexSegment = IndexSegment;
|
|
74
|
+
var PathSegment = /** @class */ (function () {
|
|
75
|
+
function PathSegment(value) {
|
|
76
|
+
this.value = value;
|
|
77
|
+
}
|
|
78
|
+
return PathSegment;
|
|
79
|
+
}());
|
|
80
|
+
exports.PathSegment = PathSegment;
|
|
81
|
+
var ExpressionSegment = /** @class */ (function () {
|
|
82
|
+
function ExpressionSegment() {
|
|
83
|
+
this.value = [];
|
|
84
|
+
}
|
|
85
|
+
ExpressionSegment.prototype.append = function (val) {
|
|
86
|
+
var me = this;
|
|
87
|
+
if (val instanceof ExpressionSegment) {
|
|
88
|
+
me.value = me.value.concat(val.value);
|
|
89
|
+
return me;
|
|
90
|
+
}
|
|
91
|
+
me.value = me.value.concat(val);
|
|
92
|
+
return me;
|
|
93
|
+
};
|
|
94
|
+
return ExpressionSegment;
|
|
95
|
+
}());
|
|
96
|
+
exports.ExpressionSegment = ExpressionSegment;
|
|
97
|
+
var PathExpression = /** @class */ (function (_super) {
|
|
98
|
+
__extends(PathExpression, _super);
|
|
99
|
+
function PathExpression(ast) {
|
|
100
|
+
var _this = _super.call(this) || this;
|
|
101
|
+
var me = _this;
|
|
102
|
+
me.ast = ast;
|
|
103
|
+
me.expr = null;
|
|
104
|
+
return _this;
|
|
105
|
+
}
|
|
106
|
+
PathExpression.prototype.prepare = function (visit) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
108
|
+
var me, buildExpression, _a;
|
|
109
|
+
return __generator(this, function (_b) {
|
|
110
|
+
switch (_b.label) {
|
|
111
|
+
case 0:
|
|
112
|
+
me = this;
|
|
113
|
+
buildExpression = function (node) {
|
|
114
|
+
var _a;
|
|
115
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
116
|
+
var expression, _b, memberExpression, _c, _d, _e, _f, indexExpression, _g, _h, sliceExpression, _j, _k, _l, _m, _o, _p, _q, identifier, _r, _s;
|
|
117
|
+
return __generator(this, function (_t) {
|
|
118
|
+
switch (_t.label) {
|
|
119
|
+
case 0:
|
|
120
|
+
expression = new ExpressionSegment();
|
|
121
|
+
_b = node.type;
|
|
122
|
+
switch (_b) {
|
|
123
|
+
case greyscript_core_1.ASTType.MemberExpression: return [3 /*break*/, 1];
|
|
124
|
+
case greyscript_core_1.ASTType.IndexExpression: return [3 /*break*/, 4];
|
|
125
|
+
case greyscript_core_1.ASTType.Identifier: return [3 /*break*/, 11];
|
|
126
|
+
}
|
|
127
|
+
return [3 /*break*/, 12];
|
|
128
|
+
case 1:
|
|
129
|
+
memberExpression = node;
|
|
130
|
+
_d = (_c = expression).append;
|
|
131
|
+
return [4 /*yield*/, buildExpression(memberExpression.base)];
|
|
132
|
+
case 2:
|
|
133
|
+
_d.apply(_c, [_t.sent()]);
|
|
134
|
+
_f = (_e = expression).append;
|
|
135
|
+
return [4 /*yield*/, buildExpression(memberExpression.identifier)];
|
|
136
|
+
case 3:
|
|
137
|
+
_f.apply(_e, [_t.sent()]);
|
|
138
|
+
return [3 /*break*/, 14];
|
|
139
|
+
case 4:
|
|
140
|
+
indexExpression = node;
|
|
141
|
+
_h = (_g = expression).append;
|
|
142
|
+
return [4 /*yield*/, buildExpression(indexExpression.base)];
|
|
143
|
+
case 5:
|
|
144
|
+
_h.apply(_g, [_t.sent()]);
|
|
145
|
+
if (!(((_a = indexExpression.index) === null || _a === void 0 ? void 0 : _a.type) === 'SliceExpression')) return [3 /*break*/, 8];
|
|
146
|
+
sliceExpression = indexExpression.index;
|
|
147
|
+
_k = (_j = expression).append;
|
|
148
|
+
_l = SliceSegment.bind;
|
|
149
|
+
return [4 /*yield*/, visit(sliceExpression.left)];
|
|
150
|
+
case 6:
|
|
151
|
+
_m = [void 0, _t.sent()];
|
|
152
|
+
return [4 /*yield*/, visit(sliceExpression.right)];
|
|
153
|
+
case 7:
|
|
154
|
+
_k.apply(_j, [new (_l.apply(SliceSegment, _m.concat([_t.sent()])))()]);
|
|
155
|
+
return [3 /*break*/, 10];
|
|
156
|
+
case 8:
|
|
157
|
+
_p = (_o = expression).append;
|
|
158
|
+
_q = IndexSegment.bind;
|
|
159
|
+
return [4 /*yield*/, visit(indexExpression.index)];
|
|
160
|
+
case 9:
|
|
161
|
+
_p.apply(_o, [new (_q.apply(IndexSegment, [void 0, _t.sent()]))()]);
|
|
162
|
+
_t.label = 10;
|
|
163
|
+
case 10: return [3 /*break*/, 14];
|
|
164
|
+
case 11:
|
|
165
|
+
identifier = node;
|
|
166
|
+
expression.append(new PathSegment(identifier.name));
|
|
167
|
+
return [3 /*break*/, 14];
|
|
168
|
+
case 12:
|
|
169
|
+
_s = (_r = expression).append;
|
|
170
|
+
return [4 /*yield*/, visit(node)];
|
|
171
|
+
case 13:
|
|
172
|
+
_s.apply(_r, [_t.sent()]);
|
|
173
|
+
_t.label = 14;
|
|
174
|
+
case 14: return [2 /*return*/, expression];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
_a = me;
|
|
180
|
+
return [4 /*yield*/, buildExpression(me.ast)];
|
|
181
|
+
case 1:
|
|
182
|
+
_a.expr = _b.sent();
|
|
183
|
+
return [2 /*return*/, me];
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
PathExpression.prototype.get = function (operationContext, parentExpr) {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
190
|
+
var me, evaluate, resultExpr, context, value_1, _a, value, callable, _b;
|
|
191
|
+
return __generator(this, function (_c) {
|
|
192
|
+
switch (_c.label) {
|
|
193
|
+
case 0:
|
|
194
|
+
me = this;
|
|
195
|
+
evaluate = function (node) {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
197
|
+
var traverselPath, traversedPath, position, handle, current, functionContext, origin, value, left, right;
|
|
198
|
+
return __generator(this, function (_a) {
|
|
199
|
+
switch (_a.label) {
|
|
200
|
+
case 0:
|
|
201
|
+
traverselPath = [].concat(node.value);
|
|
202
|
+
traversedPath = [];
|
|
203
|
+
position = 0;
|
|
204
|
+
_a.label = 1;
|
|
205
|
+
case 1:
|
|
206
|
+
if (!(current = traverselPath.shift())) return [3 /*break*/, 28];
|
|
207
|
+
if (!(0, typer_1.isCustomValue)(current)) return [3 /*break*/, 2];
|
|
208
|
+
handle = current;
|
|
209
|
+
return [3 /*break*/, 27];
|
|
210
|
+
case 2:
|
|
211
|
+
if (!(current instanceof expression_1.Expression)) return [3 /*break*/, 4];
|
|
212
|
+
return [4 /*yield*/, current.get(operationContext, me.expr)];
|
|
213
|
+
case 3:
|
|
214
|
+
handle = _a.sent();
|
|
215
|
+
return [3 /*break*/, 27];
|
|
216
|
+
case 4:
|
|
217
|
+
if (!(current instanceof operation_1.Operation)) return [3 /*break*/, 6];
|
|
218
|
+
return [4 /*yield*/, current.get(operationContext)];
|
|
219
|
+
case 5:
|
|
220
|
+
handle = _a.sent();
|
|
221
|
+
return [3 /*break*/, 27];
|
|
222
|
+
case 6:
|
|
223
|
+
if (!(current instanceof PathSegment)) return [3 /*break*/, 12];
|
|
224
|
+
if (!(current.value === 'self' && position === 0)) return [3 /*break*/, 7];
|
|
225
|
+
functionContext = operationContext.getMemory('functionContext');
|
|
226
|
+
if (functionContext === null || functionContext === void 0 ? void 0 : functionContext.context) {
|
|
227
|
+
handle = functionContext.context;
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
operationContext.debugger.raise('Unexpected self', me, current);
|
|
231
|
+
}
|
|
232
|
+
return [3 /*break*/, 11];
|
|
233
|
+
case 7:
|
|
234
|
+
traversedPath.push(current.value);
|
|
235
|
+
if (!(traverselPath.length > 0)) return [3 /*break*/, 11];
|
|
236
|
+
return [4 /*yield*/, (handle || operationContext).get(traversedPath)];
|
|
237
|
+
case 8:
|
|
238
|
+
origin = _a.sent();
|
|
239
|
+
if (!(0, typer_1.isCustomValue)(origin)) return [3 /*break*/, 9];
|
|
240
|
+
handle = origin;
|
|
241
|
+
traversedPath = [];
|
|
242
|
+
return [3 /*break*/, 11];
|
|
243
|
+
case 9:
|
|
244
|
+
if (!(origin instanceof Function)) return [3 /*break*/, 11];
|
|
245
|
+
return [4 /*yield*/, origin.call(handle)];
|
|
246
|
+
case 10:
|
|
247
|
+
handle = _a.sent();
|
|
248
|
+
traversedPath = [];
|
|
249
|
+
_a.label = 11;
|
|
250
|
+
case 11: return [3 /*break*/, 27];
|
|
251
|
+
case 12:
|
|
252
|
+
if (!(current instanceof IndexSegment)) return [3 /*break*/, 17];
|
|
253
|
+
current = current.value;
|
|
254
|
+
if (!(0, typer_1.isCustomValue)(current)) return [3 /*break*/, 13];
|
|
255
|
+
traversedPath.push(current.valueOf());
|
|
256
|
+
return [3 /*break*/, 16];
|
|
257
|
+
case 13:
|
|
258
|
+
if (!(current instanceof expression_1.Expression)) return [3 /*break*/, 15];
|
|
259
|
+
return [4 /*yield*/, current.get(operationContext)];
|
|
260
|
+
case 14:
|
|
261
|
+
value = _a.sent();
|
|
262
|
+
traversedPath.push(value);
|
|
263
|
+
return [3 /*break*/, 16];
|
|
264
|
+
case 15:
|
|
265
|
+
operationContext.debugger.raise('Unexpected index', me, current);
|
|
266
|
+
_a.label = 16;
|
|
267
|
+
case 16: return [3 /*break*/, 27];
|
|
268
|
+
case 17:
|
|
269
|
+
if (!(current instanceof SliceSegment)) return [3 /*break*/, 26];
|
|
270
|
+
if (!!handle) return [3 /*break*/, 19];
|
|
271
|
+
return [4 /*yield*/, operationContext.get(traversedPath)];
|
|
272
|
+
case 18:
|
|
273
|
+
handle = _a.sent();
|
|
274
|
+
traversedPath = [];
|
|
275
|
+
_a.label = 19;
|
|
276
|
+
case 19:
|
|
277
|
+
if (!(0, typer_1.isCustomList)(handle) && !(0, typer_1.isCustomString)(handle)) {
|
|
278
|
+
operationContext.debugger.raise('Invalid type for slice', me, handle);
|
|
279
|
+
}
|
|
280
|
+
left = current.left;
|
|
281
|
+
if (!(0, typer_1.isCustomValue)(left)) return [3 /*break*/, 20];
|
|
282
|
+
left = left;
|
|
283
|
+
return [3 /*break*/, 22];
|
|
284
|
+
case 20:
|
|
285
|
+
if (!(left instanceof expression_1.Expression)) return [3 /*break*/, 22];
|
|
286
|
+
return [4 /*yield*/, left.get(operationContext)];
|
|
287
|
+
case 21:
|
|
288
|
+
left = _a.sent();
|
|
289
|
+
_a.label = 22;
|
|
290
|
+
case 22:
|
|
291
|
+
right = current.right;
|
|
292
|
+
if (!(0, typer_1.isCustomValue)(right)) return [3 /*break*/, 23];
|
|
293
|
+
right = right;
|
|
294
|
+
return [3 /*break*/, 25];
|
|
295
|
+
case 23:
|
|
296
|
+
if (!(right instanceof expression_1.Expression)) return [3 /*break*/, 25];
|
|
297
|
+
return [4 /*yield*/, right.get(operationContext)];
|
|
298
|
+
case 24:
|
|
299
|
+
right = _a.sent();
|
|
300
|
+
_a.label = 25;
|
|
301
|
+
case 25:
|
|
302
|
+
handle = handle.slice(left, right);
|
|
303
|
+
return [3 /*break*/, 27];
|
|
304
|
+
case 26:
|
|
305
|
+
operationContext.debugger.raise('Unexpected handle', me, current);
|
|
306
|
+
_a.label = 27;
|
|
307
|
+
case 27:
|
|
308
|
+
position++;
|
|
309
|
+
return [3 /*break*/, 1];
|
|
310
|
+
case 28: return [2 /*return*/, {
|
|
311
|
+
handle: handle,
|
|
312
|
+
path: traversedPath
|
|
313
|
+
}];
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
};
|
|
318
|
+
operationContext.debugger.debug('Line', me.ast.start.line, 'PathExpression', 'get', 'expr', me.expr);
|
|
319
|
+
return [4 /*yield*/, evaluate(me.expr)];
|
|
320
|
+
case 1:
|
|
321
|
+
resultExpr = _c.sent();
|
|
322
|
+
if (!!parentExpr) return [3 /*break*/, 14];
|
|
323
|
+
if (!resultExpr.handle) return [3 /*break*/, 8];
|
|
324
|
+
if (!(resultExpr.path.length === 0)) return [3 /*break*/, 2];
|
|
325
|
+
return [2 /*return*/, resultExpr.handle];
|
|
326
|
+
case 2:
|
|
327
|
+
if (!(0, typer_1.isCustomMap)(resultExpr.handle)) return [3 /*break*/, 7];
|
|
328
|
+
context = resultExpr.handle;
|
|
329
|
+
return [4 /*yield*/, context.get(resultExpr.path)];
|
|
330
|
+
case 3:
|
|
331
|
+
value_1 = _c.sent();
|
|
332
|
+
if (!(value_1 instanceof operation_1.Operation)) return [3 /*break*/, 4];
|
|
333
|
+
return [2 /*return*/, value_1.run(operationContext)];
|
|
334
|
+
case 4:
|
|
335
|
+
if (!(value_1 instanceof Function)) return [3 /*break*/, 6];
|
|
336
|
+
_a = typer_1.cast;
|
|
337
|
+
return [4 /*yield*/, value_1.call(context)];
|
|
338
|
+
case 5: return [2 /*return*/, _a.apply(void 0, [_c.sent()])];
|
|
339
|
+
case 6: return [2 /*return*/, value_1];
|
|
340
|
+
case 7: return [2 /*return*/, (0, typer_1.cast)(resultExpr.handle.callMethod(resultExpr.path))];
|
|
341
|
+
case 8: return [4 /*yield*/, operationContext.get(resultExpr.path)];
|
|
342
|
+
case 9:
|
|
343
|
+
value = _c.sent();
|
|
344
|
+
if (!(value instanceof Function)) return [3 /*break*/, 12];
|
|
345
|
+
return [4 /*yield*/, operationContext.getCallable(resultExpr.path)];
|
|
346
|
+
case 10:
|
|
347
|
+
callable = _c.sent();
|
|
348
|
+
_b = typer_1.cast;
|
|
349
|
+
return [4 /*yield*/, callable.origin.call(callable.context)];
|
|
350
|
+
case 11: return [2 /*return*/, _b.apply(void 0, [_c.sent()])];
|
|
351
|
+
case 12:
|
|
352
|
+
if (value instanceof operation_1.Operation) {
|
|
353
|
+
return [2 /*return*/, value.run(operationContext)];
|
|
354
|
+
}
|
|
355
|
+
_c.label = 13;
|
|
356
|
+
case 13: return [2 /*return*/, value];
|
|
357
|
+
case 14: return [2 /*return*/, resultExpr];
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
};
|
|
362
|
+
return PathExpression;
|
|
363
|
+
}(expression_1.Expression));
|
|
364
|
+
exports.default = PathExpression;
|