@quenk/wml 2.14.0 → 2.15.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/compile/codegen.d.ts +9 -0
- package/lib/compile/codegen.js +47 -6
- package/lib/compile/codegen.js.map +1 -1
- package/lib/compile/codegen.ts +57 -4
- package/lib/index.d.ts +1 -1
- package/lib/index.js.map +1 -1
- package/lib/index.ts +1 -1
- package/lib/parse/ast.d.ts +20 -6
- package/lib/parse/ast.js +25 -8
- package/lib/parse/ast.js.map +1 -1
- package/lib/parse/ast.ts +27 -6
- package/lib/parse/generated.js +2914 -2403
- package/lib/parse/test.js +29 -56
- package/lib/parse/test.js.map +1 -1
- package/lib/parse/test.ts +29 -68
- package/lib/parse/wml.y +59 -19
- package/lib/view/frame.d.ts +49 -13
- package/lib/view/frame.js +10 -47
- package/lib/view/frame.js.map +1 -1
- package/lib/view/frame.ts +100 -47
- package/lib/view/index.d.ts +9 -8
- package/lib/view/index.js +6 -5
- package/lib/view/index.js.map +1 -1
- package/lib/view/index.ts +13 -10
- package/package.json +6 -2
package/lib/parse/test.js
CHANGED
|
@@ -112,39 +112,12 @@ exports.tests = {
|
|
|
112
112
|
{% endif %}
|
|
113
113
|
</Tag>`,
|
|
114
114
|
},
|
|
115
|
-
"should parse short fun statements": {
|
|
116
|
-
input: "{% fun vue () = <View/> %}",
|
|
117
|
-
},
|
|
118
|
-
"should parse short fun statements with arguments": {
|
|
119
|
-
input: "{% fun vue (a:String, b:String, c:String) = " +
|
|
120
|
-
"<View a={{a}} b={{b}} c={{c}}/> %}",
|
|
121
|
-
},
|
|
122
|
-
"should parse short fun statements with type parameters": {
|
|
123
|
-
input: "{% fun vue [A,B:C,C] (a:A, b:B) = " + "{{ (a + b) + c }} %}",
|
|
124
|
-
},
|
|
125
|
-
"should parse extended fun statements": {
|
|
126
|
-
input: "{% fun vue () %} <View/> {% endfun %}",
|
|
127
|
-
},
|
|
128
|
-
"should parse extended fun statements with arguments": {
|
|
129
|
-
input: "{% fun vue (a:String, b:String, c:String) %}" +
|
|
130
|
-
"<View a={{a}} b={{b}} c={{c}}/> {% endfun %}",
|
|
131
|
-
},
|
|
132
|
-
"should parse extended fun statements with type parameters": {
|
|
133
|
-
input: "{% fun vue [A,B:C,C] (a:A, b:B) %} {{ ((a + b) + c) }} {% endfun %}",
|
|
134
|
-
},
|
|
135
115
|
"should parse binary expressions": {
|
|
136
116
|
input: "<p>{{(Styles.A + Styles.B)}}</p>",
|
|
137
117
|
},
|
|
138
118
|
"should parse complicated expressions": {
|
|
139
119
|
input: '<div class={{((Styles.A + " ") + Style.B)}}/>',
|
|
140
120
|
},
|
|
141
|
-
"should allow for statement as child of fun": {
|
|
142
|
-
input: "{% fun sven () %} {% for a in b %} {{b}} {% endfor %} {% endfun %}",
|
|
143
|
-
},
|
|
144
|
-
"should allow if statement as child of fun": {
|
|
145
|
-
input: "{% fun ate (o:Object) %} {% if a %} {{a}} {% else %} {{a}} " +
|
|
146
|
-
"{% endif %} {% endfun %}",
|
|
147
|
-
},
|
|
148
121
|
"should allow for booleans in interpolations": {
|
|
149
122
|
input: "<bool active={{true}}>{{if fun() then false else true}}</bool>",
|
|
150
123
|
},
|
|
@@ -192,33 +165,9 @@ exports.tests = {
|
|
|
192
165
|
"should allow fun application with context": {
|
|
193
166
|
input: "<div>{{ <panel(@,12)> }}</div>",
|
|
194
167
|
},
|
|
195
|
-
"should parse list types": {
|
|
196
|
-
input: "{% fun action [A] (s: String[], a:A[]) = {{ '${s}${a}' }} %}",
|
|
197
|
-
},
|
|
198
168
|
"should allow context properties as fun application": {
|
|
199
169
|
input: "<div>{{ <@action()> }}</div>",
|
|
200
170
|
},
|
|
201
|
-
"should allow view statements after short fun": {
|
|
202
|
-
input: `
|
|
203
|
-
|
|
204
|
-
{% fun template [A] (d: Date[A], o:A, _:String, __:A[]) = {{String(o)}} %}
|
|
205
|
-
|
|
206
|
-
{% view Results [A](Date[A]) %}
|
|
207
|
-
|
|
208
|
-
<ul>
|
|
209
|
-
|
|
210
|
-
{% for option,index in [1,3,4] %}
|
|
211
|
-
|
|
212
|
-
<li>{{option}}and{{index}}</li>
|
|
213
|
-
|
|
214
|
-
{% else %}
|
|
215
|
-
|
|
216
|
-
<p>De nada!</p>
|
|
217
|
-
|
|
218
|
-
{% endfor %}
|
|
219
|
-
|
|
220
|
-
</ul>`,
|
|
221
|
-
},
|
|
222
171
|
"should allow actual code": {
|
|
223
172
|
input: `
|
|
224
173
|
{% import (Table) from "@quenk/wml-widgets/lib/data/table" %}
|
|
@@ -272,9 +221,6 @@ exports.tests = {
|
|
|
272
221
|
|
|
273
222
|
</Panel>`,
|
|
274
223
|
},
|
|
275
|
-
"should recognize type parameters": {
|
|
276
|
-
input: "{% fun test[A:String] (a:A) %} {{a}} {% endfun %}",
|
|
277
|
-
},
|
|
278
224
|
"should allow ifs without elses": {
|
|
279
225
|
input: "{% view Test (Object) %}" +
|
|
280
226
|
"<div> {% if (value == true) %} <span/> {% endif %} </div>",
|
|
@@ -455,8 +401,6 @@ exports.tests = {
|
|
|
455
401
|
"[comment] should parse html comments": `<!-- This is an html comment. -->`,
|
|
456
402
|
"[comment] should parse wml comments": `{# This is a wml comment #}`,
|
|
457
403
|
"[comment] should parse wml comments in statements": `{% view Name {# This is a comment! #} (Object) %} <div/> %}`,
|
|
458
|
-
"[fun] should parse multi dimensional array parameters": `
|
|
459
|
-
{% fun test (value:List[][]) %}<p/>{% endfun %}`,
|
|
460
404
|
"should allow index access on context properties": `{% view Test (Object) %}
|
|
461
405
|
<div>
|
|
462
406
|
{% if @["type"] == 1 %}
|
|
@@ -496,5 +440,34 @@ exports.tests = {
|
|
|
496
440
|
m-20,10 h 10
|
|
497
441
|
m-20,10 h 10" />
|
|
498
442
|
</svg>`,
|
|
443
|
+
"should support part statements": `
|
|
444
|
+
{% part myPart0 (Ctx) %}
|
|
445
|
+
{% let name:String = "Me" %}
|
|
446
|
+
<h1>{{@name}}</h1>
|
|
447
|
+
{% endpart %}
|
|
448
|
+
|
|
449
|
+
{% part myPart1 (Ctx) %}<h1>{{@name}}</h1>{% endpart %}
|
|
450
|
+
|
|
451
|
+
{% part myPart2 (Ctx from "..") %}<h1>{{@name}}</h1>{% endpart %}
|
|
452
|
+
|
|
453
|
+
{% part myPart3 where name: String %}<h1>{{@name}}</h1>{% endpart %}
|
|
454
|
+
|
|
455
|
+
{% part myPart4 where name: String %}
|
|
456
|
+
{% let name:String = "Me" %}
|
|
457
|
+
<h1>{{@name}}</h1>
|
|
458
|
+
{% endpart %}
|
|
459
|
+
`,
|
|
460
|
+
"should support use statments": `
|
|
461
|
+
<div>
|
|
462
|
+
{% use part myPart %}
|
|
463
|
+
{% use view MyView %}
|
|
464
|
+
{% use part path.to.part %}
|
|
465
|
+
{% use view path.to.View %}
|
|
466
|
+
{% use part @path.to.part %}
|
|
467
|
+
{% use view @path.to.View %}
|
|
468
|
+
{% use view SomeView(@) %}
|
|
469
|
+
{% use part path.to.part({}) %}
|
|
470
|
+
</div>
|
|
471
|
+
`,
|
|
499
472
|
};
|
|
500
473
|
//# sourceMappingURL=test.js.map
|
package/lib/parse/test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;;AAAa,QAAA,KAAK,GAA2B;IAC3C,+BAA+B,EAAE;QAC/B,KAAK,EAAE,2CAA2C;KACnD;IACD,2BAA2B,EAAE;QAC3B,KAAK,EAAE,qCAAqC;KAC7C;IACD,uCAAuC,EAAE;QACvC,KAAK,EAAE,qDAAqD;KAC7D;IACD,iCAAiC,EAAE;QACjC,KAAK,EAAE,WAAW;KACnB;IACD,mDAAmD,EAAE;QACnD,KAAK,EAAE,6DAA6D;KACrE;IACD,mDAAmD,EAAE;QACnD,KAAK,EAAE,4BAA4B;KACpC;IACD,mDAAmD,EAAE;QACnD,KAAK,EAAE,8CAA8C;KACtD;IACD,2BAA2B,EAAE;QAC3B,KAAK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;;;;;;;;;;;;;;;;;;;;;;;;YA+DC;KACT;IAED,4CAA4C,EAAE;QAC5C,KAAK,EAAE;;;;;;;;;;WAUA;KACR;IAED,kCAAkC,EAAE;QAClC,KAAK,EAAE;;;;;;;;;;;qEAW0D;KAClE;IAED,gEAAgE,EAAE,kDAAkD;IAEpH,8BAA8B,EAAE,qEAAqE;IAErG,yBAAyB,EAAE,6CAA6C;IAExE,6BAA6B,EAAE,8CAA8C;IAE7E,gDAAgD,EAC9C,0CAA0C;IAE5C,qCAAqC,EAAE;;;;;;;;;;;;;eAa1B;IAEb,sBAAsB,EAAE;;;;;;OAMnB;IAEL,+BAA+B,EAAE,+EAA+E;IAEhH,sCAAsC,EAAE,mFAAmF;IAE3H,mCAAmC,EAAE;;KAElC;IAEH,kCAAkC,EAAE;;;;KAIjC;IAEH,sCAAsC,EAAE,mCAAmC;IAE3E,qCAAqC,EAAE,6BAA6B;IAEpE,mDAAmD,EAAE,6DAA6D;IAElH,iDAAiD,EAAE;;;;;aAKxC;IAEX,oCAAoC,EAAE;;;;;WAK7B;IAET,uCAAuC,EAAE,8DAA8D;IAEvG,yDAAyD,EAAE,qDAAqD;IAEhH,gDAAgD,EAAE,wEAAwE;IAE1H,0CAA0C,EAAE;;;;;WAKnC;IAET,oDAAoD,EAAE,iCAAiC;IAEvF,8DAA8D,EAAE;;;;;;;;;;;;;;;;WAgBvD;IACT,gCAAgC,EAAE;;;;;;;;;;;;;;;;KAgB/B;IACH,8BAA8B,EAAE;;;;;;;;;;;GAW/B;CACF,CAAC"}
|
package/lib/parse/test.ts
CHANGED
|
@@ -121,35 +121,6 @@ export const tests: { [key: string]: any } = {
|
|
|
121
121
|
</Tag>`,
|
|
122
122
|
},
|
|
123
123
|
|
|
124
|
-
"should parse short fun statements": {
|
|
125
|
-
input: "{% fun vue () = <View/> %}",
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
"should parse short fun statements with arguments": {
|
|
129
|
-
input:
|
|
130
|
-
"{% fun vue (a:String, b:String, c:String) = " +
|
|
131
|
-
"<View a={{a}} b={{b}} c={{c}}/> %}",
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
"should parse short fun statements with type parameters": {
|
|
135
|
-
input: "{% fun vue [A,B:C,C] (a:A, b:B) = " + "{{ (a + b) + c }} %}",
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
"should parse extended fun statements": {
|
|
139
|
-
input: "{% fun vue () %} <View/> {% endfun %}",
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
"should parse extended fun statements with arguments": {
|
|
143
|
-
input:
|
|
144
|
-
"{% fun vue (a:String, b:String, c:String) %}" +
|
|
145
|
-
"<View a={{a}} b={{b}} c={{c}}/> {% endfun %}",
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
"should parse extended fun statements with type parameters": {
|
|
149
|
-
input:
|
|
150
|
-
"{% fun vue [A,B:C,C] (a:A, b:B) %} {{ ((a + b) + c) }} {% endfun %}",
|
|
151
|
-
},
|
|
152
|
-
|
|
153
124
|
"should parse binary expressions": {
|
|
154
125
|
input: "<p>{{(Styles.A + Styles.B)}}</p>",
|
|
155
126
|
},
|
|
@@ -158,14 +129,6 @@ export const tests: { [key: string]: any } = {
|
|
|
158
129
|
input: '<div class={{((Styles.A + " ") + Style.B)}}/>',
|
|
159
130
|
},
|
|
160
131
|
|
|
161
|
-
"should allow for statement as child of fun": {
|
|
162
|
-
input: "{% fun sven () %} {% for a in b %} {{b}} {% endfor %} {% endfun %}",
|
|
163
|
-
},
|
|
164
|
-
"should allow if statement as child of fun": {
|
|
165
|
-
input:
|
|
166
|
-
"{% fun ate (o:Object) %} {% if a %} {{a}} {% else %} {{a}} " +
|
|
167
|
-
"{% endif %} {% endfun %}",
|
|
168
|
-
},
|
|
169
132
|
"should allow for booleans in interpolations": {
|
|
170
133
|
input: "<bool active={{true}}>{{if fun() then false else true}}</bool>",
|
|
171
134
|
},
|
|
@@ -215,33 +178,9 @@ export const tests: { [key: string]: any } = {
|
|
|
215
178
|
"should allow fun application with context": {
|
|
216
179
|
input: "<div>{{ <panel(@,12)> }}</div>",
|
|
217
180
|
},
|
|
218
|
-
"should parse list types": {
|
|
219
|
-
input: "{% fun action [A] (s: String[], a:A[]) = {{ '${s}${a}' }} %}",
|
|
220
|
-
},
|
|
221
181
|
"should allow context properties as fun application": {
|
|
222
182
|
input: "<div>{{ <@action()> }}</div>",
|
|
223
183
|
},
|
|
224
|
-
"should allow view statements after short fun": {
|
|
225
|
-
input: `
|
|
226
|
-
|
|
227
|
-
{% fun template [A] (d: Date[A], o:A, _:String, __:A[]) = {{String(o)}} %}
|
|
228
|
-
|
|
229
|
-
{% view Results [A](Date[A]) %}
|
|
230
|
-
|
|
231
|
-
<ul>
|
|
232
|
-
|
|
233
|
-
{% for option,index in [1,3,4] %}
|
|
234
|
-
|
|
235
|
-
<li>{{option}}and{{index}}</li>
|
|
236
|
-
|
|
237
|
-
{% else %}
|
|
238
|
-
|
|
239
|
-
<p>De nada!</p>
|
|
240
|
-
|
|
241
|
-
{% endfor %}
|
|
242
|
-
|
|
243
|
-
</ul>`,
|
|
244
|
-
},
|
|
245
184
|
"should allow actual code": {
|
|
246
185
|
input: `
|
|
247
186
|
{% import (Table) from "@quenk/wml-widgets/lib/data/table" %}
|
|
@@ -296,10 +235,6 @@ export const tests: { [key: string]: any } = {
|
|
|
296
235
|
</Panel>`,
|
|
297
236
|
},
|
|
298
237
|
|
|
299
|
-
"should recognize type parameters": {
|
|
300
|
-
input: "{% fun test[A:String] (a:A) %} {{a}} {% endfun %}",
|
|
301
|
-
},
|
|
302
|
-
|
|
303
238
|
"should allow ifs without elses": {
|
|
304
239
|
input:
|
|
305
240
|
"{% view Test (Object) %}" +
|
|
@@ -533,9 +468,6 @@ export const tests: { [key: string]: any } = {
|
|
|
533
468
|
|
|
534
469
|
"[comment] should parse wml comments in statements": `{% view Name {# This is a comment! #} (Object) %} <div/> %}`,
|
|
535
470
|
|
|
536
|
-
"[fun] should parse multi dimensional array parameters": `
|
|
537
|
-
{% fun test (value:List[][]) %}<p/>{% endfun %}`,
|
|
538
|
-
|
|
539
471
|
"should allow index access on context properties": `{% view Test (Object) %}
|
|
540
472
|
<div>
|
|
541
473
|
{% if @["type"] == 1 %}
|
|
@@ -582,4 +514,33 @@ export const tests: { [key: string]: any } = {
|
|
|
582
514
|
m-20,10 h 10
|
|
583
515
|
m-20,10 h 10" />
|
|
584
516
|
</svg>`,
|
|
517
|
+
"should support part statements": `
|
|
518
|
+
{% part myPart0 (Ctx) %}
|
|
519
|
+
{% let name:String = "Me" %}
|
|
520
|
+
<h1>{{@name}}</h1>
|
|
521
|
+
{% endpart %}
|
|
522
|
+
|
|
523
|
+
{% part myPart1 (Ctx) %}<h1>{{@name}}</h1>{% endpart %}
|
|
524
|
+
|
|
525
|
+
{% part myPart2 (Ctx from "..") %}<h1>{{@name}}</h1>{% endpart %}
|
|
526
|
+
|
|
527
|
+
{% part myPart3 where name: String %}<h1>{{@name}}</h1>{% endpart %}
|
|
528
|
+
|
|
529
|
+
{% part myPart4 where name: String %}
|
|
530
|
+
{% let name:String = "Me" %}
|
|
531
|
+
<h1>{{@name}}</h1>
|
|
532
|
+
{% endpart %}
|
|
533
|
+
`,
|
|
534
|
+
"should support use statments": `
|
|
535
|
+
<div>
|
|
536
|
+
{% use part myPart %}
|
|
537
|
+
{% use view MyView %}
|
|
538
|
+
{% use part path.to.part %}
|
|
539
|
+
{% use view path.to.View %}
|
|
540
|
+
{% use part @path.to.part %}
|
|
541
|
+
{% use view @path.to.View %}
|
|
542
|
+
{% use view SomeView(@) %}
|
|
543
|
+
{% use part path.to.part({}) %}
|
|
544
|
+
</div>
|
|
545
|
+
`,
|
|
585
546
|
};
|
package/lib/parse/wml.y
CHANGED
|
@@ -77,8 +77,9 @@ Text ({DoubleStringCharacter}*)|({SingleStringCharacter}*)
|
|
|
77
77
|
<CONTROL>'import' return 'IMPORT';
|
|
78
78
|
<CONTROL>'from' return 'FROM';
|
|
79
79
|
<CONTROL>'as' return 'AS';
|
|
80
|
-
<CONTROL>'
|
|
81
|
-
<CONTROL>'
|
|
80
|
+
<CONTROL>'part' return 'PART';
|
|
81
|
+
<CONTROL>'endpart' return 'ENDPART';
|
|
82
|
+
<CONTROL>'use' return 'USE';
|
|
82
83
|
<CONTROL>'for' return 'FOR';
|
|
83
84
|
<CONTROL>'endfor' return 'ENDFOR';
|
|
84
85
|
<CONTROL>'if' return 'IF';
|
|
@@ -101,6 +102,7 @@ Text ({DoubleStringCharacter}*)|({SingleStringCharacter}*)
|
|
|
101
102
|
<CONTROL>'where' return 'WHERE';
|
|
102
103
|
<CONTROL>'let' return 'LET';
|
|
103
104
|
<CONTROL>'to' return 'TO';
|
|
105
|
+
<CONTROL>'with' return 'WITH';
|
|
104
106
|
<CONTROL>{Constructor} return 'CONSTRUCTOR';
|
|
105
107
|
<CONTROL>{Identifier} return 'IDENTIFIER';
|
|
106
108
|
<CONTROL>'@' return '@';
|
|
@@ -249,7 +251,7 @@ export
|
|
|
249
251
|
|
|
250
252
|
| view_statement
|
|
251
253
|
|
|
252
|
-
|
|
|
254
|
+
| part_statment
|
|
253
255
|
|
|
254
256
|
| element
|
|
255
257
|
{$$ = $1; }
|
|
@@ -398,24 +400,53 @@ view_directives
|
|
|
398
400
|
{ $$ = $1.concat($2); }
|
|
399
401
|
;
|
|
400
402
|
|
|
401
|
-
|
|
403
|
+
part_statment
|
|
404
|
+
: '{%' PART unqualified_identifier '(' view_statement_context ')' '%}'
|
|
405
|
+
view_directives children
|
|
406
|
+
'{%' ENDPART '%}'
|
|
407
|
+
{$$ = new yy.ast.PartStatement($3, $5, $8, $9, @$); }
|
|
402
408
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
'{%'
|
|
406
|
-
{$$ = new yy.ast.
|
|
409
|
+
| '{%' PART unqualified_identifier '(' view_statement_context ')' '%}'
|
|
410
|
+
children
|
|
411
|
+
'{%' ENDPART '%}'
|
|
412
|
+
{$$ = new yy.ast.PartStatement($3, $5, [], $8, @$); }
|
|
407
413
|
|
|
408
|
-
| '{%'
|
|
409
|
-
|
|
410
|
-
'{%'
|
|
411
|
-
{$$ = new yy.ast.
|
|
414
|
+
| '{%' PART unqualified_identifier '%}'
|
|
415
|
+
view_directives children
|
|
416
|
+
'{%' ENDPART '%}'
|
|
417
|
+
{$$ = new yy.ast.PartStatement($3, undefined, $5, $6, @$); }
|
|
418
|
+
|
|
419
|
+
| '{%' PART unqualified_identifier '%}'
|
|
420
|
+
children
|
|
421
|
+
'{%' ENDPART '%}'
|
|
422
|
+
{$$ = new yy.ast.PartStatement($3, undefined, [], $5, @$); }
|
|
412
423
|
|
|
413
|
-
| '{%'
|
|
414
|
-
|
|
415
|
-
{
|
|
424
|
+
| '{%' PART unqualified_identifier WHERE context_members '%}'
|
|
425
|
+
view_directives children
|
|
426
|
+
'{%' ENDPART '%}'
|
|
427
|
+
{$$ = new yy.ast.PartStatement($3, $5, $7, $8, @$); }
|
|
416
428
|
|
|
417
|
-
| '{%'
|
|
418
|
-
|
|
429
|
+
| '{%' PART unqualified_identifier WHERE context_members '%}'
|
|
430
|
+
children
|
|
431
|
+
'{%' ENDPART '%}'
|
|
432
|
+
{$$ = new yy.ast.PartStatement($3, $5, [], $7, @$); }
|
|
433
|
+
;
|
|
434
|
+
|
|
435
|
+
use_statement
|
|
436
|
+
: '{%' USE PART use_target WITH expression '%}'
|
|
437
|
+
{$$ = new yy.ast.UsePartStatement($4, $7, @$); }
|
|
438
|
+
|
|
439
|
+
| '{%' USE PART use_target '%}'
|
|
440
|
+
{$$ = new yy.ast.UsePartStatement($4, undefined, @$); }
|
|
441
|
+
|
|
442
|
+
| '{%' USE VIEW use_target '%}'
|
|
443
|
+
{$$ = new yy.ast.UseViewStatement($4, @$); }
|
|
444
|
+
;
|
|
445
|
+
|
|
446
|
+
use_target
|
|
447
|
+
: (construct_expression | call_expression | member_expression
|
|
448
|
+
| context_property | unqualified_constructor | unqualified_identifier
|
|
449
|
+
| context_variable)
|
|
419
450
|
;
|
|
420
451
|
|
|
421
452
|
type_parameters
|
|
@@ -689,7 +720,7 @@ filter
|
|
|
689
720
|
;
|
|
690
721
|
|
|
691
722
|
control
|
|
692
|
-
: (for_statement|if_statement)
|
|
723
|
+
: (for_statement|if_statement|use_statement)
|
|
693
724
|
{$$ = $1;}
|
|
694
725
|
;
|
|
695
726
|
|
|
@@ -966,7 +997,10 @@ member_expression_head:
|
|
|
966
997
|
;
|
|
967
998
|
|
|
968
999
|
member_expression_tail
|
|
969
|
-
:
|
|
1000
|
+
: unqualified_identifier
|
|
1001
|
+
| unqualified_constructor
|
|
1002
|
+
| string_literal
|
|
1003
|
+
| keyword
|
|
970
1004
|
;
|
|
971
1005
|
|
|
972
1006
|
function_expression
|
|
@@ -1088,3 +1122,9 @@ binary_operator
|
|
|
1088
1122
|
{ $$ = $1; }
|
|
1089
1123
|
;
|
|
1090
1124
|
|
|
1125
|
+
keyword
|
|
1126
|
+
: (IMPORT | FROM | AS | TYPE | CONTEXT | WHERE | LET | VIEW | PART |
|
|
1127
|
+
ENDPART | FOR | IN | OF | TO | ENDFOR | IF | ELSE | ENDIF | USE |
|
|
1128
|
+
TRUE | FALSE | INSTANCEOF | WITH)
|
|
1129
|
+
{$$ = new yy.ast.UnqualifiedIdentifier($1, @$)}
|
|
1130
|
+
;
|
package/lib/view/frame.d.ts
CHANGED
|
@@ -39,21 +39,18 @@ declare class SetList {
|
|
|
39
39
|
delete(idx: Index): void;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Frame serves as a container for the DOM elements a View's template
|
|
43
|
+
* renders.
|
|
43
44
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
45
|
+
* Each time the render() method is called a new Frame is created and passed
|
|
46
|
+
* to the rendering logic so that a DOM tree is built along with accesible
|
|
47
|
+
* wml ids and groups.
|
|
46
48
|
*/
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
indexes: Map<number, string>;
|
|
53
|
-
tree?: Content | undefined;
|
|
54
|
-
constructor(nodes?: SetList, widgets?: Map<number, Widget>, groups?: Map<WMLId, Index[]>, ids?: Map<string, number>, indexes?: Map<number, string>, tree?: Content | undefined);
|
|
55
|
-
_register(id: WMLId, node: Content, widget?: Widget): void;
|
|
56
|
-
_registerGroupMember(id: WMLId, node: Content, widget?: Widget): void;
|
|
49
|
+
export interface Frame {
|
|
50
|
+
/**
|
|
51
|
+
* tree when sets is the rendered DOM content of the view
|
|
52
|
+
*/
|
|
53
|
+
tree?: Content;
|
|
57
54
|
/**
|
|
58
55
|
* root sets the root element of a View's tree.
|
|
59
56
|
*/
|
|
@@ -75,6 +72,14 @@ export declare class ViewFrame {
|
|
|
75
72
|
* this one.
|
|
76
73
|
*/
|
|
77
74
|
view(view: View): Content;
|
|
75
|
+
/**
|
|
76
|
+
* register content and widget under the specified id.
|
|
77
|
+
*/
|
|
78
|
+
register(id: WMLId, node: Content, widget?: Widget): void;
|
|
79
|
+
/**
|
|
80
|
+
* registerGroupMember registers a content and widget as a member of a group.
|
|
81
|
+
*/
|
|
82
|
+
registerGroupMember(id: WMLId, node: Content, widget?: Widget): void;
|
|
78
83
|
/**
|
|
79
84
|
* findById returns the entry stored for the specified wml element.
|
|
80
85
|
*/
|
|
@@ -99,5 +104,36 @@ export declare class ViewFrame {
|
|
|
99
104
|
* replaceByGroup allows WMLElement replaced by using a group identifier.
|
|
100
105
|
*/
|
|
101
106
|
replaceByGroup(next: ViewFrame, id: WMLId): void;
|
|
107
|
+
/**
|
|
108
|
+
* destroy the frame.
|
|
109
|
+
*
|
|
110
|
+
* Currently a no-op but may be used in the future.
|
|
111
|
+
*/
|
|
112
|
+
destroy(): void;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* ViewFrame contains helper methods for retreiving elements by id or
|
|
116
|
+
* group freeing the View class of such logic.
|
|
117
|
+
*/
|
|
118
|
+
export declare class ViewFrame implements Frame {
|
|
119
|
+
nodes: SetList;
|
|
120
|
+
widgets: Map<number, Widget>;
|
|
121
|
+
groups: Map<WMLId, Index[]>;
|
|
122
|
+
ids: Map<string, number>;
|
|
123
|
+
indexes: Map<number, string>;
|
|
124
|
+
tree?: Content | undefined;
|
|
125
|
+
constructor(nodes?: SetList, widgets?: Map<number, Widget>, groups?: Map<WMLId, Index[]>, ids?: Map<string, number>, indexes?: Map<number, string>, tree?: Content | undefined);
|
|
126
|
+
register(id: WMLId, node: Content, widget?: Widget): void;
|
|
127
|
+
registerGroupMember(id: WMLId, node: Content, widget?: Widget): void;
|
|
128
|
+
root(el: Content): void;
|
|
129
|
+
node(tag: string, attrs: Attrs, children: Content[]): Content;
|
|
130
|
+
widget(w: Widget, attrs: Attrs): Content;
|
|
131
|
+
view(view: View): Content;
|
|
132
|
+
findById(id: WMLId): Maybe<Entry>;
|
|
133
|
+
findByGroup(id: WMLId): Entry[];
|
|
134
|
+
replaceByIndex(next: ViewFrame, idx: Index): void;
|
|
135
|
+
replaceById(next: ViewFrame, id: WMLId): void;
|
|
136
|
+
replaceByGroup(next: ViewFrame, id: WMLId): void;
|
|
137
|
+
destroy(): void;
|
|
102
138
|
}
|
|
103
139
|
export {};
|
package/lib/view/frame.js
CHANGED
|
@@ -48,9 +48,7 @@ class SetList {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* ViewFrame
|
|
52
|
-
*
|
|
53
|
-
* This class containers helper methods for retreiving elements by id or
|
|
51
|
+
* ViewFrame contains helper methods for retreiving elements by id or
|
|
54
52
|
* group freeing the View class of such logic.
|
|
55
53
|
*/
|
|
56
54
|
class ViewFrame {
|
|
@@ -62,7 +60,7 @@ class ViewFrame {
|
|
|
62
60
|
this.indexes = indexes;
|
|
63
61
|
this.tree = tree;
|
|
64
62
|
}
|
|
65
|
-
|
|
63
|
+
register(id, node, widget) {
|
|
66
64
|
let idx = this.nodes.add(node);
|
|
67
65
|
this.ids.set(id, idx);
|
|
68
66
|
this.indexes.set(idx, id);
|
|
@@ -70,7 +68,7 @@ class ViewFrame {
|
|
|
70
68
|
this.widgets.set(idx, widget);
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
|
-
|
|
71
|
+
registerGroupMember(id, node, widget) {
|
|
74
72
|
let group = this.groups.get(id) ?? [];
|
|
75
73
|
let idx = this.nodes.add(node);
|
|
76
74
|
group.push(idx);
|
|
@@ -78,52 +76,32 @@ class ViewFrame {
|
|
|
78
76
|
this.widgets.set(idx, widget);
|
|
79
77
|
this.groups.set(id, group);
|
|
80
78
|
}
|
|
81
|
-
/**
|
|
82
|
-
* root sets the root element of a View's tree.
|
|
83
|
-
*/
|
|
84
79
|
root(el) {
|
|
85
80
|
this.tree = el;
|
|
86
81
|
}
|
|
87
|
-
/**
|
|
88
|
-
* node constructs a DOM node to be used in the View's tree.
|
|
89
|
-
*
|
|
90
|
-
* Any id or group assignment will be honored.
|
|
91
|
-
*/
|
|
92
82
|
node(tag, attrs, children) {
|
|
93
83
|
let elm = dom.createElement(tag, attrs, children, (attrs.wml && attrs.wml.ns) || "");
|
|
94
84
|
if (attrs?.wml?.id)
|
|
95
|
-
this.
|
|
85
|
+
this.register(attrs.wml.id, elm);
|
|
96
86
|
if (attrs?.wml?.group)
|
|
97
|
-
this.
|
|
87
|
+
this.registerGroupMember(attrs.wml.group, elm);
|
|
98
88
|
return elm;
|
|
99
89
|
}
|
|
100
|
-
/**
|
|
101
|
-
* widget constructs a DOM sub-tree for a Widget in the View's tree.
|
|
102
|
-
*
|
|
103
|
-
* Any id or group assignment will be honored.
|
|
104
|
-
*/
|
|
105
90
|
widget(w, attrs) {
|
|
106
91
|
let tree = w.render();
|
|
107
92
|
monitor_1.DOMMonitor.getInstance().monitor(tree, w);
|
|
108
93
|
if (attrs?.wml?.id)
|
|
109
|
-
this.
|
|
94
|
+
this.register(attrs.wml.id, tree, w);
|
|
110
95
|
if (attrs?.wml?.group)
|
|
111
|
-
this.
|
|
96
|
+
this.registerGroupMember(attrs.wml.group, tree, w);
|
|
112
97
|
return tree;
|
|
113
98
|
}
|
|
114
|
-
/**
|
|
115
|
-
* view renders the content of another view, saving its ids and groups to
|
|
116
|
-
* this one.
|
|
117
|
-
*/
|
|
118
99
|
view(view) {
|
|
119
100
|
let { root } = this;
|
|
120
101
|
let tree = view.render(this);
|
|
121
102
|
this.root = root;
|
|
122
103
|
return tree;
|
|
123
104
|
}
|
|
124
|
-
/**
|
|
125
|
-
* findById returns the entry stored for the specified wml element.
|
|
126
|
-
*/
|
|
127
105
|
findById(id) {
|
|
128
106
|
let idx = this.ids.get(id) ?? -1;
|
|
129
107
|
let node = this.nodes.get(idx);
|
|
@@ -134,9 +112,6 @@ class ViewFrame {
|
|
|
134
112
|
widget: this.widgets.get(idx),
|
|
135
113
|
});
|
|
136
114
|
}
|
|
137
|
-
/**
|
|
138
|
-
* findByGroup returns all the entries stored fro a group.
|
|
139
|
-
*/
|
|
140
115
|
findByGroup(id) {
|
|
141
116
|
let result = [];
|
|
142
117
|
for (let idx of this.groups.get(id) ?? []) {
|
|
@@ -148,18 +123,10 @@ class ViewFrame {
|
|
|
148
123
|
}
|
|
149
124
|
return result;
|
|
150
125
|
}
|
|
151
|
-
/**
|
|
152
|
-
* replaceByIndex performs the heavy work of replacing a WMLElement
|
|
153
|
-
* with the corresponding index from another ViewFrame.
|
|
154
|
-
*
|
|
155
|
-
* The replaced element will have its DOM content redrawn if a parentNode
|
|
156
|
-
* is detected.
|
|
157
|
-
*/
|
|
158
126
|
replaceByIndex(next, idx) {
|
|
159
127
|
let originalNode = this.nodes.get(idx);
|
|
160
|
-
let id = this.indexes.get(idx) ?? "";
|
|
161
128
|
if (idx == null || originalNode == null) {
|
|
162
|
-
console.warn(`Not replacing missing
|
|
129
|
+
console.warn(`Not replacing missing element by index ${idx}!`);
|
|
163
130
|
return;
|
|
164
131
|
}
|
|
165
132
|
let { parentNode } = originalNode;
|
|
@@ -169,6 +136,7 @@ class ViewFrame {
|
|
|
169
136
|
// Remove references since the node no longer exists.
|
|
170
137
|
this.nodes.delete(idx);
|
|
171
138
|
this.widgets.delete(idx);
|
|
139
|
+
let id = this.indexes.get(idx) ?? "";
|
|
172
140
|
this.ids.delete(id);
|
|
173
141
|
this.indexes.delete(idx);
|
|
174
142
|
if (parentNode)
|
|
@@ -182,15 +150,9 @@ class ViewFrame {
|
|
|
182
150
|
if (parentNode)
|
|
183
151
|
parentNode.replaceChild(node, originalNode);
|
|
184
152
|
}
|
|
185
|
-
/**
|
|
186
|
-
* replaceById allows WMLElement replacement by using an id.
|
|
187
|
-
*/
|
|
188
153
|
replaceById(next, id) {
|
|
189
154
|
this.replaceByIndex(next, this.ids.get(id) ?? -1);
|
|
190
155
|
}
|
|
191
|
-
/**
|
|
192
|
-
* replaceByGroup allows WMLElement replaced by using a group identifier.
|
|
193
|
-
*/
|
|
194
156
|
replaceByGroup(next, id) {
|
|
195
157
|
let group = this.groups.get(id) ?? [];
|
|
196
158
|
let newGroup = [];
|
|
@@ -201,6 +163,7 @@ class ViewFrame {
|
|
|
201
163
|
}
|
|
202
164
|
this.groups.set(id, newGroup);
|
|
203
165
|
}
|
|
166
|
+
destroy() { }
|
|
204
167
|
}
|
|
205
168
|
exports.ViewFrame = ViewFrame;
|
|
206
169
|
//# sourceMappingURL=frame.js.map
|
package/lib/view/frame.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame.js","sourceRoot":"","sources":["frame.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAE9B,sDAAmD;AAEnD,4CAA4C;AAmB5C;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO;IACX,YACS,QAAmB,EAAE,EACrB,QAA6B,IAAI,GAAG,EAAE;QADtC,UAAK,GAAL,KAAK,CAAgB;QACrB,UAAK,GAAL,KAAK,CAAiC;IAC5C,CAAC;IAEJ,GAAG,CAAC,IAAa;QACf,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IA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