Skip to content

WIT.md top level document definition #137

Description

@patrickhuber

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions