@@ -566,7 +566,7 @@ or codepoints that Unicode officially deprecates or strongly discourages.
566
566
567
567
The current structure of tokens are:
568
568
569
- ``` wit
569
+ ``` ebnf
570
570
token ::= whitespace
571
571
| comment
572
572
| operator
@@ -582,7 +582,7 @@ here.
582
582
A ` whitespace ` token in ` wit ` is a space, a newline, a carriage return, or a
583
583
tab character:
584
584
585
- ``` wit
585
+ ``` ebnf
586
586
whitespace ::= ' ' | '\n' | '\r' | '\t'
587
587
```
588
588
@@ -593,7 +593,7 @@ ends at the next newline (`\n`) character or it's a block comment which starts
593
593
with ` /* ` and ends with ` */ ` . Note that block comments are allowed to be nested
594
594
and their delimiters must be balanced
595
595
596
- ``` wit
596
+ ``` ebnf
597
597
comment ::= '//' character-that-isnt-a-newline*
598
598
| '/*' any-unicode-character* '*/'
599
599
```
@@ -604,7 +604,7 @@ newline (`\n`) character or it's a block comment which starts with `/**` and end
604
604
with ` */ ` . Note that block comments are allowed to be nested and their delimiters
605
605
must be balanced
606
606
607
- ``` wit
607
+ ``` ebnf
608
608
doc-comment ::= '///' character-that-isnt-a-newline*
609
609
| '/**' any-unicode-character* '*/'
610
610
```
@@ -615,7 +615,7 @@ There are some common operators in the lexical structure of `wit` used for
615
615
various constructs. Note that delimiters such as ` { ` and ` ( ` must all be
616
616
balanced.
617
617
618
- ``` wit
618
+ ``` ebnf
619
619
operator ::= '=' | ',' | ':' | ';' | '(' | ')' | '{' | '}' | '<' | '>' | '*' | '->'
620
620
```
621
621
@@ -625,7 +625,7 @@ Certain identifiers are reserved for use in `wit` documents and cannot be used
625
625
bare as an identifier. These are used to help parse the format, and the list of
626
626
keywords is still in flux at this time but the current set is:
627
627
628
- ``` wit
628
+ ``` ebnf
629
629
keyword ::= 'use'
630
630
| 'type'
631
631
| 'resource'
@@ -663,7 +663,7 @@ come one after another and it's recommended to separate them with newlines for
663
663
readability but this isn't required.
664
664
665
665
Concretely, the structure of a ` wit ` document is:
666
- ```
666
+ ``` ebnf
667
667
wit-document ::= (interface-item | world-item)*
668
668
```
669
669
@@ -673,7 +673,7 @@ Worlds define a [componenttype](https://github.com/WebAssembly/component-model/b
673
673
674
674
Concretely, the structure of a world is:
675
675
676
- ``` wit
676
+ ``` ebnf
677
677
world-item ::= 'default'? 'world' id '{' world-items* '}'
678
678
679
679
world-items ::= export-item | import-item | use-item | typedef-item
@@ -697,7 +697,7 @@ sequence of items and functions.
697
697
698
698
Specifically interfaces have the structure:
699
699
700
- ``` wit
700
+ ``` ebnf
701
701
interface-item ::= 'default'? 'interface' id '{' interface-items* '}'
702
702
703
703
interface-items ::= typedef-item
@@ -741,7 +741,7 @@ use my-dependency.document.other-type
741
741
742
742
Specifically the structure of this is:
743
743
744
- ``` wit
744
+ ``` ebnf
745
745
use-item ::= 'use' use-path '.' '{' use-names-list '}'
746
746
747
747
use-names-list ::= use-names-item
@@ -774,7 +774,7 @@ type my-complicated-tuple = tuple<u32, s32, string>
774
774
775
775
Specifically the structure of this is:
776
776
777
- ``` wit
777
+ ``` ebnf
778
778
type-item ::= 'type' id '=' ty
779
779
```
780
780
@@ -799,7 +799,7 @@ record person {
799
799
800
800
Specifically the structure of this is:
801
801
802
- ``` wit
802
+ ``` ebnf
803
803
record-item ::= 'record' id '{' record-fields '}'
804
804
805
805
record-fields ::= record-field
@@ -824,7 +824,7 @@ flags properties {
824
824
825
825
Specifically the structure of this is:
826
826
827
- ``` wit
827
+ ``` ebnf
828
828
flags-items ::= 'flags' id '{' flags-fields '}'
829
829
830
830
flags-fields ::= id
@@ -853,7 +853,7 @@ variant filter {
853
853
854
854
Specifically the structure of this is:
855
855
856
- ``` wit
856
+ ``` ebnf
857
857
variant-items ::= 'variant' id '{' variant-cases '}'
858
858
859
859
variant-cases ::= variant-case
@@ -882,7 +882,7 @@ enum color {
882
882
883
883
Specifically the structure of this is:
884
884
885
- ``` wit
885
+ ``` ebnf
886
886
enum-items ::= 'enum' id '{' enum-cases '}'
887
887
888
888
enum-cases ::= id
@@ -905,7 +905,7 @@ union configuration {
905
905
906
906
Specifically the structure of this is:
907
907
908
- ``` wit
908
+ ``` ebnf
909
909
union-items ::= 'union' id '{' union-cases '}'
910
910
911
911
union-cases ::= ty
@@ -927,7 +927,7 @@ type headers = list<string>
927
927
928
928
Specifically the following types are available:
929
929
930
- ``` wit
930
+ ``` ebnf
931
931
ty ::= 'u8' | 'u16' | 'u32' | 'u64'
932
932
| 's8' | 's16' | 's32' | 's64'
933
933
| 'float32' | 'float64'
@@ -990,7 +990,7 @@ resource is destroyed. In contrast, a borrowed handle represents a temporary
990
990
loan of a handle from the caller to the callee for the duration of the call.
991
991
992
992
The syntax for handles is:
993
- ```
993
+ ``` ebnf
994
994
handle ::= id
995
995
| 'borrow' '<' id '>'
996
996
```
0 commit comments