@@ -78,7 +78,7 @@ sort ::= 0x00 cs:<core:sort> => co
78
78
| 0x03 => type
79
79
| 0x04 => component
80
80
| 0x05 => instance
81
- inlineexport ::= n:<externname > si:<sortidx> => (export n si)
81
+ inlineexport ::= n:<exportname > si:<sortidx> => (export n si)
82
82
string ::= s:<core:name> => s
83
83
name ::= len:<u32> n:<name-chars> => n (if len = |n|)
84
84
name-chars ::= l:<label> => l
@@ -102,9 +102,9 @@ Notes:
102
102
for aliases (below).
103
103
* Validation of ` core:instantiatearg ` initially only allows the ` instance `
104
104
sort, but would be extended to accept other sorts as core wasm is extended.
105
- * Validation of ` instantiate ` requires that each ` <name> ` or ` <iid >` in an
106
- imported ` externname ` in ` c ` matches a ` string ` in a ` with ` argument and that
107
- the argument's type matches the import's type .
105
+ * Validation of ` instantiate ` requires each ` <name> ` , ` <regid >` or
106
+ ` <regidset> ` in an ` importname ` in ` c ` to match a ` string ` in a ` with `
107
+ argument and for the types to match .
108
108
* When validating ` instantiate ` , after each individual type-import is supplied
109
109
via ` with ` , the actual type supplied is immediately substituted for all uses
110
110
of the import, so that subsequent imports and all exports are now specialized
@@ -226,8 +226,8 @@ instancedecl ::= 0x00 t:<core:type> => t
226
226
| 0x01 t:<type> => t
227
227
| 0x02 a:<alias> => a
228
228
| 0x04 ed:<exportdecl> => ed
229
- importdecl ::= en:<externname > ed:<externdesc> => (import en ed)
230
- exportdecl ::= en:<externname > ed:<externdesc> => (export en ed)
229
+ importdecl ::= in:<importname > ed:<externdesc> => (import in ed)
230
+ exportdecl ::= en:<exportname > ed:<externdesc> => (export en ed)
231
231
externdesc ::= 0x00 0x11 i:<core:typeidx> => (core module (type i))
232
232
| 0x01 i:<typeidx> => (func (type i))
233
233
| 0x02 t:<valtype> => (value t)
@@ -263,8 +263,8 @@ Notes:
263
263
* Validation rejects ` resourcetype ` type definitions inside ` componenttype ` and
264
264
` instancettype ` . Thus, handle types inside a ` componenttype ` can only refer
265
265
to resource types that are imported or exported.
266
- * The uniqueness validation rules for ` externname ` described below are also
267
- applied at the instance- and component-type level.
266
+ * The uniqueness validation rules for ` importname ` and ` exportname `
267
+ described below are also applied at the instance- and component-type level.
268
268
* Validation of ` externdesc ` requires the various ` typeidx ` type constructors
269
269
to match the preceding ` sort ` .
270
270
* Validation of function parameter and result names, record field names,
@@ -327,14 +327,19 @@ flags are set.
327
327
(See [ Import and Export Definitions] ( Explainer.md#import-and-export-definitions )
328
328
in the explainer.)
329
329
```
330
- import ::= en:<externname> ed:<externdesc> => (import en ed)
331
- export ::= en:<externname> si:<sortidx> ed?:<externdesc>? => (export en si ed?)
332
- externname ::= 0x00 n:<name> => n
333
- | 0x01 iid:<iid> => (interface iid)
334
- iid ::= len:<u32> c:<iid-chars> => c (if len = |c|)
335
- iid-chars ::= ns:<label> ':' pkg:<label> '/' n:<label> v:<version> => ns:pkg/nv
336
- version ::= => ϵ
337
- | '@' v:<valid semver> => @v
330
+ import ::= in:<importname> ed:<externdesc> => (import in ed)
331
+ export ::= en:<exportname> si:<sortidx> ed?:<externdesc>? => (export en si ed?)
332
+ exportname ::= 0x00 n:<name> => n
333
+ | 0x01 ri:<regid'> => (interface ri)
334
+ importname ::= en:<exportname> => en
335
+ | 0x02 n:<name> s:<string> i?:<integrity'>? => n (url s i?)
336
+ | 0x03 n:<name> s:<string> i?:<integrity'>? => n (relative-url s i?)
337
+ | 0x04 n:<name> i:<integrity'> => n i
338
+ | 0x05 ri:<regid'> i?:<integrity'>? => (locked-dep ri i?)
339
+ | 0x06 ris:<regidset'> => (unlocked-dep ris)
340
+ regid' ::= len:<u32> ri:<regid> => "ri" (if len = |ri|)
341
+ regidset' ::= len:<u32> ris:<regidset> => "ris" (if len = |ris|)
342
+ integrity' ::= len:<u32> im:<integrity-metadata> => (integrity "im") (if len = |im|)
338
343
```
339
344
340
345
Notes:
@@ -346,13 +351,18 @@ Notes:
346
351
(which disallows core sorts other than ` core module ` ). When the optional
347
352
` externdesc ` immediate is present, validation requires it to be a supertype
348
353
of the inferred ` externdesc ` of the ` sortidx ` .
349
- * The ` name ` fields of ` externname ` must be unique among all imports and exports
350
- in the containing component definition, component type or instance type. (An
351
- import and export cannot use the same ` name ` .)
352
- * The ` id ` fields of ` externname ` (that are present) must independently be
353
- unique among imports and exports, respectively. (An import and export * may*
354
- have the same ` id ` .)
354
+ * The ` name ` fields of ` exportname ` and ` importname ` must be unique among all
355
+ imports and exports in the containing component definition, component type or
356
+ instance type. (An import and export cannot use the same ` name ` .)
357
+ * The ` regid ` and ` regidset ` of ` importname ` and ` exportname ` must be
358
+ unique only among imports or exports. That is, two imports may * not*
359
+ have the same ` regid ` (` set ` ), but an import and export * may* have the same
360
+ ` regid ` .
361
+ * ` <regid> ` and ` <regidset> ` refer to the grammatical productions defined in
362
+ the [ text format] ( #import-and-export-definitions ) .
355
363
* ` <valid semver> ` is as defined by [ https://semver.org ] ( https://semver.org/ )
364
+ * ` <integrity-metadata> ` is as defined by the
365
+ [ SRI] ( https://www.w3.org/TR/SRI/#dfn-integrity-metadata ) spec.
356
366
357
367
## Name Section
358
368
0 commit comments