forked from bytecodealliance/wasm-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow import/export overlap in
wit-parser
Updates to WebAssembly/component-model#259 by relaxing some checks here and there. Closes bytecodealliance#1396
- Loading branch information
1 parent
56d0d94
commit c14f197
Showing
14 changed files
with
219 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
crates/wit-parser/tests/ui/import-export-overlap1.wit.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"worlds": [ | ||
{ | ||
"name": "foo", | ||
"imports": { | ||
"a": { | ||
"function": { | ||
"name": "a", | ||
"kind": "freestanding", | ||
"params": [], | ||
"results": [] | ||
} | ||
} | ||
}, | ||
"exports": { | ||
"a": { | ||
"function": { | ||
"name": "a", | ||
"kind": "freestanding", | ||
"params": [], | ||
"results": [] | ||
} | ||
} | ||
}, | ||
"package": 0 | ||
} | ||
], | ||
"interfaces": [], | ||
"types": [], | ||
"packages": [ | ||
{ | ||
"name": "foo:foo", | ||
"interfaces": {}, | ||
"worlds": { | ||
"foo": 0 | ||
} | ||
} | ||
] | ||
} |
File renamed without changes.
41 changes: 41 additions & 0 deletions
41
crates/wit-parser/tests/ui/import-export-overlap2.wit.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"worlds": [ | ||
{ | ||
"name": "foo", | ||
"imports": { | ||
"a": { | ||
"function": { | ||
"name": "a", | ||
"kind": "freestanding", | ||
"params": [], | ||
"results": [] | ||
} | ||
} | ||
}, | ||
"exports": { | ||
"a": { | ||
"interface": 0 | ||
} | ||
}, | ||
"package": 0 | ||
} | ||
], | ||
"interfaces": [ | ||
{ | ||
"name": null, | ||
"types": {}, | ||
"functions": {}, | ||
"package": 0 | ||
} | ||
], | ||
"types": [], | ||
"packages": [ | ||
{ | ||
"name": "foo:foo", | ||
"interfaces": {}, | ||
"worlds": { | ||
"foo": 0 | ||
} | ||
} | ||
] | ||
} |
5 changes: 0 additions & 5 deletions
5
crates/wit-parser/tests/ui/parse-fail/import-export-overlap1.wit.result
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
crates/wit-parser/tests/ui/parse-fail/import-export-overlap2.wit.result
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
crates/wit-parser/tests/ui/parse-fail/union-fuzz-2.wit.result
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package demo:greeter; | ||
|
||
world greeter { | ||
import greet: func() -> string; | ||
export greet: func() -> string; | ||
} |
47 changes: 47 additions & 0 deletions
47
crates/wit-parser/tests/ui/same-name-import-export.wit.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"worlds": [ | ||
{ | ||
"name": "greeter", | ||
"imports": { | ||
"greet": { | ||
"function": { | ||
"name": "greet", | ||
"kind": "freestanding", | ||
"params": [], | ||
"results": [ | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"exports": { | ||
"greet": { | ||
"function": { | ||
"name": "greet", | ||
"kind": "freestanding", | ||
"params": [], | ||
"results": [ | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"package": 0 | ||
} | ||
], | ||
"interfaces": [], | ||
"types": [], | ||
"packages": [ | ||
{ | ||
"name": "demo:greeter", | ||
"interfaces": {}, | ||
"worlds": { | ||
"greeter": 0 | ||
} | ||
} | ||
] | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"worlds": [ | ||
{ | ||
"name": "foo", | ||
"imports": {}, | ||
"exports": { | ||
"foo": { | ||
"function": { | ||
"name": "foo", | ||
"kind": "freestanding", | ||
"params": [], | ||
"results": [ | ||
{ | ||
"name": "name2", | ||
"type": "float32" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"package": 0 | ||
}, | ||
{ | ||
"name": "bar", | ||
"imports": { | ||
"foo": { | ||
"type": 0 | ||
} | ||
}, | ||
"exports": { | ||
"foo": { | ||
"function": { | ||
"name": "foo", | ||
"kind": "freestanding", | ||
"params": [], | ||
"results": [ | ||
{ | ||
"name": "name2", | ||
"type": "float32" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"package": 0 | ||
} | ||
], | ||
"interfaces": [], | ||
"types": [ | ||
{ | ||
"name": "foo", | ||
"kind": { | ||
"record": { | ||
"fields": [] | ||
} | ||
}, | ||
"owner": { | ||
"world": 1 | ||
} | ||
} | ||
], | ||
"packages": [ | ||
{ | ||
"name": "foo:bar", | ||
"interfaces": {}, | ||
"worlds": { | ||
"foo": 0, | ||
"bar": 1 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters