Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As an abbreviation [0], a type use [1] can be replaced by inline parameter and result declarations: instead of writing e.g. `(func (type $t) …)` and defining `$t` elsewhere in the module with `(type $t (func (param i32) (result i64)))`, we can write the more concise and expressive `(func (param i32) (result i64) …)`. To support this abbreviation, a WebAssembly implementation must automatically insert a type index referring either to a matching type definition in the current module (e.g. `$t` above) or a newly-inserted type definition if no matching one exists. This commit implements desugaring for this abbreviation in the preprocessor and removes support for it from the AST parser. It relies upon machinery introduced in #14 and #15 which allows type definitions to be collected while preprocessing a module’s fields and then provided to the deferred result to yield the final S-expressions. [0] https://webassembly.github.io/spec/core/text/modules.html#abbreviations [1] https://webassembly.github.io/spec/core/text/modules.html#type-uses
- Loading branch information