@ibyar/expressions 0.8.5 → 1.0.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.
- package/api/abstract.d.ts +1 -0
- package/api/abstract.d.ts.map +1 -0
- package/api/abstract.js +12 -0
- package/api/abstract.js.map +1 -1
- package/api/class/class.d.ts +1 -0
- package/api/class/class.d.ts.map +1 -0
- package/api/class/class.js +563 -482
- package/api/class/class.js.map +1 -1
- package/api/class/decorator.d.ts +1 -0
- package/api/class/decorator.d.ts.map +1 -0
- package/api/class/decorator.js +49 -42
- package/api/class/decorator.js.map +1 -1
- package/api/computing/call.d.ts +1 -0
- package/api/computing/call.d.ts.map +1 -0
- package/api/computing/call.js +79 -70
- package/api/computing/call.js.map +1 -1
- package/api/computing/debugger.d.ts +1 -0
- package/api/computing/debugger.d.ts.map +1 -0
- package/api/computing/debugger.js +36 -29
- package/api/computing/debugger.js.map +1 -1
- package/api/computing/new.d.ts +1 -0
- package/api/computing/new.d.ts.map +1 -0
- package/api/computing/new.js +77 -69
- package/api/computing/new.js.map +1 -1
- package/api/computing/rest.d.ts +1 -0
- package/api/computing/rest.d.ts.map +1 -0
- package/api/computing/rest.js +50 -43
- package/api/computing/rest.js.map +1 -1
- package/api/computing/return.d.ts +1 -0
- package/api/computing/return.d.ts.map +1 -0
- package/api/computing/return.js +48 -41
- package/api/computing/return.js.map +1 -1
- package/api/computing/spread.d.ts +1 -0
- package/api/computing/spread.d.ts.map +1 -0
- package/api/computing/spread.js +66 -59
- package/api/computing/spread.js.map +1 -1
- package/api/computing/throw.d.ts +1 -0
- package/api/computing/throw.d.ts.map +1 -0
- package/api/computing/throw.js +204 -178
- package/api/computing/throw.js.map +1 -1
- package/api/computing/yield.d.ts +1 -0
- package/api/computing/yield.d.ts.map +1 -0
- package/api/computing/yield.js +56 -48
- package/api/computing/yield.js.map +1 -1
- package/api/definition/array.d.ts +1 -0
- package/api/definition/array.d.ts.map +1 -0
- package/api/definition/array.js +139 -124
- package/api/definition/array.js.map +1 -1
- package/api/definition/bind.d.ts +1 -0
- package/api/definition/bind.d.ts.map +1 -0
- package/api/definition/bind.js +81 -71
- package/api/definition/bind.js.map +1 -1
- package/api/definition/comment.d.ts +1 -0
- package/api/definition/comment.d.ts.map +1 -0
- package/api/definition/comment.js +40 -33
- package/api/definition/comment.js.map +1 -1
- package/api/definition/function.d.ts +1 -0
- package/api/definition/function.d.ts.map +1 -0
- package/api/definition/function.js +484 -447
- package/api/definition/function.js.map +1 -1
- package/api/definition/member.d.ts +1 -0
- package/api/definition/member.d.ts.map +1 -0
- package/api/definition/member.js +100 -90
- package/api/definition/member.js.map +1 -1
- package/api/definition/object.d.ts +1 -0
- package/api/definition/object.d.ts.map +1 -0
- package/api/definition/object.js +230 -202
- package/api/definition/object.js.map +1 -1
- package/api/definition/statement.d.ts +1 -0
- package/api/definition/statement.d.ts.map +1 -0
- package/api/definition/statement.js +52 -45
- package/api/definition/statement.js.map +1 -1
- package/api/definition/values.d.ts +1 -0
- package/api/definition/values.d.ts.map +1 -0
- package/api/definition/values.js +210 -167
- package/api/definition/values.js.map +1 -1
- package/api/deserialize/deserialize.d.ts +2 -1
- package/api/deserialize/deserialize.d.ts.map +1 -0
- package/api/deserialize/deserialize.js +5 -7
- package/api/deserialize/deserialize.js.map +1 -1
- package/api/deserialize/type-store.d.ts +1 -0
- package/api/deserialize/type-store.d.ts.map +1 -0
- package/api/expression.d.ts +1 -0
- package/api/expression.d.ts.map +1 -0
- package/api/index.d.ts +1 -0
- package/api/index.d.ts.map +1 -0
- package/api/module/common.d.ts +1 -0
- package/api/module/common.d.ts.map +1 -0
- package/api/module/common.js +59 -51
- package/api/module/common.js.map +1 -1
- package/api/module/export.d.ts +1 -0
- package/api/module/export.d.ts.map +1 -0
- package/api/module/export.js +327 -294
- package/api/module/export.js.map +1 -1
- package/api/module/import.d.ts +1 -0
- package/api/module/import.d.ts.map +1 -0
- package/api/module/import.js +298 -258
- package/api/module/import.js.map +1 -1
- package/api/operators/assignment.d.ts +1 -0
- package/api/operators/assignment.d.ts.map +1 -0
- package/api/operators/assignment.js +84 -75
- package/api/operators/assignment.js.map +1 -1
- package/api/operators/await.d.ts +1 -0
- package/api/operators/await.d.ts.map +1 -0
- package/api/operators/await.js +50 -43
- package/api/operators/await.js.map +1 -1
- package/api/operators/binary.d.ts +1 -0
- package/api/operators/binary.d.ts.map +1 -0
- package/api/operators/binary.js +74 -64
- package/api/operators/binary.js.map +1 -1
- package/api/operators/chaining.d.ts +1 -0
- package/api/operators/chaining.d.ts.map +1 -0
- package/api/operators/chaining.js +52 -45
- package/api/operators/chaining.js.map +1 -1
- package/api/operators/comma.d.ts +1 -0
- package/api/operators/comma.d.ts.map +1 -0
- package/api/operators/comma.js +49 -42
- package/api/operators/comma.js.map +1 -1
- package/api/operators/grouping.d.ts +1 -0
- package/api/operators/grouping.d.ts.map +1 -0
- package/api/operators/grouping.js +47 -40
- package/api/operators/grouping.js.map +1 -1
- package/api/operators/logical.d.ts +1 -0
- package/api/operators/logical.d.ts.map +1 -0
- package/api/operators/logical.js +47 -37
- package/api/operators/logical.js.map +1 -1
- package/api/operators/pipeline.d.ts +1 -0
- package/api/operators/pipeline.d.ts.map +1 -0
- package/api/operators/pipeline.js +91 -82
- package/api/operators/pipeline.js.map +1 -1
- package/api/operators/ternary.d.ts +1 -0
- package/api/operators/ternary.d.ts.map +1 -0
- package/api/operators/ternary.js +65 -56
- package/api/operators/ternary.js.map +1 -1
- package/api/operators/types.d.ts +1 -0
- package/api/operators/types.d.ts.map +1 -0
- package/api/operators/unary.d.ts +1 -0
- package/api/operators/unary.d.ts.map +1 -0
- package/api/operators/unary.js +93 -82
- package/api/operators/unary.js.map +1 -1
- package/api/operators/update.d.ts +1 -0
- package/api/operators/update.d.ts.map +1 -0
- package/api/operators/update.js +74 -62
- package/api/operators/update.js.map +1 -1
- package/api/program.d.ts +1 -0
- package/api/program.d.ts.map +1 -0
- package/api/program.js +49 -41
- package/api/program.js.map +1 -1
- package/api/statement/control/block.d.ts +1 -0
- package/api/statement/control/block.d.ts.map +1 -0
- package/api/statement/control/block.js +61 -54
- package/api/statement/control/block.js.map +1 -1
- package/api/statement/control/empty.d.ts +1 -1
- package/api/statement/control/empty.d.ts.map +1 -0
- package/api/statement/control/empty.js +39 -34
- package/api/statement/control/empty.js.map +1 -1
- package/api/statement/control/if.d.ts +1 -0
- package/api/statement/control/if.d.ts.map +1 -0
- package/api/statement/control/if.js +75 -66
- package/api/statement/control/if.js.map +1 -1
- package/api/statement/control/switch.d.ts +1 -0
- package/api/statement/control/switch.d.ts.map +1 -0
- package/api/statement/control/switch.js +168 -144
- package/api/statement/control/switch.js.map +1 -1
- package/api/statement/control/terminate.d.ts +1 -2
- package/api/statement/control/terminate.d.ts.map +1 -0
- package/api/statement/control/terminate.js +105 -81
- package/api/statement/control/terminate.js.map +1 -1
- package/api/statement/control/with.d.ts +1 -0
- package/api/statement/control/with.d.ts.map +1 -0
- package/api/statement/control/with.js +68 -60
- package/api/statement/control/with.js.map +1 -1
- package/api/statement/declarations/declares.d.ts +1 -0
- package/api/statement/declarations/declares.d.ts.map +1 -0
- package/api/statement/declarations/declares.js +140 -123
- package/api/statement/declarations/declares.js.map +1 -1
- package/api/statement/iterations/for.d.ts +1 -0
- package/api/statement/iterations/for.d.ts.map +1 -0
- package/api/statement/iterations/for.js +320 -280
- package/api/statement/iterations/for.js.map +1 -1
- package/api/statement/iterations/while.d.ts +1 -0
- package/api/statement/iterations/while.d.ts.map +1 -0
- package/api/statement/iterations/while.js +144 -127
- package/api/statement/iterations/while.js.map +1 -1
- package/api/utils.d.ts +1 -0
- package/api/utils.d.ts.map +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -0
- package/package.json +5 -5
- package/scope/event.d.ts +1 -0
- package/scope/event.d.ts.map +1 -0
- package/scope/finalizer.d.ts +1 -0
- package/scope/finalizer.d.ts.map +1 -0
- package/scope/index.d.ts +1 -0
- package/scope/index.d.ts.map +1 -0
- package/scope/pool.d.ts +1 -0
- package/scope/pool.d.ts.map +1 -0
- package/scope/proxy.d.ts +1 -0
- package/scope/proxy.d.ts.map +1 -0
- package/scope/proxy.js +1 -0
- package/scope/proxy.js.map +1 -1
- package/scope/scope.d.ts +1 -0
- package/scope/scope.d.ts.map +1 -0
- package/scope/scope.js +17 -11
- package/scope/scope.js.map +1 -1
- package/scope/stack.d.ts +1 -0
- package/scope/stack.d.ts.map +1 -0
- package/scope/stack.js +21 -13
- package/scope/stack.js.map +1 -1
- package/v8/enums.d.ts +1 -0
- package/v8/enums.d.ts.map +1 -0
- package/v8/enums.js +15 -13
- package/v8/enums.js.map +1 -1
- package/v8/factory.d.ts +1 -0
- package/v8/factory.d.ts.map +1 -0
- package/v8/factory.js +6 -4
- package/v8/factory.js.map +1 -1
- package/v8/index.d.ts +1 -0
- package/v8/index.d.ts.map +1 -0
- package/v8/inline.d.ts +1 -0
- package/v8/inline.d.ts.map +1 -0
- package/v8/inline.js +10 -6
- package/v8/inline.js.map +1 -1
- package/v8/language.d.ts +1 -0
- package/v8/language.d.ts.map +1 -0
- package/v8/node.d.ts +1 -0
- package/v8/node.d.ts.map +1 -0
- package/v8/parser.d.ts +1 -0
- package/v8/parser.d.ts.map +1 -0
- package/v8/parser.js +5 -5
- package/v8/parser.js.map +1 -1
- package/v8/stream.d.ts +1 -0
- package/v8/stream.d.ts.map +1 -0
- package/v8/stream.js +19 -8
- package/v8/stream.js.map +1 -1
- package/v8/token.d.ts +1 -0
- package/v8/token.d.ts.map +1 -0
- package/v8/token.js +365 -359
- package/v8/token.js.map +1 -1
- package/visit/index.d.ts +1 -0
- package/visit/index.d.ts.map +1 -0
- package/visit/visitor.d.ts +1 -0
- package/visit/visitor.d.ts.map +1 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __metadata } from "tslib";
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
3
2
|
import { AbstractExpressionNode, ReturnValue } from '../../abstract.js';
|
|
4
3
|
import { Deserializer } from '../../deserialize/deserialize.js';
|
|
5
4
|
import { TerminateReturnType } from '../control/terminate.js';
|
|
@@ -8,297 +7,338 @@ import { TerminateReturnType } from '../control/terminate.js';
|
|
|
8
7
|
* If the condition is falsy, another statement can be executed.
|
|
9
8
|
*
|
|
10
9
|
*/
|
|
11
|
-
let ForNode =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
10
|
+
export let ForNode = (() => {
|
|
11
|
+
let _classDecorators = [Deserializer('ForStatement')];
|
|
12
|
+
let _classDescriptor;
|
|
13
|
+
let _classExtraInitializers = [];
|
|
14
|
+
let _classThis;
|
|
15
|
+
var ForNode = class extends AbstractExpressionNode {
|
|
16
|
+
static {
|
|
17
|
+
__esDecorate(null, _classDescriptor = { value: this }, _classDecorators, { kind: "class", name: this.name }, null, _classExtraInitializers);
|
|
18
|
+
ForNode = _classThis = _classDescriptor.value;
|
|
19
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
20
|
+
}
|
|
21
|
+
body;
|
|
22
|
+
init;
|
|
23
|
+
test;
|
|
24
|
+
update;
|
|
25
|
+
static fromJSON(node, deserializer) {
|
|
26
|
+
return new ForNode(deserializer(node.body), node.init && deserializer(node.init), node.test && deserializer(node.test), node.update && deserializer(node.update), node.range, node.loc);
|
|
27
|
+
}
|
|
28
|
+
static visit(node, visitNode) {
|
|
29
|
+
visitNode(node.body);
|
|
30
|
+
node.init && visitNode(node.init);
|
|
31
|
+
node.test && visitNode(node.test);
|
|
32
|
+
node.update && visitNode(node.update);
|
|
33
|
+
}
|
|
34
|
+
constructor(body, init, test, update, range, loc) {
|
|
35
|
+
super(range, loc);
|
|
36
|
+
this.body = body;
|
|
37
|
+
this.init = init;
|
|
38
|
+
this.test = test;
|
|
39
|
+
this.update = update;
|
|
40
|
+
}
|
|
41
|
+
getBody() {
|
|
42
|
+
return this.body;
|
|
43
|
+
}
|
|
44
|
+
getInit() {
|
|
45
|
+
return this.init;
|
|
46
|
+
}
|
|
47
|
+
getTest() {
|
|
48
|
+
return this.test;
|
|
49
|
+
}
|
|
50
|
+
getUpdate() {
|
|
51
|
+
return this.update;
|
|
52
|
+
}
|
|
53
|
+
set(stack, value) {
|
|
54
|
+
throw new Error(`ForNode#set() has no implementation.`);
|
|
55
|
+
}
|
|
56
|
+
get(stack) {
|
|
57
|
+
const forBlock = stack.pushBlockScope();
|
|
58
|
+
for (this.init?.get(stack); this.test?.get(stack) ?? true; this.update?.get(stack)) {
|
|
59
|
+
const result = this.body.get(stack);
|
|
60
|
+
// useless case, as it at the end of for statement
|
|
61
|
+
// an array/block statement, should return last signal
|
|
62
|
+
if (result instanceof TerminateReturnType) {
|
|
63
|
+
if (result.type === 'continue') {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
52
69
|
}
|
|
53
|
-
|
|
54
|
-
|
|
70
|
+
if (result instanceof ReturnValue) {
|
|
71
|
+
stack.clearTo(forBlock);
|
|
72
|
+
return result;
|
|
55
73
|
}
|
|
56
74
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
75
|
+
stack.clearTo(forBlock);
|
|
76
|
+
return void 0;
|
|
61
77
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
78
|
+
dependency(computed) {
|
|
79
|
+
let dependency = this.body.dependency(computed);
|
|
80
|
+
this.init && (dependency = dependency.concat(this.init.dependency(computed)));
|
|
81
|
+
this.test && (dependency = dependency.concat(this.test.dependency(computed)));
|
|
82
|
+
this.update && (dependency = dependency.concat(this.update.dependency(computed)));
|
|
83
|
+
return dependency;
|
|
84
|
+
}
|
|
85
|
+
dependencyPath(computed) {
|
|
86
|
+
let dependencyPath = this.body.dependencyPath(computed);
|
|
87
|
+
this.init && (dependencyPath = dependencyPath.concat(this.init.dependencyPath(computed)));
|
|
88
|
+
this.test && (dependencyPath = dependencyPath.concat(this.test.dependencyPath(computed)));
|
|
89
|
+
this.update && (dependencyPath = dependencyPath.concat(this.update.dependencyPath(computed)));
|
|
90
|
+
return dependencyPath;
|
|
91
|
+
}
|
|
92
|
+
toString() {
|
|
93
|
+
return `for (${this.init?.toString()};${this.test?.toString()};${this.init?.toString()}) ${this.body.toString()}`;
|
|
94
|
+
}
|
|
95
|
+
toJson() {
|
|
96
|
+
return {
|
|
97
|
+
body: this.body.toJSON(),
|
|
98
|
+
init: this.init?.toJSON(),
|
|
99
|
+
test: this.test?.toJSON(),
|
|
100
|
+
update: this.update?.toJSON(),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
return ForNode = _classThis;
|
|
105
|
+
})();
|
|
106
|
+
export let ForOfNode = (() => {
|
|
107
|
+
let _classDecorators_1 = [Deserializer('ForOfStatement')];
|
|
108
|
+
let _classDescriptor_1;
|
|
109
|
+
let _classExtraInitializers_1 = [];
|
|
110
|
+
let _classThis_1;
|
|
111
|
+
var ForOfNode = class extends AbstractExpressionNode {
|
|
112
|
+
static {
|
|
113
|
+
__esDecorate(null, _classDescriptor_1 = { value: this }, _classDecorators_1, { kind: "class", name: this.name }, null, _classExtraInitializers_1);
|
|
114
|
+
ForOfNode = _classThis_1 = _classDescriptor_1.value;
|
|
115
|
+
__runInitializers(_classThis_1, _classExtraInitializers_1);
|
|
116
|
+
}
|
|
117
|
+
left;
|
|
118
|
+
right;
|
|
119
|
+
body;
|
|
120
|
+
static fromJSON(node, deserializer) {
|
|
121
|
+
return new ForOfNode(deserializer(node.left), deserializer(node.right), deserializer(node.body), node.range, node.loc);
|
|
122
|
+
}
|
|
123
|
+
static visit(node, visitNode) {
|
|
124
|
+
visitNode(node.left);
|
|
125
|
+
visitNode(node.right);
|
|
126
|
+
visitNode(node.body);
|
|
127
|
+
}
|
|
128
|
+
constructor(left, right, body, range, loc) {
|
|
129
|
+
super(range, loc);
|
|
130
|
+
this.left = left;
|
|
131
|
+
this.right = right;
|
|
132
|
+
this.body = body;
|
|
133
|
+
}
|
|
134
|
+
getLeft() {
|
|
135
|
+
return this.left;
|
|
136
|
+
}
|
|
137
|
+
getRight() {
|
|
138
|
+
return this.right;
|
|
139
|
+
}
|
|
140
|
+
getBody() {
|
|
141
|
+
return this.body;
|
|
142
|
+
}
|
|
143
|
+
set(stack, value) {
|
|
144
|
+
throw new Error(`ForOfNode#set() has no implementation.`);
|
|
145
|
+
}
|
|
146
|
+
get(stack) {
|
|
147
|
+
const iterable = this.right.get(stack);
|
|
148
|
+
for (const iterator of iterable) {
|
|
149
|
+
const forBlock = stack.pushBlockScope();
|
|
150
|
+
this.left.declareVariable(stack, iterator);
|
|
151
|
+
const result = this.body.get(stack);
|
|
152
|
+
// useless case, as it at the end of for statement
|
|
153
|
+
// an array/block statement, should return last signal
|
|
154
|
+
if (result instanceof TerminateReturnType) {
|
|
155
|
+
if (result.type === 'continue') {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
134
161
|
}
|
|
135
|
-
else {
|
|
136
|
-
|
|
162
|
+
else if (result instanceof ReturnValue) {
|
|
163
|
+
stack.clearTo(forBlock);
|
|
164
|
+
return result;
|
|
137
165
|
}
|
|
138
|
-
}
|
|
139
|
-
else if (result instanceof ReturnValue) {
|
|
140
166
|
stack.clearTo(forBlock);
|
|
141
|
-
return result;
|
|
142
167
|
}
|
|
143
|
-
|
|
168
|
+
return void 0;
|
|
144
169
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
Deserializer('
|
|
166
|
-
|
|
167
|
-
]
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
170
|
+
dependency(computed) {
|
|
171
|
+
return this.right.dependency(computed);
|
|
172
|
+
}
|
|
173
|
+
dependencyPath(computed) {
|
|
174
|
+
return this.right.dependencyPath(computed);
|
|
175
|
+
}
|
|
176
|
+
toString() {
|
|
177
|
+
return `for (${this.left?.toString()} of ${this.right.toString()}) ${this.body.toString()}`;
|
|
178
|
+
}
|
|
179
|
+
toJson() {
|
|
180
|
+
return {
|
|
181
|
+
left: this.left.toJSON(),
|
|
182
|
+
right: this.right.toJSON(),
|
|
183
|
+
body: this.body.toJSON(),
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
return ForOfNode = _classThis_1;
|
|
188
|
+
})();
|
|
189
|
+
export let ForInNode = (() => {
|
|
190
|
+
let _classDecorators_2 = [Deserializer('ForInStatement')];
|
|
191
|
+
let _classDescriptor_2;
|
|
192
|
+
let _classExtraInitializers_2 = [];
|
|
193
|
+
let _classThis_2;
|
|
194
|
+
var ForInNode = class extends AbstractExpressionNode {
|
|
195
|
+
static {
|
|
196
|
+
__esDecorate(null, _classDescriptor_2 = { value: this }, _classDecorators_2, { kind: "class", name: this.name }, null, _classExtraInitializers_2);
|
|
197
|
+
ForInNode = _classThis_2 = _classDescriptor_2.value;
|
|
198
|
+
__runInitializers(_classThis_2, _classExtraInitializers_2);
|
|
199
|
+
}
|
|
200
|
+
left;
|
|
201
|
+
right;
|
|
202
|
+
body;
|
|
203
|
+
static fromJSON(node, deserializer) {
|
|
204
|
+
return new ForInNode(deserializer(node.left), deserializer(node.right), deserializer(node.body), node.range, node.loc);
|
|
205
|
+
}
|
|
206
|
+
static visit(node, visitNode) {
|
|
207
|
+
visitNode(node.left);
|
|
208
|
+
visitNode(node.right);
|
|
209
|
+
visitNode(node.body);
|
|
210
|
+
}
|
|
211
|
+
// variable of iterable
|
|
212
|
+
constructor(left, right, body, range, loc) {
|
|
213
|
+
super(range, loc);
|
|
214
|
+
this.left = left;
|
|
215
|
+
this.right = right;
|
|
216
|
+
this.body = body;
|
|
217
|
+
}
|
|
218
|
+
getLeft() {
|
|
219
|
+
return this.left;
|
|
220
|
+
}
|
|
221
|
+
getRight() {
|
|
222
|
+
return this.right;
|
|
223
|
+
}
|
|
224
|
+
getBody() {
|
|
225
|
+
return this.body;
|
|
226
|
+
}
|
|
227
|
+
set(stack, value) {
|
|
228
|
+
throw new Error(`ForOfNode#set() has no implementation.`);
|
|
229
|
+
}
|
|
230
|
+
get(stack) {
|
|
231
|
+
const iterable = this.right.get(stack);
|
|
232
|
+
for (const iterator in iterable) {
|
|
233
|
+
const forBlock = stack.pushBlockScope();
|
|
234
|
+
this.left.declareVariable(stack, iterator);
|
|
235
|
+
const result = this.body.get(stack);
|
|
236
|
+
// useless case, as it at the end of for statement
|
|
237
|
+
// an array/block statement, should return last signal
|
|
238
|
+
if (result instanceof TerminateReturnType) {
|
|
239
|
+
if (result.type === 'continue') {
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
208
245
|
}
|
|
209
|
-
else {
|
|
210
|
-
|
|
246
|
+
else if (result instanceof ReturnValue) {
|
|
247
|
+
stack.clearTo(forBlock);
|
|
248
|
+
return result;
|
|
211
249
|
}
|
|
250
|
+
stack.clearTo(forBlock);
|
|
212
251
|
}
|
|
213
|
-
|
|
252
|
+
return void 0;
|
|
253
|
+
}
|
|
254
|
+
dependency(computed) {
|
|
255
|
+
return this.right.dependency(computed);
|
|
256
|
+
}
|
|
257
|
+
dependencyPath(computed) {
|
|
258
|
+
return this.right.dependencyPath(computed);
|
|
259
|
+
}
|
|
260
|
+
toString() {
|
|
261
|
+
return `for (${this.left.toString()} in ${this.right.toString()}) ${this.body.toString()}`;
|
|
262
|
+
}
|
|
263
|
+
toJson() {
|
|
264
|
+
return {
|
|
265
|
+
left: this.left.toJSON(),
|
|
266
|
+
right: this.right.toJSON(),
|
|
267
|
+
body: this.body.toJSON(),
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
return ForInNode = _classThis_2;
|
|
272
|
+
})();
|
|
273
|
+
export let ForAwaitOfNode = (() => {
|
|
274
|
+
let _classDecorators_3 = [Deserializer('ForAwaitOfStatement')];
|
|
275
|
+
let _classDescriptor_3;
|
|
276
|
+
let _classExtraInitializers_3 = [];
|
|
277
|
+
let _classThis_3;
|
|
278
|
+
var ForAwaitOfNode = class extends AbstractExpressionNode {
|
|
279
|
+
static {
|
|
280
|
+
__esDecorate(null, _classDescriptor_3 = { value: this }, _classDecorators_3, { kind: "class", name: this.name }, null, _classExtraInitializers_3);
|
|
281
|
+
ForAwaitOfNode = _classThis_3 = _classDescriptor_3.value;
|
|
282
|
+
__runInitializers(_classThis_3, _classExtraInitializers_3);
|
|
283
|
+
}
|
|
284
|
+
left;
|
|
285
|
+
right;
|
|
286
|
+
body;
|
|
287
|
+
static fromJSON(node, deserializer) {
|
|
288
|
+
return new ForAwaitOfNode(deserializer(node.left), deserializer(node.right), deserializer(node.body), node.range, node.loc);
|
|
289
|
+
}
|
|
290
|
+
static visit(node, visitNode) {
|
|
291
|
+
visitNode(node.left);
|
|
292
|
+
visitNode(node.right);
|
|
293
|
+
visitNode(node.body);
|
|
294
|
+
}
|
|
295
|
+
// variable of iterable
|
|
296
|
+
constructor(left, right, body, range, loc) {
|
|
297
|
+
super(range, loc);
|
|
298
|
+
this.left = left;
|
|
299
|
+
this.right = right;
|
|
300
|
+
this.body = body;
|
|
301
|
+
}
|
|
302
|
+
getLeft() {
|
|
303
|
+
return this.left;
|
|
304
|
+
}
|
|
305
|
+
getRight() {
|
|
306
|
+
return this.right;
|
|
307
|
+
}
|
|
308
|
+
getBody() {
|
|
309
|
+
return this.body;
|
|
310
|
+
}
|
|
311
|
+
set(stack, value) {
|
|
312
|
+
throw new Error(`ForAwaitOfNode#set() has no implementation.`);
|
|
313
|
+
}
|
|
314
|
+
get(stack) {
|
|
315
|
+
const iterable = this.right.get(stack);
|
|
316
|
+
const forAwaitBody = (iterator) => {
|
|
317
|
+
const forBlock = stack.pushBlockScope();
|
|
318
|
+
this.left.declareVariable(stack, iterator);
|
|
319
|
+
const result = this.body.get(stack);
|
|
214
320
|
stack.clearTo(forBlock);
|
|
215
321
|
return result;
|
|
216
|
-
}
|
|
217
|
-
stack.
|
|
322
|
+
};
|
|
323
|
+
stack.forAwaitAsyncIterable = { iterable, forAwaitBody };
|
|
218
324
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
};
|
|
238
|
-
ForInNode = ForInNode_1 = __decorate([
|
|
239
|
-
Deserializer('ForInStatement'),
|
|
240
|
-
__metadata("design:paramtypes", [Object, Object, Object, Array, Object])
|
|
241
|
-
], ForInNode);
|
|
242
|
-
export { ForInNode };
|
|
243
|
-
let ForAwaitOfNode = ForAwaitOfNode_1 = class ForAwaitOfNode extends AbstractExpressionNode {
|
|
244
|
-
static fromJSON(node, deserializer) {
|
|
245
|
-
return new ForAwaitOfNode_1(deserializer(node.left), deserializer(node.right), deserializer(node.body), node.range, node.loc);
|
|
246
|
-
}
|
|
247
|
-
static visit(node, visitNode) {
|
|
248
|
-
visitNode(node.left);
|
|
249
|
-
visitNode(node.right);
|
|
250
|
-
visitNode(node.body);
|
|
251
|
-
}
|
|
252
|
-
// variable of iterable
|
|
253
|
-
constructor(left, right, body, range, loc) {
|
|
254
|
-
super(range, loc);
|
|
255
|
-
this.left = left;
|
|
256
|
-
this.right = right;
|
|
257
|
-
this.body = body;
|
|
258
|
-
}
|
|
259
|
-
getLeft() {
|
|
260
|
-
return this.left;
|
|
261
|
-
}
|
|
262
|
-
getRight() {
|
|
263
|
-
return this.right;
|
|
264
|
-
}
|
|
265
|
-
getBody() {
|
|
266
|
-
return this.body;
|
|
267
|
-
}
|
|
268
|
-
set(stack, value) {
|
|
269
|
-
throw new Error(`ForAwaitOfNode#set() has no implementation.`);
|
|
270
|
-
}
|
|
271
|
-
get(stack) {
|
|
272
|
-
const iterable = this.right.get(stack);
|
|
273
|
-
const forAwaitBody = (iterator) => {
|
|
274
|
-
const forBlock = stack.pushBlockScope();
|
|
275
|
-
this.left.declareVariable(stack, iterator);
|
|
276
|
-
const result = this.body.get(stack);
|
|
277
|
-
stack.clearTo(forBlock);
|
|
278
|
-
return result;
|
|
279
|
-
};
|
|
280
|
-
stack.forAwaitAsyncIterable = { iterable, forAwaitBody };
|
|
281
|
-
}
|
|
282
|
-
dependency(computed) {
|
|
283
|
-
return this.right.dependency(computed);
|
|
284
|
-
}
|
|
285
|
-
dependencyPath(computed) {
|
|
286
|
-
return this.right.dependencyPath(computed);
|
|
287
|
-
}
|
|
288
|
-
toString() {
|
|
289
|
-
return `for (${this.left?.toString()} of ${this.right.toString()}) ${this.body.toString()}`;
|
|
290
|
-
}
|
|
291
|
-
toJson() {
|
|
292
|
-
return {
|
|
293
|
-
left: this.left.toJSON(),
|
|
294
|
-
right: this.right.toJSON(),
|
|
295
|
-
body: this.body.toJSON(),
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
ForAwaitOfNode = ForAwaitOfNode_1 = __decorate([
|
|
300
|
-
Deserializer('ForAwaitOfStatement'),
|
|
301
|
-
__metadata("design:paramtypes", [Object, Object, Object, Array, Object])
|
|
302
|
-
], ForAwaitOfNode);
|
|
303
|
-
export { ForAwaitOfNode };
|
|
325
|
+
dependency(computed) {
|
|
326
|
+
return this.right.dependency(computed);
|
|
327
|
+
}
|
|
328
|
+
dependencyPath(computed) {
|
|
329
|
+
return this.right.dependencyPath(computed);
|
|
330
|
+
}
|
|
331
|
+
toString() {
|
|
332
|
+
return `for (${this.left?.toString()} of ${this.right.toString()}) ${this.body.toString()}`;
|
|
333
|
+
}
|
|
334
|
+
toJson() {
|
|
335
|
+
return {
|
|
336
|
+
left: this.left.toJSON(),
|
|
337
|
+
right: this.right.toJSON(),
|
|
338
|
+
body: this.body.toJSON(),
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
return ForAwaitOfNode = _classThis_3;
|
|
343
|
+
})();
|
|
304
344
|
//# sourceMappingURL=for.js.map
|