Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor interface type representation in
wast
(#607)
* Refactor interface type representation in `wast` This commit updates the `wast` representation of interface types to match more closely what `wasmparser` does. Previously `wast` primarily used `ComponentTypeUse<'_, InterType<'_>>` for references and `InterType<'_>` for definitions. This meant, though, that references could not use primitives by-value. Additionally it also meant that the parsing for `ComponentTypeUse` actually used `IndexOrRef` to parse either `$t` or `(type $t)` but `ComponentTypeUse` is used for many other constructs where it would not be appropriate for a bare index `$t` to be parsed, for example this should not parse: (component (type $ty (module)) (import "" (module $m $ty))) This commit instead refactors all uses of `ComponentTypeUse<'_, InterType<'_>>` to instead use a new `InterTypeRef<'_>` construct. Additionally a `Primitive` was split out from the existing `InterType<'_>` and added as a variant to the `InterTypeRef<'_>` enum as well. This reflects the organization in the `wasmparser` crate and means that primitive types can be used inline instead of references and such. Closes #600 * List an issue in FIXME annotations
- Loading branch information
1 parent
5f3d593
commit cf92a1e
Showing
10 changed files
with
274 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.