@@ -566,7 +566,7 @@ or codepoints that Unicode officially deprecates or strongly discourages.
566566
567567The current structure of tokens are:
568568
569- ``` wit
569+ ``` ebnf
570570token ::= whitespace
571571 | comment
572572 | operator
@@ -582,7 +582,7 @@ here.
582582A ` whitespace ` token in ` wit ` is a space, a newline, a carriage return, or a
583583tab character:
584584
585- ``` wit
585+ ``` ebnf
586586whitespace ::= ' ' | '\n' | '\r' | '\t'
587587```
588588
@@ -593,7 +593,7 @@ ends at the next newline (`\n`) character or it's a block comment which starts
593593with ` /* ` and ends with ` */ ` . Note that block comments are allowed to be nested
594594and their delimiters must be balanced
595595
596- ``` wit
596+ ``` ebnf
597597comment ::= '//' character-that-isnt-a-newline*
598598 | '/*' any-unicode-character* '*/'
599599```
@@ -604,7 +604,7 @@ newline (`\n`) character or it's a block comment which starts with `/**` and end
604604with ` */ ` . Note that block comments are allowed to be nested and their delimiters
605605must be balanced
606606
607- ``` wit
607+ ``` ebnf
608608doc-comment ::= '///' character-that-isnt-a-newline*
609609 | '/**' any-unicode-character* '*/'
610610```
@@ -615,7 +615,7 @@ There are some common operators in the lexical structure of `wit` used for
615615various constructs. Note that delimiters such as ` { ` and ` ( ` must all be
616616balanced.
617617
618- ``` wit
618+ ``` ebnf
619619operator ::= '=' | ',' | ':' | ';' | '(' | ')' | '{' | '}' | '<' | '>' | '*' | '->'
620620```
621621
@@ -625,7 +625,7 @@ Certain identifiers are reserved for use in `wit` documents and cannot be used
625625bare as an identifier. These are used to help parse the format, and the list of
626626keywords is still in flux at this time but the current set is:
627627
628- ``` wit
628+ ``` ebnf
629629keyword ::= 'use'
630630 | 'type'
631631 | 'resource'
@@ -663,7 +663,7 @@ come one after another and it's recommended to separate them with newlines for
663663readability but this isn't required.
664664
665665Concretely, the structure of a ` wit ` document is:
666- ```
666+ ``` ebnf
667667wit-document ::= (interface-item | world-item)*
668668```
669669
@@ -673,7 +673,7 @@ Worlds define a [componenttype](https://github.com/WebAssembly/component-model/b
673673
674674Concretely, the structure of a world is:
675675
676- ``` wit
676+ ``` ebnf
677677world-item ::= 'default'? 'world' id '{' world-items* '}'
678678
679679world-items ::= export-item | import-item | use-item | typedef-item
@@ -697,7 +697,7 @@ sequence of items and functions.
697697
698698Specifically interfaces have the structure:
699699
700- ``` wit
700+ ``` ebnf
701701interface-item ::= 'default'? 'interface' id '{' interface-items* '}'
702702
703703interface-items ::= typedef-item
@@ -741,7 +741,7 @@ use my-dependency.document.other-type
741741
742742Specifically the structure of this is:
743743
744- ``` wit
744+ ``` ebnf
745745use-item ::= 'use' use-path '.' '{' use-names-list '}'
746746
747747use-names-list ::= use-names-item
@@ -774,7 +774,7 @@ type my-complicated-tuple = tuple<u32, s32, string>
774774
775775Specifically the structure of this is:
776776
777- ``` wit
777+ ``` ebnf
778778type-item ::= 'type' id '=' ty
779779```
780780
@@ -799,7 +799,7 @@ record person {
799799
800800Specifically the structure of this is:
801801
802- ``` wit
802+ ``` ebnf
803803record-item ::= 'record' id '{' record-fields '}'
804804
805805record-fields ::= record-field
@@ -824,7 +824,7 @@ flags properties {
824824
825825Specifically the structure of this is:
826826
827- ``` wit
827+ ``` ebnf
828828flags-items ::= 'flags' id '{' flags-fields '}'
829829
830830flags-fields ::= id
@@ -853,7 +853,7 @@ variant filter {
853853
854854Specifically the structure of this is:
855855
856- ``` wit
856+ ``` ebnf
857857variant-items ::= 'variant' id '{' variant-cases '}'
858858
859859variant-cases ::= variant-case
@@ -882,7 +882,7 @@ enum color {
882882
883883Specifically the structure of this is:
884884
885- ``` wit
885+ ``` ebnf
886886enum-items ::= 'enum' id '{' enum-cases '}'
887887
888888enum-cases ::= id
@@ -905,7 +905,7 @@ union configuration {
905905
906906Specifically the structure of this is:
907907
908- ``` wit
908+ ``` ebnf
909909union-items ::= 'union' id '{' union-cases '}'
910910
911911union-cases ::= ty
@@ -927,7 +927,7 @@ type headers = list<string>
927927
928928Specifically the following types are available:
929929
930- ``` wit
930+ ``` ebnf
931931ty ::= 'u8' | 'u16' | 'u32' | 'u64'
932932 | 's8' | 's16' | 's32' | 's64'
933933 | 'float32' | 'float64'
@@ -990,7 +990,7 @@ resource is destroyed. In contrast, a borrowed handle represents a temporary
990990loan of a handle from the caller to the callee for the duration of the call.
991991
992992The syntax for handles is:
993- ```
993+ ``` ebnf
994994handle ::= id
995995 | 'borrow' '<' id '>'
996996```
0 commit comments