Skip to content

Commit 1d2a7df

Browse files
committed
format: Change EBNF codeblock syntax highlighting to ebnf
GitHub supports syntax highlighting for the ebnf format
1 parent c366536 commit 1d2a7df

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

design/mvp/WIT.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ or codepoints that Unicode officially deprecates or strongly discourages.
566566

567567
The current structure of tokens are:
568568

569-
```wit
569+
```ebnf
570570
token ::= whitespace
571571
| comment
572572
| operator
@@ -582,7 +582,7 @@ here.
582582
A `whitespace` token in `wit` is a space, a newline, a carriage return, or a
583583
tab character:
584584

585-
```wit
585+
```ebnf
586586
whitespace ::= ' ' | '\n' | '\r' | '\t'
587587
```
588588

@@ -593,7 +593,7 @@ ends at the next newline (`\n`) character or it's a block comment which starts
593593
with `/*` and ends with `*/`. Note that block comments are allowed to be nested
594594
and their delimiters must be balanced
595595

596-
```wit
596+
```ebnf
597597
comment ::= '//' 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
604604
with `*/`. Note that block comments are allowed to be nested and their delimiters
605605
must be balanced
606606

607-
```wit
607+
```ebnf
608608
doc-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
615615
various constructs. Note that delimiters such as `{` and `(` must all be
616616
balanced.
617617

618-
```wit
618+
```ebnf
619619
operator ::= '=' | ',' | ':' | ';' | '(' | ')' | '{' | '}' | '<' | '>' | '*' | '->'
620620
```
621621

@@ -625,7 +625,7 @@ Certain identifiers are reserved for use in `wit` documents and cannot be used
625625
bare as an identifier. These are used to help parse the format, and the list of
626626
keywords is still in flux at this time but the current set is:
627627

628-
```wit
628+
```ebnf
629629
keyword ::= 'use'
630630
| 'type'
631631
| 'resource'
@@ -663,7 +663,7 @@ come one after another and it's recommended to separate them with newlines for
663663
readability but this isn't required.
664664

665665
Concretely, the structure of a `wit` document is:
666-
```
666+
```ebnf
667667
wit-document ::= (interface-item | world-item)*
668668
```
669669

@@ -673,7 +673,7 @@ Worlds define a [componenttype](https://github.com/WebAssembly/component-model/b
673673

674674
Concretely, the structure of a world is:
675675

676-
```wit
676+
```ebnf
677677
world-item ::= 'default'? 'world' id '{' world-items* '}'
678678
679679
world-items ::= export-item | import-item | use-item | typedef-item
@@ -697,7 +697,7 @@ sequence of items and functions.
697697

698698
Specifically interfaces have the structure:
699699

700-
```wit
700+
```ebnf
701701
interface-item ::= 'default'? 'interface' id '{' interface-items* '}'
702702
703703
interface-items ::= typedef-item
@@ -741,7 +741,7 @@ use my-dependency.document.other-type
741741

742742
Specifically the structure of this is:
743743

744-
```wit
744+
```ebnf
745745
use-item ::= 'use' use-path '.' '{' use-names-list '}'
746746
747747
use-names-list ::= use-names-item
@@ -774,7 +774,7 @@ type my-complicated-tuple = tuple<u32, s32, string>
774774

775775
Specifically the structure of this is:
776776

777-
```wit
777+
```ebnf
778778
type-item ::= 'type' id '=' ty
779779
```
780780

@@ -799,7 +799,7 @@ record person {
799799

800800
Specifically the structure of this is:
801801

802-
```wit
802+
```ebnf
803803
record-item ::= 'record' id '{' record-fields '}'
804804
805805
record-fields ::= record-field
@@ -824,7 +824,7 @@ flags properties {
824824

825825
Specifically the structure of this is:
826826

827-
```wit
827+
```ebnf
828828
flags-items ::= 'flags' id '{' flags-fields '}'
829829
830830
flags-fields ::= id
@@ -853,7 +853,7 @@ variant filter {
853853

854854
Specifically the structure of this is:
855855

856-
```wit
856+
```ebnf
857857
variant-items ::= 'variant' id '{' variant-cases '}'
858858
859859
variant-cases ::= variant-case
@@ -882,7 +882,7 @@ enum color {
882882

883883
Specifically the structure of this is:
884884

885-
```wit
885+
```ebnf
886886
enum-items ::= 'enum' id '{' enum-cases '}'
887887
888888
enum-cases ::= id
@@ -905,7 +905,7 @@ union configuration {
905905

906906
Specifically the structure of this is:
907907

908-
```wit
908+
```ebnf
909909
union-items ::= 'union' id '{' union-cases '}'
910910
911911
union-cases ::= ty
@@ -927,7 +927,7 @@ type headers = list<string>
927927

928928
Specifically the following types are available:
929929

930-
```wit
930+
```ebnf
931931
ty ::= '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
990990
loan of a handle from the caller to the callee for the duration of the call.
991991

992992
The syntax for handles is:
993-
```
993+
```ebnf
994994
handle ::= id
995995
| 'borrow' '<' id '>'
996996
```

0 commit comments

Comments
 (0)