I'm looking at the definition for top level document here: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#top-level-items It is defined as: ``` wit-document ::= interface-item* ``` Which is a sequence of 0..N `interface-item` instances, defined as: ``` interface-item ::= 'interface' id strlit? '{' interface-items* '}' ``` Would this imply that a wit document can only consist of 0..N interfaces? This doesn't seem correct, as I can see examples here: https://github.com/WebAssembly/wasi-sockets/blob/main/common-types.wit where `record`, `enum` and `type` are top level elements. Is this a typo? Should the definition instead be: ``` wit-document ::= interface-items* ``` That would allow for 0..N `interface-item`, which are defined as: ``` interface-items ::= resource-item | variant-items | record-item | union-items | flags-items | enum-items | type-item | use-item | func-item ```
Activity
patrickhuber commentedon Nov 29, 2022
I looked up the wit parser here https://docs.rs/wit-parser/latest/wit_parser/struct.Document.html and it appears the spec files for the wasi-sockets proposal are actually incorrect.
Top level elements can be one of 'world' or 'interface'