@quenk/wml 2.13.10 → 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.
Files changed (60) hide show
  1. package/lib/cli.d.ts +8 -8
  2. package/lib/cli.js +1 -3
  3. package/lib/cli.js.map +1 -1
  4. package/lib/cli.ts +48 -60
  5. package/lib/compile/codegen.d.ts +4 -9
  6. package/lib/compile/codegen.js +164 -369
  7. package/lib/compile/codegen.js.map +1 -1
  8. package/lib/compile/codegen.ts +644 -952
  9. package/lib/compile/index.d.ts +2 -2
  10. package/lib/compile/index.js +4 -4
  11. package/lib/compile/index.js.map +1 -1
  12. package/lib/compile/index.ts +14 -17
  13. package/lib/compile/transform.d.ts +8 -6
  14. package/lib/compile/transform.js +46 -18
  15. package/lib/compile/transform.js.map +1 -1
  16. package/lib/compile/transform.ts +139 -116
  17. package/lib/{dom.d.ts → dom/index.d.ts} +8 -2
  18. package/lib/{dom.js → dom/index.js} +84 -66
  19. package/lib/dom/index.js.map +1 -0
  20. package/lib/dom/index.ts +425 -0
  21. package/lib/dom/monitor.d.ts +33 -0
  22. package/lib/dom/monitor.js +60 -0
  23. package/lib/dom/monitor.js.map +1 -0
  24. package/lib/dom/monitor.ts +75 -0
  25. package/lib/index.d.ts +10 -95
  26. package/lib/index.js +10 -10
  27. package/lib/index.js.map +1 -1
  28. package/lib/index.ts +57 -182
  29. package/lib/main.js +17 -17
  30. package/lib/main.js.map +1 -1
  31. package/lib/main.ts +38 -44
  32. package/lib/parse/ast.d.ts +12 -6
  33. package/lib/parse/ast.js +68 -58
  34. package/lib/parse/ast.js.map +1 -1
  35. package/lib/parse/ast.ts +400 -482
  36. package/lib/parse/generated.d.ts +3 -5
  37. package/lib/parse/generated.js +9504 -9264
  38. package/lib/parse/index.d.ts +2 -3
  39. package/lib/parse/index.js.map +1 -1
  40. package/lib/parse/index.ts +7 -9
  41. package/lib/parse/test.js +194 -192
  42. package/lib/parse/test.js.map +1 -1
  43. package/lib/parse/test.ts +294 -404
  44. package/lib/parse/wml.y +4 -0
  45. package/lib/tsconfig.json +19 -20
  46. package/lib/util.d.ts +10 -0
  47. package/lib/util.js +21 -0
  48. package/lib/util.js.map +1 -0
  49. package/lib/util.ts +39 -0
  50. package/lib/view/frame.d.ts +103 -0
  51. package/lib/view/frame.js +206 -0
  52. package/lib/view/frame.js.map +1 -0
  53. package/lib/view/frame.ts +249 -0
  54. package/lib/view/index.d.ts +58 -0
  55. package/lib/view/index.js +48 -0
  56. package/lib/view/index.js.map +1 -0
  57. package/lib/view/index.ts +97 -0
  58. package/package.json +4 -3
  59. package/lib/dom.js.map +0 -1
  60. package/lib/dom.ts +0 -475
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
- [key: string]: string | number
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
- type: string
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
- type = 'module'
35
-
36
- constructor(
37
- public imports: ImportStatement[],
38
- public exports: Export[],
39
- public location: Location) { }
40
-
41
- /**
42
- * clone this node.
43
- */
44
- clone() {
45
-
46
- return new Module(this.imports.slice(), this.exports.slice(),
47
- this.location);
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
- type = 'import-statement';
59
-
60
- constructor(
61
- public member: ImportMember,
62
- public module: StringLiteral,
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
- type = 'aliased-member';
84
-
85
- constructor(
86
- public member: Member,
87
- public alias: Member,
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
- type = 'qualified-member';
98
-
99
- constructor(public id: Member, public location: Location) { }
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
- type = 'composite-member';
110
-
111
- constructor(
112
- public members: (Member | AliasedMember)[],
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
- = AliasStatement
124
- | ContextStatement
125
- | LetStatement
126
- | FunStatement
127
- | ViewStatement
128
- | Tag
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
- type = 'alias-statement';
137
-
138
- constructor(
139
- public id: UnqualifiedConstructor,
140
- public typeParameters: TypeParameter[],
141
- public members: Type[],
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,648 +134,581 @@ export type ContextStatementMember = ConstructorType | MemberDeclaration;
149
134
  * ContextStatement
150
135
  */
151
136
  export class ContextStatement {
137
+ type = "context-statement";
152
138
 
153
- type = 'context-statement';
154
-
155
- constructor(
156
- public id: UnqualifiedConstructor,
157
- public typeParameters: TypeParameter[],
158
- public members: ContextStatementMember[],
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
- type = 'member-declaration';
169
-
170
- constructor(
171
- public path: UnqualifiedIdentifier[],
172
- public kind: Type,
173
- public optional: boolean,
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
- type = 'let-statement';
184
-
185
- constructor(
186
- public id: UnqualifiedIdentifier,
187
- public cons: ConstructorType,
188
- public expression: Expression,
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
- type = 'context-from-statement';
204
-
205
- constructor(
206
- public cons: ConstructorType,
207
- public module: StringLiteral,
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
- type = 'view-statement';
218
-
219
- constructor(
220
- public id: UnqualifiedConstructor,
221
- public typeParameters: TypeParameter[],
222
- public context: ContextTypeIndicator,
223
- public directives: LetStatement[],
224
- public root: Tag,
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
- type = 'fun-statement';
232
-
233
- constructor(
234
- public id: UnqualifiedIdentifier,
235
- public typeParameters: TypeParameter[],
236
- public parameters: Parameter[],
237
- public body: Child[],
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
- type = 'type-parameter';
248
-
249
- constructor(
250
- public id: UnqualifiedConstructor,
251
- public constraint: Type,
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
- type = 'constructor-type';
272
-
273
- constructor(
274
- public id: UnqualifiedIdentifier | Constructor,
275
- public typeParameters: TypeParameter[],
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
- type = 'function-type';
286
-
287
- constructor(
288
- public parameters: Type[],
289
- public returnType: Type,
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
- type = 'record-type';
300
-
301
- constructor(
302
- public members: MemberDeclaration[],
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
- type = 'list-type';
313
-
314
- constructor(
315
- public elementType: Type,
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
- type = 'tuple-type';
326
-
327
- constructor(
328
- public members: Type[],
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
- type = 'typed-parameter';
348
-
349
- constructor(
350
- public id: UnqualifiedIdentifier,
351
- public hint: Type,
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
- type = 'untyped-parameter';
359
-
360
- constructor(
361
- public id: UnqualifiedIdentifier,
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
- type = 'node';
382
-
383
- constructor(
384
- public open: Identifier,
385
- public attributes: Attribute[],
386
- public children: Child[],
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
- type = 'widget';
394
-
395
- constructor(
396
- public open: Constructor,
397
- public typeArgs: Type[],
398
- public attributes: Attribute[],
399
- public children: Child[],
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
- type = 'attribute';
407
-
408
- constructor(
409
- public namespace: UnqualifiedIdentifier,
410
- public name: UnqualifiedIdentifier,
411
- public value: AttributeValue,
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
- type = 'interpolation';
424
-
425
- constructor(
426
- public expression: Expression,
427
- public filters: Expression[],
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
- ;
436
-
437
- export type ForStatement
438
- = ForInStatement
439
- | ForOfStatement
440
- | ForFromStatement
441
- ;
442
-
443
- export class ForInStatement {
375
+ export type Control = ForStatement | IfStatement;
444
376
 
445
- type = 'for-in-statement';
446
-
447
- constructor(
448
- public variables: Parameter[],
449
- public expression: Expression,
450
- public body: Child[],
451
- public otherwise: Child[],
452
- public location: Location) { }
377
+ export abstract class ForStatement {
378
+ abstract type: string;
453
379
 
380
+ constructor(
381
+ public body: Child[],
382
+ public otherwise: Child[],
383
+ public location: Location,
384
+ ) {}
454
385
  }
455
386
 
456
- export class ForOfStatement {
457
-
458
- type = 'for-of-statement';
459
-
460
- constructor(
461
- public variables: Parameter[],
462
- public expression: Expression,
463
- public body: Child[],
464
- public otherwise: Child[],
465
- public location: Location) { }
387
+ export class ForInStatement extends ForStatement {
388
+ type = "for-in-statement";
466
389
 
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
+ }
467
399
  }
468
400
 
469
- export class ForFromStatement {
401
+ export class ForOfStatement extends ForStatement {
402
+ type = "for-of-statement";
470
403
 
471
- type = 'for-from-statement';
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
+ }
413
+ }
472
414
 
473
- constructor(
474
- public variable: UntypedParameter,
475
- public start: Expression,
476
- public end: Expression,
477
- public body: Child[],
478
- public otherwise: Child[],
479
- public location: Location) { }
415
+ export class ForFromStatement extends ForStatement {
416
+ type = "for-from-statement";
480
417
 
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
+ }
481
428
  }
482
429
 
483
430
  export class IfStatement {
431
+ type = "if-statement";
484
432
 
485
- type = 'if-statement';
486
-
487
- constructor(
488
- public condition: Expression,
489
- public then: Child[],
490
- public elseClause: ElseIfClause | ElseClause | undefined,
491
- public location: Location) { }
492
-
433
+ constructor(
434
+ public condition: Expression,
435
+ public then: Child[],
436
+ public elseClause: ElseIfClause | ElseClause | undefined,
437
+ public location: Location,
438
+ ) {}
493
439
  }
494
440
 
495
441
  export class ElseClause {
442
+ type = "else-clause";
496
443
 
497
- type = 'else-clause';
498
-
499
- constructor(
500
- public children: Child[],
501
- public location: Location) { }
502
-
444
+ constructor(
445
+ public children: Child[],
446
+ public location: Location,
447
+ ) {}
503
448
  }
504
449
 
505
450
  export class ElseIfClause {
451
+ type = "else-if-clause";
506
452
 
507
- type = 'else-if-clause';
508
-
509
- constructor(
510
- public condition: Expression,
511
- public then: Child[],
512
- public elseClause: ElseClause | ElseIfClause | undefined,
513
- public location: Location) { }
514
-
453
+ constructor(
454
+ public condition: Expression,
455
+ public then: Child[],
456
+ public elseClause: ElseClause | ElseIfClause | undefined,
457
+ public location: Location,
458
+ ) {}
515
459
  }
516
460
 
517
461
  export class Characters {
518
-
519
- type = 'characters';
520
-
521
- constructor(
522
- public value: string,
523
- public location: Location) { }
524
-
525
- }
526
-
527
- export type Expression
528
- = IfThenExpression
529
- | BinaryExpression
530
- | UnaryExpression
531
- | ViewConstruction
532
- | FunApplication
533
- | ConstructExpression
534
- | CallExpression
535
- | MemberExpression
536
- | ReadExpression
537
- | FunctionExpression
538
- | Literal
539
- | ContextProperty
540
- | Constructor
541
- | Identifier
542
- | ContextVariable
543
- ;
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;
544
486
 
545
487
  export class IfThenExpression {
488
+ type = "if-then-expression";
546
489
 
547
- type = 'if-then-expression';
548
-
549
- constructor(
550
- public condition: Expression,
551
- public iftrue: Expression,
552
- public iffalse: Expression,
553
- public location: Location) { }
554
-
490
+ constructor(
491
+ public condition: Expression,
492
+ public iftrue: Expression,
493
+ public iffalse: Expression,
494
+ public location: Location,
495
+ ) {}
555
496
  }
556
497
 
557
498
  export class BinaryExpression {
499
+ type = "binary-expression";
558
500
 
559
- type = 'binary-expression';
560
-
561
- constructor(
562
- public left: Expression,
563
- public operator: string,
564
- public right: Expression|Type,
565
- public location: Location) { }
566
-
501
+ constructor(
502
+ public left: Expression,
503
+ public operator: string,
504
+ public right: Expression | Type,
505
+ public location: Location,
506
+ ) {}
567
507
  }
568
508
 
569
509
  export class UnaryExpression {
510
+ type = "unary-expression";
570
511
 
571
- type = 'unary-expression';
572
-
573
- constructor(
574
- public operator: string,
575
- public expression: Expression) { }
576
-
512
+ constructor(
513
+ public operator: string,
514
+ public expression: Expression,
515
+ ) {}
577
516
  }
578
517
 
579
518
  export class ViewConstruction {
519
+ type = "view-construction";
580
520
 
581
- type = 'view-construction';
582
-
583
- constructor(
584
- public expression: Expression,
585
- public location: Location) { }
586
-
521
+ constructor(
522
+ public expression: Expression,
523
+ public location: Location,
524
+ ) {}
587
525
  }
588
526
 
589
527
  export class FunApplication {
528
+ type = "fun-application";
590
529
 
591
- type = 'fun-application';
592
-
593
- constructor(
594
- public target: Expression,
595
- public typeArgs: Type[],
596
- public args: Expression[],
597
- public location: Location) { }
598
-
530
+ constructor(
531
+ public target: Expression,
532
+ public typeArgs: Type[],
533
+ public args: Expression[],
534
+ public location: Location,
535
+ ) {}
599
536
  }
600
537
 
601
538
  export class ConstructExpression {
539
+ type = "construct-expression";
602
540
 
603
- type = 'construct-expression';
604
-
605
- constructor(
606
- public cons: Constructor,
607
- public typeArgs: Type[],
608
- public args: Expression[],
609
- public location: Location) { }
610
-
541
+ constructor(
542
+ public cons: Constructor,
543
+ public typeArgs: Type[],
544
+ public args: Expression[],
545
+ public location: Location,
546
+ ) {}
611
547
  }
612
548
 
613
549
  export class CallExpression {
550
+ type = "call-expression";
614
551
 
615
- type = 'call-expression';
616
-
617
- constructor(
618
- public target: Expression,
619
- public typeArgs: Type[],
620
- public args: Expression[],
621
- public location: Location) { }
622
-
552
+ constructor(
553
+ public target: Expression,
554
+ public typeArgs: Type[],
555
+ public args: Expression[],
556
+ public location: Location,
557
+ ) {}
623
558
  }
624
559
 
625
560
  /**
626
561
  * MemberExpression
627
562
  */
628
563
  export class MemberExpression {
629
-
630
- constructor(
631
- public head: Expression,
632
- public tail: UnqualifiedIdentifier | UnqualifiedConstructor | StringLiteral,
633
- public location: Location) { }
634
-
564
+ constructor(
565
+ public head: Expression,
566
+ public tail: UnqualifiedIdentifier | UnqualifiedConstructor | StringLiteral,
567
+ public location: Location,
568
+ ) {}
635
569
  }
636
570
 
637
571
  export class ReadExpression {
572
+ type = "read-expression";
638
573
 
639
- type = 'read-expression';
640
-
641
- constructor(
642
- public target: Expression,
643
- public path: Expression,
644
- public hint: Type,
645
- public defaults: Expression,
646
- public location: Location) { }
647
-
574
+ constructor(
575
+ public target: Expression,
576
+ public path: Expression,
577
+ public hint: Type,
578
+ public defaults: Expression,
579
+ public location: Location,
580
+ ) {}
648
581
  }
649
582
 
650
583
  export class FunctionExpression {
584
+ type = "function-expression";
651
585
 
652
- type = 'function-expression';
653
-
654
- constructor(
655
- public parameters: Parameter[],
656
- public body: Expression,
657
- public location: Location) { }
658
-
586
+ constructor(
587
+ public parameters: Parameter[],
588
+ public body: Expression,
589
+ public location: Location,
590
+ ) {}
659
591
  }
660
592
 
661
- export type Literal
662
- = Record
663
- | List
664
- | StringLiteral
665
- | NumberLiteral
666
- | BooleanLiteral
667
- ;
593
+ export type Literal =
594
+ | Record
595
+ | List
596
+ | StringLiteral
597
+ | NumberLiteral
598
+ | BooleanLiteral;
668
599
 
669
600
  export class List {
670
-
671
- type = 'list';
672
- constructor(
673
- public members: Expression[],
674
- public location: Location) { }
675
-
601
+ type = "list";
602
+ constructor(
603
+ public members: Expression[],
604
+ public location: Location,
605
+ ) {}
676
606
  }
677
607
 
678
608
  export class Record {
609
+ type = "record";
679
610
 
680
- type = 'record';
681
-
682
- constructor(
683
- public properties: Property[],
684
- public location: Location) { }
685
-
611
+ constructor(
612
+ public properties: Property[],
613
+ public location: Location,
614
+ ) {}
686
615
  }
687
616
 
688
617
  export class Property {
618
+ type = "property";
689
619
 
690
- type = 'property';
691
-
692
- constructor(
693
- public key: UnqualifiedIdentifier | StringLiteral,
694
- public value: Expression,
695
- public location: Location) { }
696
-
620
+ constructor(
621
+ public key: UnqualifiedIdentifier | StringLiteral,
622
+ public value: Expression,
623
+ public location: Location,
624
+ ) {}
697
625
  }
698
626
 
699
627
  export class StringLiteral {
628
+ type = "string";
700
629
 
701
- type = 'string';
702
-
703
- constructor(
704
- public value: string,
705
- public location: Location) { }
706
-
630
+ constructor(
631
+ public value: string,
632
+ public location: Location,
633
+ ) {}
707
634
  }
708
635
 
709
636
  export class NumberLiteral {
710
-
711
- type = 'number-literal';
712
- constructor(public value: string, public location: Location) { }
713
-
637
+ type = "number-literal";
638
+ constructor(
639
+ public value: string,
640
+ public location: Location,
641
+ ) {}
714
642
  }
715
643
 
716
644
  export class BooleanLiteral {
645
+ type = "boolean-literal";
717
646
 
718
- type = 'boolean-literal';
719
-
720
- constructor(public value: boolean, public location: Location) { }
721
-
647
+ constructor(
648
+ public value: boolean,
649
+ public location: Location,
650
+ ) {}
722
651
  }
723
652
 
724
653
  export class ContextProperty {
654
+ type = "context-property";
725
655
 
726
- type = 'context-property';
727
-
728
- constructor(
729
- public member: UnqualifiedIdentifier | StringLiteral,
730
- public location: Location) { }
731
-
656
+ constructor(
657
+ public member: UnqualifiedIdentifier | StringLiteral,
658
+ public location: Location,
659
+ ) {}
732
660
  }
733
661
 
734
662
  export class ContextVariable {
663
+ type = "context-variable";
735
664
 
736
- type = 'context-variable';
737
-
738
- constructor(public location: Location) { }
739
-
665
+ constructor(public location: Location) {}
740
666
  }
741
667
 
742
- export type Constructor
743
- = UnqualifiedConstructor
744
- | QualifiedConstructor
745
- ;
668
+ export type Constructor = UnqualifiedConstructor | QualifiedConstructor;
746
669
 
747
670
  export class UnqualifiedConstructor {
671
+ type = "unqualified-constructor";
748
672
 
749
- type = 'unqualified-constructor';
750
-
751
- constructor(
752
- public value: string,
753
- public location: Location) { }
754
-
673
+ constructor(
674
+ public value: string,
675
+ public location: Location,
676
+ ) {}
755
677
  }
756
678
 
757
679
  export class QualifiedConstructor {
680
+ type = "qualified-constructor";
758
681
 
759
- type = 'qualified-constructor';
760
-
761
- constructor(
762
- public qualifier: string,
763
- public member: string,
764
- public location: Location) { }
765
-
682
+ constructor(
683
+ public qualifier: string,
684
+ public member: string,
685
+ public location: Location,
686
+ ) {}
766
687
  }
767
688
 
768
689
  /**
769
690
  * Identifier
770
691
  */
771
- export type Identifier
772
- = UnqualifiedIdentifier
773
- | QualifiedIdentifier
774
- ;
692
+ export type Identifier = UnqualifiedIdentifier | QualifiedIdentifier;
775
693
 
776
694
  export class UnqualifiedIdentifier {
695
+ type = "unqualified-identifier";
777
696
 
778
- type = 'unqualified-identifier';
779
-
780
- constructor(public value: string, public location: Location) { }
781
-
697
+ constructor(
698
+ public value: string,
699
+ public location: Location,
700
+ ) {}
782
701
  }
783
702
 
784
703
  /**
785
704
  * QualifiedIdentifier
786
705
  */
787
706
  export class QualifiedIdentifier {
707
+ type = "qualified-identifier";
788
708
 
789
- type = 'qualified-identifier';
790
-
791
- constructor(
792
- public qualifier: string,
793
- public member: string,
794
- public location: Location) { }
795
-
709
+ constructor(
710
+ public qualifier: string,
711
+ public member: string,
712
+ public location: Location,
713
+ ) {}
796
714
  }