@quenk/wml 2.14.1 → 2.15.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.
package/lib/parse/ast.ts CHANGED
@@ -110,7 +110,7 @@ export type Export =
110
110
  | AliasStatement
111
111
  | ContextStatement
112
112
  | LetStatement
113
- | FunStatement
113
+ | PartStatement
114
114
  | ViewStatement
115
115
  | Tag;
116
116
 
@@ -203,13 +203,13 @@ export class ViewStatement {
203
203
  ) {}
204
204
  }
205
205
 
206
- export class FunStatement {
207
- type = "fun-statement";
206
+ export class PartStatement {
207
+ type = "part-statement";
208
208
 
209
209
  constructor(
210
210
  public id: UnqualifiedIdentifier,
211
- public typeParameters: TypeParameter[],
212
- public parameters: Parameter[],
211
+ public context: ContextTypeIndicator | undefined,
212
+ public directives: LetStatement[],
213
213
  public body: Child[],
214
214
  public location: Location,
215
215
  ) {}
@@ -231,7 +231,7 @@ export class TypeParameter {
231
231
  /**
232
232
  * Type
233
233
  */
234
- export type Type = ConstructorType | FunctionType | RecordType | ListType;
234
+ export type Type = ConstructorType | FunctionType | RecordType | ListType | OptionalType;
235
235
 
236
236
  /**
237
237
  * ConstructorType
@@ -295,6 +295,15 @@ export class TupleType {
295
295
  ) {}
296
296
  }
297
297
 
298
+ export class OptionalType {
299
+ type = "optional-type";
300
+
301
+ constructor(
302
+ public target: Type,
303
+ public location: Location,
304
+ ) {}
305
+ }
306
+
298
307
  /**
299
308
  * Parameter
300
309
  */
@@ -372,7 +381,7 @@ export class Interpolation {
372
381
  ) {}
373
382
  }
374
383
 
375
- export type Control = ForStatement | IfStatement;
384
+ export type Control = ForStatement | IfStatement | UseStatement;
376
385
 
377
386
  export abstract class ForStatement {
378
387
  abstract type: string;
@@ -458,6 +467,27 @@ export class ElseIfClause {
458
467
  ) {}
459
468
  }
460
469
 
470
+ export type UseStatement = UsePartStatement | UseViewStatement;
471
+
472
+ export class UsePartStatement {
473
+ type = "use-part-statement";
474
+
475
+ constructor(
476
+ public target: Expression,
477
+ public context: Expression | undefined,
478
+ public location: Location,
479
+ ) {}
480
+ }
481
+
482
+ export class UseViewStatement {
483
+ type = "use-view-statement";
484
+
485
+ constructor(
486
+ public target: Expression,
487
+ public location: Location,
488
+ ) {}
489
+ }
490
+
461
491
  export class Characters {
462
492
  type = "characters";
463
493