@quenk/wml 2.11.4 → 2.13.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.js +24 -29
- package/lib/cli.js.map +1 -1
- package/lib/cli.ts +20 -13
- package/lib/compile/codegen.d.ts +1 -13
- package/lib/compile/codegen.js +550 -656
- package/lib/compile/codegen.js.map +1 -1
- package/lib/compile/codegen.ts +43 -44
- package/lib/compile/index.js +6 -11
- package/lib/compile/index.js.map +1 -1
- package/lib/compile/transform.js +14 -23
- package/lib/compile/transform.js.map +1 -1
- package/lib/dom.js +118 -167
- package/lib/dom.js.map +1 -1
- package/lib/index.js +7 -10
- package/lib/index.js.map +1 -1
- package/lib/main.js +31 -56
- package/lib/main.js.map +1 -1
- package/lib/parse/ast.d.ts +8 -12
- package/lib/parse/ast.js +167 -227
- package/lib/parse/ast.js.map +1 -1
- package/lib/parse/ast.ts +4 -14
- package/lib/parse/generated.js +2335 -2288
- package/lib/parse/index.js +7 -10
- package/lib/parse/index.js.map +1 -1
- package/lib/parse/test.js +285 -55
- package/lib/parse/test.js.map +1 -1
- package/lib/parse/test.ts +23 -2
- package/lib/parse/wml.y +58 -59
- package/lib/tsconfig.json +1 -1
- package/package.json +1 -2
package/lib/parse/wml.y
CHANGED
|
@@ -459,7 +459,7 @@ non_function_type
|
|
|
459
459
|
|
|
460
460
|
| record_type
|
|
461
461
|
{ $$ = $1; }
|
|
462
|
-
|
|
462
|
+
|
|
463
463
|
| list_type
|
|
464
464
|
{ $$ = $1; }
|
|
465
465
|
|
|
@@ -468,10 +468,16 @@ non_function_type
|
|
|
468
468
|
;
|
|
469
469
|
|
|
470
470
|
constructor_type
|
|
471
|
-
:
|
|
471
|
+
: unqualified_constructor
|
|
472
|
+
{ $$ = new yy.ast.ConstructorType($1, [], @$); }
|
|
473
|
+
|
|
474
|
+
| unqualified_constructor type_parameters
|
|
475
|
+
{ $$ = new yy.ast.ConstructorType($1, $2, @$); }
|
|
476
|
+
|
|
477
|
+
| qualified_constructor
|
|
472
478
|
{ $$ = new yy.ast.ConstructorType($1, [], @$); }
|
|
473
479
|
|
|
474
|
-
|
|
|
480
|
+
| qualified_constructor type_parameters
|
|
475
481
|
{ $$ = new yy.ast.ConstructorType($1, $2, @$); }
|
|
476
482
|
;
|
|
477
483
|
|
|
@@ -485,11 +491,11 @@ record_type
|
|
|
485
491
|
;
|
|
486
492
|
|
|
487
493
|
list_type
|
|
488
|
-
:
|
|
494
|
+
: unqualified_constructor '[' ']'
|
|
489
495
|
{ $$ = new yy.ast.ListType(
|
|
490
496
|
new yy.ast.ConstructorType($1, []), @$); }
|
|
491
497
|
|
|
492
|
-
|
|
|
498
|
+
| unqualified_constructor type_parameters '[' ']'
|
|
493
499
|
{ $$ = new yy.ast.ListType(
|
|
494
500
|
new yy.ast.ConstructorType($1, $2), @$); }
|
|
495
501
|
|
|
@@ -613,17 +619,21 @@ node
|
|
|
613
619
|
;
|
|
614
620
|
|
|
615
621
|
widget
|
|
616
|
-
: '<'
|
|
617
|
-
{$$ = new yy.ast.Widget($2, $3, $5||[], $7, @$);}
|
|
622
|
+
: '<' widget_constructor attributes '>' children? '</' cons '>'
|
|
623
|
+
{$$ = new yy.ast.Widget($2[0], $2[1], $3, $5||[], $7, @$);}
|
|
618
624
|
|
|
619
|
-
| '<'
|
|
620
|
-
{$$ = new yy.ast.Widget($2, [], $4||[], $6, @$);}
|
|
625
|
+
| '<' widget_constructor '>' children? '</' cons '>'
|
|
626
|
+
{$$ = new yy.ast.Widget($2[0], $2[1], [], $4||[], $6, @$);}
|
|
621
627
|
|
|
622
|
-
| '<'
|
|
623
|
-
{ $$ = new yy.ast.Widget($2, $3, [], $2, @$); }
|
|
628
|
+
| '<' widget_constructor attributes '/>'
|
|
629
|
+
{ $$ = new yy.ast.Widget($2[0], $2[1], $3, [], $2, @$); }
|
|
630
|
+
|
|
631
|
+
| '<' widget_constructor '/>'
|
|
632
|
+
{ $$ = new yy.ast.Widget($2[0], $2[1], [], [], $2, @$); }
|
|
633
|
+
;
|
|
624
634
|
|
|
625
|
-
|
|
626
|
-
|
|
635
|
+
widget_constructor
|
|
636
|
+
: cons type_arguments? {$$ = [$1, $2 || []]; }
|
|
627
637
|
;
|
|
628
638
|
|
|
629
639
|
attributes
|
|
@@ -778,9 +788,6 @@ expression
|
|
|
778
788
|
| unary_expression
|
|
779
789
|
{ $$ = $1; }
|
|
780
790
|
|
|
781
|
-
| type_assertion
|
|
782
|
-
{ $$ = $1; }
|
|
783
|
-
|
|
784
791
|
| simple_expression
|
|
785
792
|
{ $$ = $1; }
|
|
786
793
|
|
|
@@ -824,11 +831,6 @@ unary_expression
|
|
|
824
831
|
{$$ = new yy.ast.UnaryExpression($4, $2, @$); }
|
|
825
832
|
;
|
|
826
833
|
|
|
827
|
-
type_assertion
|
|
828
|
-
: '[' '*' type ']' expression
|
|
829
|
-
{$$ = new yy.ast.TypeAssertion($3, $5, @$); }
|
|
830
|
-
;
|
|
831
|
-
|
|
832
834
|
simple_expression
|
|
833
835
|
: (
|
|
834
836
|
construct_expression
|
|
@@ -837,8 +839,8 @@ simple_expression
|
|
|
837
839
|
|member_expression
|
|
838
840
|
|literal
|
|
839
841
|
|context_property
|
|
840
|
-
|
|
|
841
|
-
|
|
|
842
|
+
|unqualified_constructor
|
|
843
|
+
|unqualified_identifier
|
|
842
844
|
|context_variable)
|
|
843
845
|
{ $$ = $1; }
|
|
844
846
|
;
|
|
@@ -865,24 +867,30 @@ type_arg_list
|
|
|
865
867
|
;
|
|
866
868
|
|
|
867
869
|
construct_expression
|
|
868
|
-
:
|
|
869
|
-
{ $$ = new yy.ast.ConstructExpression($1, $
|
|
870
|
+
: unqualified_constructor type_arguments '(' arguments ')'
|
|
871
|
+
{ $$ = new yy.ast.ConstructExpression($1, $2, $4, @$); }
|
|
870
872
|
|
|
871
|
-
|
|
|
872
|
-
{ $$ = new yy.ast.ConstructExpression($1, [], @$); }
|
|
873
|
+
| unqualified_constructor '(' arguments ')'
|
|
874
|
+
{ $$ = new yy.ast.ConstructExpression($1, [], $3, @$); }
|
|
875
|
+
|
|
876
|
+
| unqualified_constructor type_arguments '(' ')'
|
|
877
|
+
{ $$ = new yy.ast.ConstructExpression($1, $2, [], @$); }
|
|
878
|
+
|
|
879
|
+
| unqualified_constructor '(' ')'
|
|
880
|
+
{ $$ = new yy.ast.ConstructExpression($1, [], [], @$); }
|
|
873
881
|
;
|
|
874
882
|
|
|
875
883
|
call_expression
|
|
876
|
-
:
|
|
884
|
+
: unqualified_identifier type_arguments '(' arguments ')'
|
|
877
885
|
{$$ = new yy.ast.CallExpression($1, $2, $4, @$); }
|
|
878
886
|
|
|
879
|
-
|
|
|
887
|
+
| unqualified_identifier type_arguments '(' ')'
|
|
880
888
|
{$$ = new yy.ast.CallExpression($1, $2, [], @$); }
|
|
881
889
|
|
|
882
|
-
|
|
|
890
|
+
| unqualified_identifier '(' arguments ')'
|
|
883
891
|
{$$ = new yy.ast.CallExpression($1, [], $3, @$); }
|
|
884
892
|
|
|
885
|
-
|
|
|
893
|
+
| unqualified_identifier '(' ')'
|
|
886
894
|
{$$ = new yy.ast.CallExpression($1, [], [], @$); }
|
|
887
895
|
|
|
888
896
|
| context_property type_arguments '(' arguments ')'
|
|
@@ -929,43 +937,34 @@ call_expression
|
|
|
929
937
|
;
|
|
930
938
|
|
|
931
939
|
member_expression
|
|
932
|
-
|
|
933
|
-
: qualified_identifier '.' unqualified_identifier
|
|
934
|
-
{$$ = new yy.ast.MemberExpression($1, $3, @$); }
|
|
935
|
-
|
|
936
|
-
| qualified_constructor '.' unqualified_identifier
|
|
937
|
-
{$$ = new yy.ast.MemberExpression($1, $3, @$); }
|
|
938
|
-
|
|
939
|
-
| context_variable '.' unqualified_identifier
|
|
940
|
-
{$$ = new yy.ast.MemberExpression($1, $3, @$); }
|
|
941
|
-
|
|
942
|
-
| context_property '.' unqualified_identifier
|
|
943
|
-
{$$ = new yy.ast.MemberExpression($1, $3, @$); }
|
|
944
|
-
|
|
945
|
-
| list '.' unqualified_identifier
|
|
946
|
-
{$$ = new yy.ast.MemberExpression($1, $3, @$); }
|
|
947
|
-
|
|
948
|
-
| record '.' unqualified_identifier
|
|
940
|
+
: member_expression_head '.' member_expression_tail
|
|
949
941
|
{$$ = new yy.ast.MemberExpression($1, $3, @$); }
|
|
950
942
|
|
|
951
|
-
|
|
|
943
|
+
| member_expression '.' member_expression_tail
|
|
952
944
|
{$$ = new yy.ast.MemberExpression($1, $3, @$); }
|
|
953
945
|
|
|
954
|
-
|
|
|
946
|
+
| member_expression '[' string_literal ']'
|
|
955
947
|
{$$ = new yy.ast.MemberExpression($1, $3, @$); }
|
|
948
|
+
;
|
|
956
949
|
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
950
|
+
member_expression_head:
|
|
951
|
+
( unqualified_identifier
|
|
952
|
+
| unqualified_constructor
|
|
953
|
+
| context_variable
|
|
954
|
+
| context_property
|
|
955
|
+
| list
|
|
956
|
+
| record
|
|
957
|
+
| string_literal
|
|
958
|
+
| call_expression
|
|
959
|
+
|'(' expression ')'
|
|
960
|
+
)
|
|
961
|
+
;
|
|
962
962
|
|
|
963
|
-
|
|
964
|
-
|
|
963
|
+
member_expression_tail
|
|
964
|
+
: (unqualified_identifier| unqualified_constructor|string_literal)
|
|
965
965
|
;
|
|
966
966
|
|
|
967
967
|
function_expression
|
|
968
|
-
|
|
969
968
|
: parameters '->' expression
|
|
970
969
|
{$$ = new yy.ast.FunctionExpression($1, $3, @$); }
|
|
971
970
|
|
|
@@ -1079,7 +1078,7 @@ unqualified_identifier
|
|
|
1079
1078
|
;
|
|
1080
1079
|
|
|
1081
1080
|
binary_operator
|
|
1082
|
-
: ('>'|'>='|'<'|'<='|'=='|'!='|'+'|'/'|'-'|'='|'&&'|'||'|'^'|INSTANCEOF)
|
|
1081
|
+
: ('>'|'>='|'<'|'<='|'=='|'!='|'+'|'/'|'-'|'='|'&&'|'||'|'^'|INSTANCEOF|AS)
|
|
1083
1082
|
{ $$ = $1; }
|
|
1084
1083
|
;
|
|
1085
1084
|
|
package/lib/tsconfig.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenk/wml",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "(WML) is a DSL for describing user interfaces in web applications.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"jison-gho": "^0.6.1-216",
|
|
24
24
|
"mocha": "^9.0.0",
|
|
25
25
|
"ts-node": "^10.5.0",
|
|
26
|
-
"typedoc": "^0.20.36",
|
|
27
26
|
"typescript": "^4.3.2"
|
|
28
27
|
},
|
|
29
28
|
"dependencies": {
|