Commit 90fd388
authored
Flesh out more text support for GC types in components (#1813)
This commit builds on the work of #1764 to support the text format for
GC types in components more than before. This notably bring support for:
* `(sub ...)` types in components and module types
* `(rec ...)` groups in components and module types
* types can refer to themselves like with core wasm
The main consequence of this work is that unlike most other `$foo`
identifiers in the component model the identifiers found in types will
not automatically inject outer aliases to refer to outer types. For
example this will not parse:
(component $C
(type $t (struct))
(component
(type (array (ref $t)))
)
)
The reason for this is that automatic injection of an outer alias
requires that types are resolved and then their names are registered.
The resolution process queues up aliases to inject which are accounted
for during registration when indices are assigned. Here though because
types can refer to themselves (or future types in `rec` groups) the
registration process has to happen first before resolution. This means
that if resolution were to inject more type indices then that would mess
up the indexes already assigned.
This is hopefully relatively minor in terms of how often this'll bite
someone. For now various changes have been made to the name resolution
pass of components to handle this and some tests have been added too for
both positive and negative situations.1 parent 3e54745 commit 90fd388
17 files changed
Lines changed: 438 additions & 175 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 62 | + | |
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
| |||
232 | 228 | | |
233 | 229 | | |
234 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
235 | 242 | | |
236 | 243 | | |
237 | 244 | | |
| |||
555 | 562 | | |
556 | 563 | | |
557 | 564 | | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | 565 | | |
619 | 566 | | |
620 | 567 | | |
| |||
807 | 754 | | |
808 | 755 | | |
809 | 756 | | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
810 | 760 | | |
811 | 761 | | |
812 | 762 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
| 456 | + | |
455 | 457 | | |
456 | 458 | | |
457 | 459 | | |
| |||
497 | 499 | | |
498 | 500 | | |
499 | 501 | | |
500 | | - | |
501 | | - | |
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| |||
0 commit comments