@quenk/wml 2.13.11 → 2.14.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/lib/cli.d.ts +8 -8
- package/lib/cli.js +1 -3
- package/lib/cli.js.map +1 -1
- package/lib/cli.ts +48 -60
- package/lib/compile/codegen.d.ts +4 -9
- package/lib/compile/codegen.js +162 -367
- package/lib/compile/codegen.js.map +1 -1
- package/lib/compile/codegen.ts +644 -952
- package/lib/compile/index.d.ts +2 -2
- package/lib/compile/index.js +4 -4
- package/lib/compile/index.js.map +1 -1
- package/lib/compile/index.ts +14 -17
- package/lib/compile/transform.d.ts +1 -1
- package/lib/compile/transform.js +9 -11
- package/lib/compile/transform.js.map +1 -1
- package/lib/compile/transform.ts +136 -143
- package/lib/{dom.d.ts → dom/index.d.ts} +8 -2
- package/lib/{dom.js → dom/index.js} +84 -70
- package/lib/dom/index.js.map +1 -0
- package/lib/dom/index.ts +425 -0
- package/lib/dom/monitor.d.ts +33 -0
- package/lib/dom/monitor.js +60 -0
- package/lib/dom/monitor.js.map +1 -0
- package/lib/dom/monitor.ts +75 -0
- package/lib/index.d.ts +10 -95
- package/lib/index.js +10 -10
- package/lib/index.js.map +1 -1
- package/lib/index.ts +57 -182
- package/lib/main.js +17 -17
- package/lib/main.js.map +1 -1
- package/lib/main.ts +38 -44
- package/lib/parse/ast.d.ts +2 -2
- package/lib/parse/ast.js +52 -53
- package/lib/parse/ast.js.map +1 -1
- package/lib/parse/ast.ts +396 -483
- package/lib/parse/generated.d.ts +3 -5
- package/lib/parse/generated.js +9504 -9264
- package/lib/parse/index.d.ts +2 -3
- package/lib/parse/index.js.map +1 -1
- package/lib/parse/index.ts +7 -9
- package/lib/parse/test.js +194 -192
- package/lib/parse/test.js.map +1 -1
- package/lib/parse/test.ts +294 -404
- package/lib/parse/wml.y +4 -0
- package/lib/tsconfig.json +19 -20
- package/lib/util.d.ts +10 -0
- package/lib/util.js +21 -0
- package/lib/util.js.map +1 -0
- package/lib/util.ts +39 -0
- package/lib/view/frame.d.ts +103 -0
- package/lib/view/frame.js +206 -0
- package/lib/view/frame.js.map +1 -0
- package/lib/view/frame.ts +249 -0
- package/lib/view/index.d.ts +58 -0
- package/lib/view/index.js +48 -0
- package/lib/view/index.js.map +1 -0
- package/lib/view/index.ts +97 -0
- package/package.json +3 -3
- package/lib/dom.js.map +0 -1
- package/lib/dom.ts +0 -479
package/lib/parse/ast.ts
CHANGED
|
@@ -6,20 +6,16 @@
|
|
|
6
6
|
* Location is jison's location tracking information.
|
|
7
7
|
*/
|
|
8
8
|
export interface Location {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
9
|
+
[key: string]: string | number;
|
|
10
|
+
}
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* AST is the interface of all the nodes
|
|
16
14
|
*/
|
|
17
15
|
export interface AST {
|
|
16
|
+
type: string;
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
location: Location
|
|
22
|
-
|
|
18
|
+
location: Location;
|
|
23
19
|
}
|
|
24
20
|
|
|
25
21
|
/**
|
|
@@ -30,48 +26,43 @@ export interface AST {
|
|
|
30
26
|
* as private here.
|
|
31
27
|
*/
|
|
32
28
|
export class Module {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
29
|
+
type = "module";
|
|
30
|
+
|
|
31
|
+
constructor(
|
|
32
|
+
public imports: ImportStatement[],
|
|
33
|
+
public exports: Export[],
|
|
34
|
+
public location: Location,
|
|
35
|
+
) {}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* clone this node.
|
|
39
|
+
*/
|
|
40
|
+
clone() {
|
|
41
|
+
return new Module(
|
|
42
|
+
this.imports.slice(),
|
|
43
|
+
this.exports.slice(),
|
|
44
|
+
this.location,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
51
47
|
}
|
|
52
48
|
|
|
53
49
|
/**
|
|
54
50
|
* ImportStatement
|
|
55
51
|
*/
|
|
56
52
|
export class ImportStatement {
|
|
53
|
+
type = "import-statement";
|
|
57
54
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
public location: Location) { }
|
|
64
|
-
|
|
55
|
+
constructor(
|
|
56
|
+
public member: ImportMember,
|
|
57
|
+
public module: StringLiteral,
|
|
58
|
+
public location: Location,
|
|
59
|
+
) {}
|
|
65
60
|
}
|
|
66
61
|
|
|
67
62
|
/**
|
|
68
63
|
* ImportMember
|
|
69
64
|
*/
|
|
70
|
-
export type ImportMember
|
|
71
|
-
= AggregateMember
|
|
72
|
-
| AliasedMember
|
|
73
|
-
| CompositeMember
|
|
74
|
-
;
|
|
65
|
+
export type ImportMember = AggregateMember | AliasedMember | CompositeMember;
|
|
75
66
|
|
|
76
67
|
/**
|
|
77
68
|
* AliasedMember
|
|
@@ -79,25 +70,25 @@ export type ImportMember
|
|
|
79
70
|
* @property {Identifier} member - The identifier that is aliased.
|
|
80
71
|
*/
|
|
81
72
|
export class AliasedMember {
|
|
73
|
+
type = "aliased-member";
|
|
82
74
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
public location: Location) { }
|
|
89
|
-
|
|
75
|
+
constructor(
|
|
76
|
+
public member: Member,
|
|
77
|
+
public alias: Member,
|
|
78
|
+
public location: Location,
|
|
79
|
+
) {}
|
|
90
80
|
}
|
|
91
81
|
|
|
92
82
|
/**
|
|
93
83
|
* AggregateMember
|
|
94
84
|
*/
|
|
95
85
|
export class AggregateMember {
|
|
86
|
+
type = "qualified-member";
|
|
96
87
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
constructor(
|
|
89
|
+
public id: Member,
|
|
90
|
+
public location: Location,
|
|
91
|
+
) {}
|
|
101
92
|
}
|
|
102
93
|
|
|
103
94
|
/**
|
|
@@ -105,42 +96,36 @@ export class AggregateMember {
|
|
|
105
96
|
* @property {...Identifier|Aliased_Member} members
|
|
106
97
|
*/
|
|
107
98
|
export class CompositeMember {
|
|
99
|
+
type = "composite-member";
|
|
108
100
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
public location: Location) { }
|
|
114
|
-
|
|
101
|
+
constructor(
|
|
102
|
+
public members: (Member | AliasedMember)[],
|
|
103
|
+
public location: Location,
|
|
104
|
+
) {}
|
|
115
105
|
}
|
|
116
106
|
|
|
117
|
-
export type Member
|
|
118
|
-
= UnqualifiedIdentifier
|
|
119
|
-
| UnqualifiedConstructor
|
|
120
|
-
;
|
|
107
|
+
export type Member = UnqualifiedIdentifier | UnqualifiedConstructor;
|
|
121
108
|
|
|
122
|
-
export type Export
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
;
|
|
109
|
+
export type Export =
|
|
110
|
+
| AliasStatement
|
|
111
|
+
| ContextStatement
|
|
112
|
+
| LetStatement
|
|
113
|
+
| FunStatement
|
|
114
|
+
| ViewStatement
|
|
115
|
+
| Tag;
|
|
130
116
|
|
|
131
117
|
/**
|
|
132
118
|
* AliasStatement
|
|
133
119
|
*/
|
|
134
120
|
export class AliasStatement {
|
|
121
|
+
type = "alias-statement";
|
|
135
122
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
public location: Location) { }
|
|
143
|
-
|
|
123
|
+
constructor(
|
|
124
|
+
public id: UnqualifiedConstructor,
|
|
125
|
+
public typeParameters: TypeParameter[],
|
|
126
|
+
public members: Type[],
|
|
127
|
+
public location: Location,
|
|
128
|
+
) {}
|
|
144
129
|
}
|
|
145
130
|
|
|
146
131
|
export type ContextStatementMember = ConstructorType | MemberDeclaration;
|
|
@@ -149,653 +134,581 @@ export type ContextStatementMember = ConstructorType | MemberDeclaration;
|
|
|
149
134
|
* ContextStatement
|
|
150
135
|
*/
|
|
151
136
|
export class ContextStatement {
|
|
137
|
+
type = "context-statement";
|
|
152
138
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
public location: Location) { }
|
|
160
|
-
|
|
139
|
+
constructor(
|
|
140
|
+
public id: UnqualifiedConstructor,
|
|
141
|
+
public typeParameters: TypeParameter[],
|
|
142
|
+
public members: ContextStatementMember[],
|
|
143
|
+
public location: Location,
|
|
144
|
+
) {}
|
|
161
145
|
}
|
|
162
146
|
|
|
163
147
|
/**
|
|
164
148
|
* MemberDeclaration
|
|
165
149
|
*/
|
|
166
150
|
export class MemberDeclaration {
|
|
151
|
+
type = "member-declaration";
|
|
167
152
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
public location: Location) { }
|
|
175
|
-
|
|
153
|
+
constructor(
|
|
154
|
+
public path: UnqualifiedIdentifier[],
|
|
155
|
+
public kind: Type,
|
|
156
|
+
public optional: boolean,
|
|
157
|
+
public location: Location,
|
|
158
|
+
) {}
|
|
176
159
|
}
|
|
177
160
|
|
|
178
161
|
/**
|
|
179
162
|
* LetStatement
|
|
180
163
|
*/
|
|
181
164
|
export class LetStatement {
|
|
165
|
+
type = "let-statement";
|
|
182
166
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
public location: Location) { }
|
|
190
|
-
|
|
167
|
+
constructor(
|
|
168
|
+
public id: UnqualifiedIdentifier,
|
|
169
|
+
public cons: ConstructorType,
|
|
170
|
+
public expression: Expression,
|
|
171
|
+
public location: Location,
|
|
172
|
+
) {}
|
|
191
173
|
}
|
|
192
174
|
|
|
193
|
-
export type ContextTypeIndicator
|
|
194
|
-
= ConstructorType
|
|
195
|
-
| ContextFromStatement
|
|
196
|
-
;
|
|
175
|
+
export type ContextTypeIndicator = ConstructorType | ContextFromStatement;
|
|
197
176
|
|
|
198
177
|
/**
|
|
199
178
|
* ContextFromStatement
|
|
200
179
|
*/
|
|
201
180
|
export class ContextFromStatement {
|
|
181
|
+
type = "context-from-statement";
|
|
202
182
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
public location: Location) { }
|
|
209
|
-
|
|
183
|
+
constructor(
|
|
184
|
+
public cons: ConstructorType,
|
|
185
|
+
public module: StringLiteral,
|
|
186
|
+
public location: Location,
|
|
187
|
+
) {}
|
|
210
188
|
}
|
|
211
189
|
|
|
212
190
|
/**
|
|
213
191
|
* ViewStatement
|
|
214
192
|
*/
|
|
215
193
|
export class ViewStatement {
|
|
194
|
+
type = "view-statement";
|
|
216
195
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
public location: Location) { }
|
|
226
|
-
|
|
196
|
+
constructor(
|
|
197
|
+
public id: UnqualifiedConstructor,
|
|
198
|
+
public typeParameters: TypeParameter[],
|
|
199
|
+
public context: ContextTypeIndicator | undefined,
|
|
200
|
+
public directives: LetStatement[],
|
|
201
|
+
public root: Tag,
|
|
202
|
+
public location: Location,
|
|
203
|
+
) {}
|
|
227
204
|
}
|
|
228
205
|
|
|
229
206
|
export class FunStatement {
|
|
207
|
+
type = "fun-statement";
|
|
230
208
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
public location: Location) { }
|
|
239
|
-
|
|
209
|
+
constructor(
|
|
210
|
+
public id: UnqualifiedIdentifier,
|
|
211
|
+
public typeParameters: TypeParameter[],
|
|
212
|
+
public parameters: Parameter[],
|
|
213
|
+
public body: Child[],
|
|
214
|
+
public location: Location,
|
|
215
|
+
) {}
|
|
240
216
|
}
|
|
241
217
|
|
|
242
218
|
/**
|
|
243
219
|
* TypeParameter
|
|
244
220
|
*/
|
|
245
221
|
export class TypeParameter {
|
|
222
|
+
type = "type-parameter";
|
|
246
223
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
public location: Location) { }
|
|
253
|
-
|
|
224
|
+
constructor(
|
|
225
|
+
public id: UnqualifiedConstructor,
|
|
226
|
+
public constraint: Type,
|
|
227
|
+
public location: Location,
|
|
228
|
+
) {}
|
|
254
229
|
}
|
|
255
230
|
|
|
256
231
|
/**
|
|
257
232
|
* Type
|
|
258
233
|
*/
|
|
259
|
-
export type Type
|
|
260
|
-
= ConstructorType
|
|
261
|
-
| FunctionType
|
|
262
|
-
| RecordType
|
|
263
|
-
| ListType
|
|
264
|
-
;
|
|
234
|
+
export type Type = ConstructorType | FunctionType | RecordType | ListType;
|
|
265
235
|
|
|
266
236
|
/**
|
|
267
237
|
* ConstructorType
|
|
268
238
|
*/
|
|
269
239
|
export class ConstructorType {
|
|
240
|
+
type = "constructor-type";
|
|
270
241
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
public location: Location) { }
|
|
277
|
-
|
|
242
|
+
constructor(
|
|
243
|
+
public id: UnqualifiedIdentifier | Constructor,
|
|
244
|
+
public typeParameters: TypeParameter[],
|
|
245
|
+
public location: Location,
|
|
246
|
+
) {}
|
|
278
247
|
}
|
|
279
248
|
|
|
280
249
|
/**
|
|
281
250
|
* FunctionType
|
|
282
251
|
*/
|
|
283
252
|
export class FunctionType {
|
|
253
|
+
type = "function-type";
|
|
284
254
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
public location: Location) { }
|
|
291
|
-
|
|
255
|
+
constructor(
|
|
256
|
+
public parameters: Type[],
|
|
257
|
+
public returnType: Type,
|
|
258
|
+
public location: Location,
|
|
259
|
+
) {}
|
|
292
260
|
}
|
|
293
261
|
|
|
294
262
|
/**
|
|
295
263
|
* RecordType
|
|
296
264
|
*/
|
|
297
265
|
export class RecordType {
|
|
266
|
+
type = "record-type";
|
|
298
267
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
public location: Location) { }
|
|
304
|
-
|
|
268
|
+
constructor(
|
|
269
|
+
public members: MemberDeclaration[],
|
|
270
|
+
public location: Location,
|
|
271
|
+
) {}
|
|
305
272
|
}
|
|
306
273
|
|
|
307
274
|
/**
|
|
308
275
|
* ListType
|
|
309
276
|
*/
|
|
310
277
|
export class ListType {
|
|
278
|
+
type = "list-type";
|
|
311
279
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
public location: Location) { }
|
|
317
|
-
|
|
280
|
+
constructor(
|
|
281
|
+
public elementType: Type,
|
|
282
|
+
public location: Location,
|
|
283
|
+
) {}
|
|
318
284
|
}
|
|
319
285
|
|
|
320
286
|
/**
|
|
321
287
|
* TupleType
|
|
322
288
|
*/
|
|
323
289
|
export class TupleType {
|
|
290
|
+
type = "tuple-type";
|
|
324
291
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
public location: Location) { }
|
|
330
|
-
|
|
292
|
+
constructor(
|
|
293
|
+
public members: Type[],
|
|
294
|
+
public location: Location,
|
|
295
|
+
) {}
|
|
331
296
|
}
|
|
332
297
|
|
|
333
|
-
|
|
334
298
|
/**
|
|
335
299
|
* Parameter
|
|
336
300
|
*/
|
|
337
|
-
export type Parameter
|
|
338
|
-
= TypedParameter
|
|
339
|
-
| UntypedParameter
|
|
340
|
-
;
|
|
301
|
+
export type Parameter = TypedParameter | UntypedParameter;
|
|
341
302
|
|
|
342
303
|
/**
|
|
343
304
|
* TypeParameter
|
|
344
305
|
*/
|
|
345
306
|
export class TypedParameter {
|
|
307
|
+
type = "typed-parameter";
|
|
346
308
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
public location: Location) { }
|
|
353
|
-
|
|
309
|
+
constructor(
|
|
310
|
+
public id: UnqualifiedIdentifier,
|
|
311
|
+
public hint: Type,
|
|
312
|
+
public location: Location,
|
|
313
|
+
) {}
|
|
354
314
|
}
|
|
355
315
|
|
|
356
316
|
export class UntypedParameter {
|
|
317
|
+
type = "untyped-parameter";
|
|
357
318
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
public location: Location) { }
|
|
363
|
-
|
|
319
|
+
constructor(
|
|
320
|
+
public id: UnqualifiedIdentifier,
|
|
321
|
+
public location: Location,
|
|
322
|
+
) {}
|
|
364
323
|
}
|
|
365
324
|
|
|
366
|
-
export type Child
|
|
367
|
-
= Tag
|
|
368
|
-
| Interpolation
|
|
369
|
-
| Control
|
|
370
|
-
| Characters
|
|
371
|
-
| Identifier
|
|
372
|
-
;
|
|
325
|
+
export type Child = Tag | Interpolation | Control | Characters | Identifier;
|
|
373
326
|
|
|
374
|
-
export type Tag
|
|
375
|
-
= Node
|
|
376
|
-
| Widget
|
|
377
|
-
;
|
|
327
|
+
export type Tag = Node | Widget;
|
|
378
328
|
|
|
379
329
|
export class Node {
|
|
330
|
+
type = "node";
|
|
380
331
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
public close: Identifier) { }
|
|
388
|
-
|
|
332
|
+
constructor(
|
|
333
|
+
public open: Identifier,
|
|
334
|
+
public attributes: Attribute[],
|
|
335
|
+
public children: Child[],
|
|
336
|
+
public close: Identifier,
|
|
337
|
+
) {}
|
|
389
338
|
}
|
|
390
339
|
|
|
391
340
|
export class Widget {
|
|
341
|
+
type = "widget";
|
|
392
342
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
public close: Constructor) { }
|
|
401
|
-
|
|
343
|
+
constructor(
|
|
344
|
+
public open: Constructor,
|
|
345
|
+
public typeArgs: Type[],
|
|
346
|
+
public attributes: Attribute[],
|
|
347
|
+
public children: Child[],
|
|
348
|
+
public close: Constructor,
|
|
349
|
+
) {}
|
|
402
350
|
}
|
|
403
351
|
|
|
404
352
|
export class Attribute {
|
|
353
|
+
type = "attribute";
|
|
405
354
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
public location: Location) { }
|
|
413
|
-
|
|
355
|
+
constructor(
|
|
356
|
+
public namespace: UnqualifiedIdentifier,
|
|
357
|
+
public name: UnqualifiedIdentifier,
|
|
358
|
+
public value: AttributeValue,
|
|
359
|
+
public location: Location,
|
|
360
|
+
) {}
|
|
414
361
|
}
|
|
415
362
|
|
|
416
|
-
export type AttributeValue
|
|
417
|
-
= Interpolation
|
|
418
|
-
| Literal
|
|
419
|
-
;
|
|
363
|
+
export type AttributeValue = Interpolation | Literal;
|
|
420
364
|
|
|
421
365
|
export class Interpolation {
|
|
366
|
+
type = "interpolation";
|
|
422
367
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
public location: Location) { }
|
|
429
|
-
|
|
368
|
+
constructor(
|
|
369
|
+
public expression: Expression,
|
|
370
|
+
public filters: Expression[],
|
|
371
|
+
public location: Location,
|
|
372
|
+
) {}
|
|
430
373
|
}
|
|
431
374
|
|
|
432
|
-
export type Control
|
|
433
|
-
= ForStatement
|
|
434
|
-
| IfStatement
|
|
435
|
-
;
|
|
375
|
+
export type Control = ForStatement | IfStatement;
|
|
436
376
|
|
|
437
|
-
export abstract class ForStatement
|
|
438
|
-
|
|
439
|
-
abstract type: string;
|
|
440
|
-
|
|
441
|
-
constructor(
|
|
442
|
-
public body: Child[],
|
|
443
|
-
public otherwise: Child[],
|
|
444
|
-
public location: Location) { }
|
|
377
|
+
export abstract class ForStatement {
|
|
378
|
+
abstract type: string;
|
|
445
379
|
|
|
380
|
+
constructor(
|
|
381
|
+
public body: Child[],
|
|
382
|
+
public otherwise: Child[],
|
|
383
|
+
public location: Location,
|
|
384
|
+
) {}
|
|
446
385
|
}
|
|
447
386
|
|
|
448
387
|
export class ForInStatement extends ForStatement {
|
|
388
|
+
type = "for-in-statement";
|
|
449
389
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
390
|
+
constructor(
|
|
391
|
+
public variables: Parameter[],
|
|
392
|
+
public expression: Expression,
|
|
393
|
+
public body: Child[],
|
|
394
|
+
public otherwise: Child[],
|
|
395
|
+
public location: Location,
|
|
396
|
+
) {
|
|
397
|
+
super(body, otherwise, location);
|
|
398
|
+
}
|
|
459
399
|
}
|
|
460
400
|
|
|
461
401
|
export class ForOfStatement extends ForStatement {
|
|
402
|
+
type = "for-of-statement";
|
|
462
403
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
404
|
+
constructor(
|
|
405
|
+
public variables: Parameter[],
|
|
406
|
+
public expression: Expression,
|
|
407
|
+
public body: Child[],
|
|
408
|
+
public otherwise: Child[],
|
|
409
|
+
public location: Location,
|
|
410
|
+
) {
|
|
411
|
+
super(body, otherwise, location);
|
|
412
|
+
}
|
|
472
413
|
}
|
|
473
414
|
|
|
474
415
|
export class ForFromStatement extends ForStatement {
|
|
416
|
+
type = "for-from-statement";
|
|
475
417
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
418
|
+
constructor(
|
|
419
|
+
public variable: UntypedParameter,
|
|
420
|
+
public start: Expression,
|
|
421
|
+
public end: Expression,
|
|
422
|
+
public body: Child[],
|
|
423
|
+
public otherwise: Child[],
|
|
424
|
+
public location: Location,
|
|
425
|
+
) {
|
|
426
|
+
super(body, otherwise, location);
|
|
427
|
+
}
|
|
486
428
|
}
|
|
487
429
|
|
|
488
430
|
export class IfStatement {
|
|
431
|
+
type = "if-statement";
|
|
489
432
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
public location: Location) { }
|
|
497
|
-
|
|
433
|
+
constructor(
|
|
434
|
+
public condition: Expression,
|
|
435
|
+
public then: Child[],
|
|
436
|
+
public elseClause: ElseIfClause | ElseClause | undefined,
|
|
437
|
+
public location: Location,
|
|
438
|
+
) {}
|
|
498
439
|
}
|
|
499
440
|
|
|
500
441
|
export class ElseClause {
|
|
442
|
+
type = "else-clause";
|
|
501
443
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
public location: Location) { }
|
|
507
|
-
|
|
444
|
+
constructor(
|
|
445
|
+
public children: Child[],
|
|
446
|
+
public location: Location,
|
|
447
|
+
) {}
|
|
508
448
|
}
|
|
509
449
|
|
|
510
450
|
export class ElseIfClause {
|
|
451
|
+
type = "else-if-clause";
|
|
511
452
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
public location: Location) { }
|
|
519
|
-
|
|
453
|
+
constructor(
|
|
454
|
+
public condition: Expression,
|
|
455
|
+
public then: Child[],
|
|
456
|
+
public elseClause: ElseClause | ElseIfClause | undefined,
|
|
457
|
+
public location: Location,
|
|
458
|
+
) {}
|
|
520
459
|
}
|
|
521
460
|
|
|
522
461
|
export class Characters {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
| ContextVariable
|
|
548
|
-
;
|
|
462
|
+
type = "characters";
|
|
463
|
+
|
|
464
|
+
constructor(
|
|
465
|
+
public value: string,
|
|
466
|
+
public location: Location,
|
|
467
|
+
) {}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export type Expression =
|
|
471
|
+
| IfThenExpression
|
|
472
|
+
| BinaryExpression
|
|
473
|
+
| UnaryExpression
|
|
474
|
+
| ViewConstruction
|
|
475
|
+
| FunApplication
|
|
476
|
+
| ConstructExpression
|
|
477
|
+
| CallExpression
|
|
478
|
+
| MemberExpression
|
|
479
|
+
| ReadExpression
|
|
480
|
+
| FunctionExpression
|
|
481
|
+
| Literal
|
|
482
|
+
| ContextProperty
|
|
483
|
+
| Constructor
|
|
484
|
+
| Identifier
|
|
485
|
+
| ContextVariable;
|
|
549
486
|
|
|
550
487
|
export class IfThenExpression {
|
|
488
|
+
type = "if-then-expression";
|
|
551
489
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
public location: Location) { }
|
|
559
|
-
|
|
490
|
+
constructor(
|
|
491
|
+
public condition: Expression,
|
|
492
|
+
public iftrue: Expression,
|
|
493
|
+
public iffalse: Expression,
|
|
494
|
+
public location: Location,
|
|
495
|
+
) {}
|
|
560
496
|
}
|
|
561
497
|
|
|
562
498
|
export class BinaryExpression {
|
|
499
|
+
type = "binary-expression";
|
|
563
500
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
public location: Location) { }
|
|
571
|
-
|
|
501
|
+
constructor(
|
|
502
|
+
public left: Expression,
|
|
503
|
+
public operator: string,
|
|
504
|
+
public right: Expression | Type,
|
|
505
|
+
public location: Location,
|
|
506
|
+
) {}
|
|
572
507
|
}
|
|
573
508
|
|
|
574
509
|
export class UnaryExpression {
|
|
510
|
+
type = "unary-expression";
|
|
575
511
|
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
public expression: Expression) { }
|
|
581
|
-
|
|
512
|
+
constructor(
|
|
513
|
+
public operator: string,
|
|
514
|
+
public expression: Expression,
|
|
515
|
+
) {}
|
|
582
516
|
}
|
|
583
517
|
|
|
584
518
|
export class ViewConstruction {
|
|
519
|
+
type = "view-construction";
|
|
585
520
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
public location: Location) { }
|
|
591
|
-
|
|
521
|
+
constructor(
|
|
522
|
+
public expression: Expression,
|
|
523
|
+
public location: Location,
|
|
524
|
+
) {}
|
|
592
525
|
}
|
|
593
526
|
|
|
594
527
|
export class FunApplication {
|
|
528
|
+
type = "fun-application";
|
|
595
529
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
public location: Location) { }
|
|
603
|
-
|
|
530
|
+
constructor(
|
|
531
|
+
public target: Expression,
|
|
532
|
+
public typeArgs: Type[],
|
|
533
|
+
public args: Expression[],
|
|
534
|
+
public location: Location,
|
|
535
|
+
) {}
|
|
604
536
|
}
|
|
605
537
|
|
|
606
538
|
export class ConstructExpression {
|
|
539
|
+
type = "construct-expression";
|
|
607
540
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
public location: Location) { }
|
|
615
|
-
|
|
541
|
+
constructor(
|
|
542
|
+
public cons: Constructor,
|
|
543
|
+
public typeArgs: Type[],
|
|
544
|
+
public args: Expression[],
|
|
545
|
+
public location: Location,
|
|
546
|
+
) {}
|
|
616
547
|
}
|
|
617
548
|
|
|
618
549
|
export class CallExpression {
|
|
550
|
+
type = "call-expression";
|
|
619
551
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
public location: Location) { }
|
|
627
|
-
|
|
552
|
+
constructor(
|
|
553
|
+
public target: Expression,
|
|
554
|
+
public typeArgs: Type[],
|
|
555
|
+
public args: Expression[],
|
|
556
|
+
public location: Location,
|
|
557
|
+
) {}
|
|
628
558
|
}
|
|
629
559
|
|
|
630
560
|
/**
|
|
631
561
|
* MemberExpression
|
|
632
562
|
*/
|
|
633
563
|
export class MemberExpression {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
564
|
+
constructor(
|
|
565
|
+
public head: Expression,
|
|
566
|
+
public tail: UnqualifiedIdentifier | UnqualifiedConstructor | StringLiteral,
|
|
567
|
+
public location: Location,
|
|
568
|
+
) {}
|
|
640
569
|
}
|
|
641
570
|
|
|
642
571
|
export class ReadExpression {
|
|
572
|
+
type = "read-expression";
|
|
643
573
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
public location: Location) { }
|
|
652
|
-
|
|
574
|
+
constructor(
|
|
575
|
+
public target: Expression,
|
|
576
|
+
public path: Expression,
|
|
577
|
+
public hint: Type,
|
|
578
|
+
public defaults: Expression,
|
|
579
|
+
public location: Location,
|
|
580
|
+
) {}
|
|
653
581
|
}
|
|
654
582
|
|
|
655
583
|
export class FunctionExpression {
|
|
584
|
+
type = "function-expression";
|
|
656
585
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
public location: Location) { }
|
|
663
|
-
|
|
586
|
+
constructor(
|
|
587
|
+
public parameters: Parameter[],
|
|
588
|
+
public body: Expression,
|
|
589
|
+
public location: Location,
|
|
590
|
+
) {}
|
|
664
591
|
}
|
|
665
592
|
|
|
666
|
-
export type Literal
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
;
|
|
593
|
+
export type Literal =
|
|
594
|
+
| Record
|
|
595
|
+
| List
|
|
596
|
+
| StringLiteral
|
|
597
|
+
| NumberLiteral
|
|
598
|
+
| BooleanLiteral;
|
|
673
599
|
|
|
674
600
|
export class List {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
601
|
+
type = "list";
|
|
602
|
+
constructor(
|
|
603
|
+
public members: Expression[],
|
|
604
|
+
public location: Location,
|
|
605
|
+
) {}
|
|
681
606
|
}
|
|
682
607
|
|
|
683
608
|
export class Record {
|
|
609
|
+
type = "record";
|
|
684
610
|
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
public location: Location) { }
|
|
690
|
-
|
|
611
|
+
constructor(
|
|
612
|
+
public properties: Property[],
|
|
613
|
+
public location: Location,
|
|
614
|
+
) {}
|
|
691
615
|
}
|
|
692
616
|
|
|
693
617
|
export class Property {
|
|
618
|
+
type = "property";
|
|
694
619
|
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
public location: Location) { }
|
|
701
|
-
|
|
620
|
+
constructor(
|
|
621
|
+
public key: UnqualifiedIdentifier | StringLiteral,
|
|
622
|
+
public value: Expression,
|
|
623
|
+
public location: Location,
|
|
624
|
+
) {}
|
|
702
625
|
}
|
|
703
626
|
|
|
704
627
|
export class StringLiteral {
|
|
628
|
+
type = "string";
|
|
705
629
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
public location: Location) { }
|
|
711
|
-
|
|
630
|
+
constructor(
|
|
631
|
+
public value: string,
|
|
632
|
+
public location: Location,
|
|
633
|
+
) {}
|
|
712
634
|
}
|
|
713
635
|
|
|
714
636
|
export class NumberLiteral {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
637
|
+
type = "number-literal";
|
|
638
|
+
constructor(
|
|
639
|
+
public value: string,
|
|
640
|
+
public location: Location,
|
|
641
|
+
) {}
|
|
719
642
|
}
|
|
720
643
|
|
|
721
644
|
export class BooleanLiteral {
|
|
645
|
+
type = "boolean-literal";
|
|
722
646
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
647
|
+
constructor(
|
|
648
|
+
public value: boolean,
|
|
649
|
+
public location: Location,
|
|
650
|
+
) {}
|
|
727
651
|
}
|
|
728
652
|
|
|
729
653
|
export class ContextProperty {
|
|
654
|
+
type = "context-property";
|
|
730
655
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
public location: Location) { }
|
|
736
|
-
|
|
656
|
+
constructor(
|
|
657
|
+
public member: UnqualifiedIdentifier | StringLiteral,
|
|
658
|
+
public location: Location,
|
|
659
|
+
) {}
|
|
737
660
|
}
|
|
738
661
|
|
|
739
662
|
export class ContextVariable {
|
|
663
|
+
type = "context-variable";
|
|
740
664
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
constructor(public location: Location) { }
|
|
744
|
-
|
|
665
|
+
constructor(public location: Location) {}
|
|
745
666
|
}
|
|
746
667
|
|
|
747
|
-
export type Constructor
|
|
748
|
-
= UnqualifiedConstructor
|
|
749
|
-
| QualifiedConstructor
|
|
750
|
-
;
|
|
668
|
+
export type Constructor = UnqualifiedConstructor | QualifiedConstructor;
|
|
751
669
|
|
|
752
670
|
export class UnqualifiedConstructor {
|
|
671
|
+
type = "unqualified-constructor";
|
|
753
672
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
public location: Location) { }
|
|
759
|
-
|
|
673
|
+
constructor(
|
|
674
|
+
public value: string,
|
|
675
|
+
public location: Location,
|
|
676
|
+
) {}
|
|
760
677
|
}
|
|
761
678
|
|
|
762
679
|
export class QualifiedConstructor {
|
|
680
|
+
type = "qualified-constructor";
|
|
763
681
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
public location: Location) { }
|
|
770
|
-
|
|
682
|
+
constructor(
|
|
683
|
+
public qualifier: string,
|
|
684
|
+
public member: string,
|
|
685
|
+
public location: Location,
|
|
686
|
+
) {}
|
|
771
687
|
}
|
|
772
688
|
|
|
773
689
|
/**
|
|
774
690
|
* Identifier
|
|
775
691
|
*/
|
|
776
|
-
export type Identifier
|
|
777
|
-
= UnqualifiedIdentifier
|
|
778
|
-
| QualifiedIdentifier
|
|
779
|
-
;
|
|
692
|
+
export type Identifier = UnqualifiedIdentifier | QualifiedIdentifier;
|
|
780
693
|
|
|
781
694
|
export class UnqualifiedIdentifier {
|
|
695
|
+
type = "unqualified-identifier";
|
|
782
696
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
697
|
+
constructor(
|
|
698
|
+
public value: string,
|
|
699
|
+
public location: Location,
|
|
700
|
+
) {}
|
|
787
701
|
}
|
|
788
702
|
|
|
789
703
|
/**
|
|
790
704
|
* QualifiedIdentifier
|
|
791
705
|
*/
|
|
792
706
|
export class QualifiedIdentifier {
|
|
707
|
+
type = "qualified-identifier";
|
|
793
708
|
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
public location: Location) { }
|
|
800
|
-
|
|
709
|
+
constructor(
|
|
710
|
+
public qualifier: string,
|
|
711
|
+
public member: string,
|
|
712
|
+
public location: Location,
|
|
713
|
+
) {}
|
|
801
714
|
}
|