Skip to content

Commit 080845b

Browse files
authored
add use-path grammar (#245)
* add use-path grammar * re-use interface rule instead of use-path * Rename interface production to use-path
1 parent fb99bcb commit 080845b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

design/mvp/WIT.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -880,18 +880,18 @@ into the scope of the current file and/or rename interfaces locally for
880880
convenience:
881881

882882
```ebnf
883-
toplevel-use-item ::= 'use' interface ('as' id)?
883+
toplevel-use-item ::= 'use' use-path ('as' id)?
884884
885-
interface ::= id
885+
use-path ::= id
886886
| id ':' id '/' id ('@' valid-semver)?
887887
```
888888

889-
Here `interface` is the ID used to refer to interfaces. The bare form `id`
889+
Here `use-path` is the ID used to refer to interfaces. The bare form `id`
890890
refers to interfaces defined within the current package, and the full form
891891
refers to interfaces in package dependencies.
892892

893893
The `as` syntax can be optionally used to specify a name that should be assigned
894-
to the interface. Otherwise the name is inferred from `interface`.
894+
to the interface. Otherwise the name is inferred from `use-path`.
895895

896896
## Item: `world`
897897

@@ -905,9 +905,9 @@ world-item ::= 'world' id '{' world-items* '}'
905905
world-items ::= export-item | import-item | use-item | typedef-item | include-item
906906
907907
export-item ::= 'export' id ':' extern-type
908-
| 'export' interface
908+
| 'export' use-path
909909
import-item ::= 'import' id ':' extern-type
910-
| 'import' interface
910+
| 'import' use-path
911911
912912
extern-type ::= func-type | 'interface' '{' interface-items* '}'
913913
```
@@ -988,7 +988,7 @@ use my:dependency/the-interface.{more, names as foo}
988988
Specifically the structure of this is:
989989

990990
```ebnf
991-
use-item ::= 'use' interface '.' '{' use-names-list '}'
991+
use-item ::= 'use' use-path '.' '{' use-names-list '}'
992992
993993
use-names-list ::= use-names-item
994994
| use-names-item ',' use-names-list?

0 commit comments

Comments
 (0)