@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/compile/codegen.d.ts +9 -0
- package/lib/compile/codegen.js +50 -4
- package/lib/compile/codegen.js.map +1 -1
- package/lib/compile/codegen.ts +60 -3
- package/lib/parse/ast.d.ts +27 -7
- package/lib/parse/ast.js +33 -8
- package/lib/parse/ast.js.map +1 -1
- package/lib/parse/ast.ts +37 -7
- package/lib/parse/generated.js +9894 -9506
- package/lib/parse/test.js +36 -56
- package/lib/parse/test.js.map +1 -1
- package/lib/parse/test.ts +36 -68
- package/lib/parse/wml.y +82 -26
- package/lib/view/frame.d.ts +43 -31
- package/lib/view/frame.js +10 -55
- package/lib/view/frame.js.map +1 -1
- package/lib/view/frame.ts +69 -62
- package/lib/view/index.d.ts +7 -6
- package/lib/view/index.js +3 -2
- package/lib/view/index.js.map +1 -1
- package/lib/view/index.ts +9 -7
- package/package.json +6 -2
package/lib/parse/ast.ts
CHANGED
|
@@ -110,7 +110,7 @@ export type Export =
|
|
|
110
110
|
| AliasStatement
|
|
111
111
|
| ContextStatement
|
|
112
112
|
| LetStatement
|
|
113
|
-
|
|
|
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
|
|
207
|
-
type = "
|
|
206
|
+
export class PartStatement {
|
|
207
|
+
type = "part-statement";
|
|
208
208
|
|
|
209
209
|
constructor(
|
|
210
210
|
public id: UnqualifiedIdentifier,
|
|
211
|
-
public
|
|
212
|
-
public
|
|
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
|
|