@@ -102,8 +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 ` name ` is present in an
106
- ` externname ` of ` c ` (with a matching type).
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.
107
108
* When validating ` instantiate ` , after each individual type-import is supplied
108
109
via ` with ` , the actual type supplied is immediately substituted for all uses
109
110
of the import, so that subsequent imports and all exports are now specialized
@@ -327,33 +328,21 @@ flags are set.
327
328
(See [ Import and Export Definitions] ( Explainer.md#import-and-export-definitions )
328
329
in the explainer.)
329
330
```
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 n:<id> => (interface n)
334
- id ::= len:<u32> n:<id-chars> => n (if len = |n|)
335
-
336
- id-chars ::= ns:<label> ':' pkg:<label> '/' n:<label> v:<id-version> => ns:pkg/nv
337
- id-version ::= => ϵ
338
- | '@' version:<version> pre:<verpre> build:<verbuild> => version pre build
339
-
340
- version ::= major:<num> '.' minor:<num> '.' patch:<num> => major.minor.patch
341
- version-number ::= digit+:[0x30-0x39] => char(digit)+
342
-
343
- verpre ::= => ϵ
344
- | '-' (a:<label> '.') b:<label> => -(a.*)b
345
- verbuild ::= => ϵ
346
- | '+' (a:<label> '.') b:<label> => +(a.*)b
331
+ import ::= en:<externname> ed:<externdesc> => (import en ed)
332
+ export ::= en:<externname> si:<sortidx> ed?:<externdesc>? => (export en si ed?)
333
+ externname ::= 0x00 n:<name> => n
334
+ | 0x01 iid:<iid> => (interface iid)
335
+ iid ::= len:<u32> c:<iid-chars> => c (if len = |c|)
336
+ iid-chars ::= ns:<label> ':' pkg:<label> '/' n:<label> v:<version> => ns:pkg/nv
337
+ version ::= => ϵ
338
+ | '@' v:<valid semver> => @v
347
339
```
348
340
349
341
Notes:
350
342
* All exports (of all ` sort ` s) introduce a new index that aliases the exported
351
343
definition and can be used by all subsequent definitions just like an alias.
352
344
* Validation requires that all resource types transitively used in the type of an
353
345
export are introduced by a preceding ` importdecl ` or ` exportdecl ` .
354
- * The "parses as a URL" condition is defined by executing the [ basic URL
355
- parser] with ` char(b)* ` as * input* , no optional parameters and non-fatal
356
- validation errors (which coincides with definition of ` URL ` in JS and ` rust-url ` ).
357
346
* Validation requires any exported ` sortidx ` to have a valid ` externdesc `
358
347
(which disallows core sorts other than ` core module ` ). When the optional
359
348
` externdesc ` immediate is present, validation requires it to be a supertype
@@ -364,7 +353,7 @@ Notes:
364
353
* The ` id ` fields of ` externname ` (that are present) must independently be
365
354
unique among imports and exports, respectively. (An import and export * may*
366
355
have the same ` id ` .)
367
- * URLs are compared for equality by plain byte identity.
356
+ * ` <valid semver> ` is as defined by [ https://semver.org ] ( https://semver.org/ )
368
357
369
358
## Name Section
370
359
@@ -407,5 +396,3 @@ named once.
407
396
408
397
[ type-imports ] : https://github.com/WebAssembly/proposal-type-imports/blob/master/proposals/type-imports/Overview.md
409
398
[ module-linking ] : https://github.com/WebAssembly/module-linking/blob/main/proposals/module-linking/Explainer.md
410
-
411
- [ Basic URL Parser ] : https://url.spec.whatwg.org/#concept-basic-url-parser
0 commit comments