-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from ydnar/ydnar/semi-trailer
provably correct round-trip WIT generation
- Loading branch information
Showing
39 changed files
with
1,851 additions
and
185 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,10 @@ jobs: | |
- name: Set up Wasmtime | ||
uses: bytecodealliance/actions/wasmtime/[email protected] | ||
with: | ||
version: "v13.0.0" | ||
version: "v14.0.4" | ||
|
||
- name: Set up wasm-tools | ||
uses: bytecodealliance/actions/wasm-tools/[email protected] | ||
|
||
- name: Vet Go code | ||
run: go vet ./... | ||
|
@@ -48,7 +51,10 @@ jobs: | |
run: tinygo test -v ./... | ||
|
||
- name: Test with TinyGo + WASI | ||
run: tinygo test -v -target=wasi -stack-size=64KB ./... | ||
env: | ||
GOOS: wasip1 | ||
GOARCH: wasm | ||
run: tinygo test -stack-size=64KB ./... | ||
|
||
- name: Verify repo is unchanged | ||
run: git diff --exit-code HEAD |
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,59 @@ | ||
package example:escaped-names; | ||
|
||
interface %interface { | ||
record %record { | ||
%enum: %enum, | ||
%result: result<string, error>, | ||
} | ||
|
||
enum error { | ||
ok, | ||
fail | ||
} | ||
|
||
record %export { | ||
headers: list<tuple<list<u8>, list<u8>>>, | ||
body: list<u8> | ||
} | ||
|
||
enum %enum { | ||
%enum, | ||
%export, | ||
%flags, | ||
%func, | ||
%import, | ||
%include, | ||
%interface, | ||
%package, | ||
%record, | ||
%resource, | ||
%static, | ||
%type, | ||
%variant, | ||
%world, | ||
} | ||
|
||
variant %variant { | ||
%enum(%record), | ||
%export(%record), | ||
%flags(%record), | ||
%func(%record), | ||
%import(%record), | ||
%include(%record), | ||
%interface(%record), | ||
%package(%record), | ||
%record(%record), | ||
%resource(%record), | ||
%static(%record), | ||
%type(%record), | ||
%variant(%record), | ||
%world(%record), | ||
} | ||
|
||
%func: func(rec: %record) -> result<%export, error>; | ||
} | ||
|
||
world %world { | ||
import %interface; | ||
export %interface; | ||
} |
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,218 @@ | ||
{ | ||
"worlds": [ | ||
{ | ||
"name": "world", | ||
"imports": { | ||
"interface-0": { | ||
"interface": 0 | ||
} | ||
}, | ||
"exports": { | ||
"interface-0": { | ||
"interface": 0 | ||
} | ||
}, | ||
"package": 0 | ||
} | ||
], | ||
"interfaces": [ | ||
{ | ||
"name": "interface", | ||
"types": { | ||
"error": 0, | ||
"export": 4, | ||
"enum": 5, | ||
"record": 7 | ||
}, | ||
"functions": { | ||
"func": { | ||
"name": "func", | ||
"kind": "freestanding", | ||
"params": [ | ||
{ | ||
"name": "rec", | ||
"type": 7 | ||
} | ||
], | ||
"results": [ | ||
{ | ||
"type": 8 | ||
} | ||
] | ||
} | ||
}, | ||
"package": 0 | ||
} | ||
], | ||
"types": [ | ||
{ | ||
"name": "error", | ||
"kind": { | ||
"enum": { | ||
"cases": [ | ||
{ | ||
"name": "ok" | ||
}, | ||
{ | ||
"name": "fail" | ||
} | ||
] | ||
} | ||
}, | ||
"owner": { | ||
"interface": 0 | ||
} | ||
}, | ||
{ | ||
"name": null, | ||
"kind": { | ||
"list": "u8" | ||
}, | ||
"owner": null | ||
}, | ||
{ | ||
"name": null, | ||
"kind": { | ||
"tuple": { | ||
"types": [ | ||
1, | ||
1 | ||
] | ||
} | ||
}, | ||
"owner": null | ||
}, | ||
{ | ||
"name": null, | ||
"kind": { | ||
"list": 2 | ||
}, | ||
"owner": null | ||
}, | ||
{ | ||
"name": "export", | ||
"kind": { | ||
"record": { | ||
"fields": [ | ||
{ | ||
"name": "headers", | ||
"type": 3 | ||
}, | ||
{ | ||
"name": "body", | ||
"type": 1 | ||
} | ||
] | ||
} | ||
}, | ||
"owner": { | ||
"interface": 0 | ||
} | ||
}, | ||
{ | ||
"name": "enum", | ||
"kind": { | ||
"enum": { | ||
"cases": [ | ||
{ | ||
"name": "enum" | ||
}, | ||
{ | ||
"name": "export" | ||
}, | ||
{ | ||
"name": "flags" | ||
}, | ||
{ | ||
"name": "func" | ||
}, | ||
{ | ||
"name": "import" | ||
}, | ||
{ | ||
"name": "include" | ||
}, | ||
{ | ||
"name": "interface" | ||
}, | ||
{ | ||
"name": "package" | ||
}, | ||
{ | ||
"name": "record" | ||
}, | ||
{ | ||
"name": "resource" | ||
}, | ||
{ | ||
"name": "static" | ||
}, | ||
{ | ||
"name": "type" | ||
}, | ||
{ | ||
"name": "variant" | ||
}, | ||
{ | ||
"name": "world" | ||
} | ||
] | ||
} | ||
}, | ||
"owner": { | ||
"interface": 0 | ||
} | ||
}, | ||
{ | ||
"name": null, | ||
"kind": { | ||
"result": { | ||
"ok": "string", | ||
"err": 0 | ||
} | ||
}, | ||
"owner": null | ||
}, | ||
{ | ||
"name": "record", | ||
"kind": { | ||
"record": { | ||
"fields": [ | ||
{ | ||
"name": "enum", | ||
"type": 5 | ||
}, | ||
{ | ||
"name": "result", | ||
"type": 6 | ||
} | ||
] | ||
} | ||
}, | ||
"owner": { | ||
"interface": 0 | ||
} | ||
}, | ||
{ | ||
"name": null, | ||
"kind": { | ||
"result": { | ||
"ok": 4, | ||
"err": 0 | ||
} | ||
}, | ||
"owner": null | ||
} | ||
], | ||
"packages": [ | ||
{ | ||
"name": "example:escaped-names", | ||
"interfaces": { | ||
"interface": 0 | ||
}, | ||
"worlds": { | ||
"world": 0 | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.