@quenk/wml 2.13.11 → 2.14.1

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 +161 -367
  7. package/lib/compile/codegen.js.map +1 -1
  8. package/lib/compile/codegen.ts +643 -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 +1 -1
  14. package/lib/compile/transform.js +9 -11
  15. package/lib/compile/transform.js.map +1 -1
  16. package/lib/compile/transform.ts +136 -143
  17. package/lib/{dom.d.ts → dom/index.d.ts} +8 -2
  18. package/lib/{dom.js → dom/index.js} +84 -70
  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 +2 -2
  33. package/lib/parse/ast.js +52 -53
  34. package/lib/parse/ast.js.map +1 -1
  35. package/lib/parse/ast.ts +396 -483
  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 +127 -0
  51. package/lib/view/frame.js +214 -0
  52. package/lib/view/frame.js.map +1 -0
  53. package/lib/view/frame.ts +295 -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 +98 -0
  58. package/package.json +3 -3
  59. package/lib/dom.js.map +0 -1
  60. 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
- [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,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
- 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
- ;
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
- type = 'for-in-statement';
451
-
452
- constructor(
453
- public variables: Parameter[],
454
- public expression: Expression,
455
- public body: Child[],
456
- public otherwise: Child[],
457
- public location: Location) { super(body, otherwise, location)}
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
- type = 'for-of-statement';
464
-
465
- constructor(
466
- public variables: Parameter[],
467
- public expression: Expression,
468
- public body: Child[],
469
- public otherwise: Child[],
470
- public location: Location) { super(body, otherwise, location)}
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
- type = 'for-from-statement';
477
-
478
- constructor(
479
- public variable: UntypedParameter,
480
- public start: Expression,
481
- public end: Expression,
482
- public body: Child[],
483
- public otherwise: Child[],
484
- public location: Location) { super(body, otherwise, location)}
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
- type = 'if-statement';
491
-
492
- constructor(
493
- public condition: Expression,
494
- public then: Child[],
495
- public elseClause: ElseIfClause | ElseClause | undefined,
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
- type = 'else-clause';
503
-
504
- constructor(
505
- public children: Child[],
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
- type = 'else-if-clause';
513
-
514
- constructor(
515
- public condition: Expression,
516
- public then: Child[],
517
- public elseClause: ElseClause | ElseIfClause | undefined,
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
- type = 'characters';
525
-
526
- constructor(
527
- public value: string,
528
- public location: Location) { }
529
-
530
- }
531
-
532
- export type Expression
533
- = IfThenExpression
534
- | BinaryExpression
535
- | UnaryExpression
536
- | ViewConstruction
537
- | FunApplication
538
- | ConstructExpression
539
- | CallExpression
540
- | MemberExpression
541
- | ReadExpression
542
- | FunctionExpression
543
- | Literal
544
- | ContextProperty
545
- | Constructor
546
- | Identifier
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
- type = 'if-then-expression';
553
-
554
- constructor(
555
- public condition: Expression,
556
- public iftrue: Expression,
557
- public iffalse: Expression,
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
- type = 'binary-expression';
565
-
566
- constructor(
567
- public left: Expression,
568
- public operator: string,
569
- public right: Expression|Type,
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
- type = 'unary-expression';
577
-
578
- constructor(
579
- public operator: string,
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
- type = 'view-construction';
587
-
588
- constructor(
589
- public expression: Expression,
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
- type = 'fun-application';
597
-
598
- constructor(
599
- public target: Expression,
600
- public typeArgs: Type[],
601
- public args: Expression[],
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
- type = 'construct-expression';
609
-
610
- constructor(
611
- public cons: Constructor,
612
- public typeArgs: Type[],
613
- public args: Expression[],
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
- type = 'call-expression';
621
-
622
- constructor(
623
- public target: Expression,
624
- public typeArgs: Type[],
625
- public args: Expression[],
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
- constructor(
636
- public head: Expression,
637
- public tail: UnqualifiedIdentifier | UnqualifiedConstructor | StringLiteral,
638
- public location: Location) { }
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
- type = 'read-expression';
645
-
646
- constructor(
647
- public target: Expression,
648
- public path: Expression,
649
- public hint: Type,
650
- public defaults: Expression,
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
- type = 'function-expression';
658
-
659
- constructor(
660
- public parameters: Parameter[],
661
- public body: Expression,
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
- = Record
668
- | List
669
- | StringLiteral
670
- | NumberLiteral
671
- | BooleanLiteral
672
- ;
593
+ export type Literal =
594
+ | Record
595
+ | List
596
+ | StringLiteral
597
+ | NumberLiteral
598
+ | BooleanLiteral;
673
599
 
674
600
  export class List {
675
-
676
- type = 'list';
677
- constructor(
678
- public members: Expression[],
679
- public location: Location) { }
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
- type = 'record';
686
-
687
- constructor(
688
- public properties: Property[],
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
- type = 'property';
696
-
697
- constructor(
698
- public key: UnqualifiedIdentifier | StringLiteral,
699
- public value: Expression,
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
- type = 'string';
707
-
708
- constructor(
709
- public value: string,
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
- type = 'number-literal';
717
- constructor(public value: string, public location: Location) { }
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
- type = 'boolean-literal';
724
-
725
- constructor(public value: boolean, public location: Location) { }
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
- type = 'context-property';
732
-
733
- constructor(
734
- public member: UnqualifiedIdentifier | StringLiteral,
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
- type = 'context-variable';
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
- type = 'unqualified-constructor';
755
-
756
- constructor(
757
- public value: string,
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
- type = 'qualified-constructor';
765
-
766
- constructor(
767
- public qualifier: string,
768
- public member: string,
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
- type = 'unqualified-identifier';
784
-
785
- constructor(public value: string, public location: Location) { }
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
- type = 'qualified-identifier';
795
-
796
- constructor(
797
- public qualifier: string,
798
- public member: string,
799
- public location: Location) { }
800
-
709
+ constructor(
710
+ public qualifier: string,
711
+ public member: string,
712
+ public location: Location,
713
+ ) {}
801
714
  }