Skip to content

Commit

Permalink
Add a whole lot of semicolons to WIT files
Browse files Browse the repository at this point in the history
To prepare this commit I've run `WIT_REQUIRE_SEMICOLONS=1 ./ci/run-tests.sh`
locally which configures `wit-parser` to generate an error for missing
semicolons in WIT files. This led me to add quite a few semicolons in
quite a few places in what is going to be the first of a few batches of
semicolons.

CI checks for this cannot be added just yet because the wasi-nn spec is
a submodule which needs to be updated with semicolons before this
repository can require semicolons. Nevertheless that doesn't stop us
from using semicolons in the meantime (yay gradual rollout of changes!)
so I figure this would be good to get in sooner rather than later.
  • Loading branch information
alexcrichton committed Oct 5, 2023
1 parent df15006 commit 0bb3407
Show file tree
Hide file tree
Showing 111 changed files with 1,290 additions and 1,292 deletions.
2 changes: 1 addition & 1 deletion crates/component-macro/src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl Parse for Config {
}
inline = Some(format!(
"
package wasmtime:component-macro-synthesized
package wasmtime:component-macro-synthesized;
world interfaces {{
{}
Expand Down
16 changes: 8 additions & 8 deletions crates/component-macro/tests/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ mod with_key_and_resources {

wasmtime::component::bindgen!({
inline: "
package demo:pkg
package demo:pkg;
interface bar {
resource a
resource b
resource a;
resource b;
}
world foo {
resource a
resource b
resource a;
resource b;
import foo: interface {
resource a
resource b
resource a;
resource b;
}
import bar
import bar;
}
",
with: {
Expand Down
10 changes: 5 additions & 5 deletions crates/component-macro/tests/codegen/char.wit
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package foo:foo
package foo:foo;

interface chars {
/// A function that accepts a character
take-char: func(x: char)
take-char: func(x: char);
/// A function that returns a character
return-char: func() -> char
return-char: func() -> char;
}

world the-world {
import chars
export chars
import chars;
export chars;
}
30 changes: 15 additions & 15 deletions crates/component-macro/tests/codegen/conventions.wit
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
// hello 🐱 world
package foo:foo
package foo:foo;

interface conventions {
kebab-case: func()
kebab-case: func();

record ludicrous-speed {
how-fast-are-you-going: u32,
i-am-going-extremely-slow: u64,
}

foo: func(x: ludicrous-speed)
%function-with-dashes: func()
%function-with-no-weird-characters: func()
foo: func(x: ludicrous-speed);
%function-with-dashes: func();
%function-with-no-weird-characters: func();

apple: func()
apple-pear: func()
apple-pear-grape: func()
a0: func()
apple: func();
apple-pear: func();
apple-pear-grape: func();
a0: func();

// Comment out identifiers that collide when mapped to snake_case, for now; see
// https://github.com/WebAssembly/component-model/issues/118
//APPLE: func()
//APPLE-pear-GRAPE: func()
//apple-PEAR-grape: func()

is-XML: func()
is-XML: func();

%explicit: func()
%explicit-kebab: func()
%explicit: func();
%explicit-kebab: func();

// Identifiers with the same name as keywords are quoted.
%bool: func()
%bool: func();
}

world the-world {
import conventions
export conventions
import conventions;
export conventions;
}
4 changes: 2 additions & 2 deletions crates/component-macro/tests/codegen/direct-import.wit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package foo:foo
package foo:foo;

world foo {
import foo: func()
import foo: func();
}
2 changes: 1 addition & 1 deletion crates/component-macro/tests/codegen/empty.wit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package foo:foo
package foo:foo;
world empty {}
20 changes: 10 additions & 10 deletions crates/component-macro/tests/codegen/flags.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

interface flegs {
flags flag1 {
Expand Down Expand Up @@ -40,16 +40,16 @@ interface flegs {
b56, b57, b58, b59, b60, b61, b62, b63,
}

roundtrip-flag1: func(x: flag1) -> flag1
roundtrip-flag2: func(x: flag2) -> flag2
roundtrip-flag4: func(x: flag4) -> flag4
roundtrip-flag8: func(x: flag8) -> flag8
roundtrip-flag16: func(x: flag16) -> flag16
roundtrip-flag32: func(x: flag32) -> flag32
roundtrip-flag64: func(x: flag64) -> flag64
roundtrip-flag1: func(x: flag1) -> flag1;
roundtrip-flag2: func(x: flag2) -> flag2;
roundtrip-flag4: func(x: flag4) -> flag4;
roundtrip-flag8: func(x: flag8) -> flag8;
roundtrip-flag16: func(x: flag16) -> flag16;
roundtrip-flag32: func(x: flag32) -> flag32;
roundtrip-flag64: func(x: flag64) -> flag64;
}

world the-flags {
import flegs
export flegs
import flegs;
export flegs;
}
14 changes: 7 additions & 7 deletions crates/component-macro/tests/codegen/floats.wit
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package foo:foo
package foo:foo;

interface floats {
float32-param: func(x: float32)
float64-param: func(x: float64)
float32-result: func() -> float32
float64-result: func() -> float64
float32-param: func(x: float32);
float64-param: func(x: float64);
float32-result: func() -> float32;
float64-result: func() -> float64;
}

world the-world {
import floats
export floats
import floats;
export floats;
}
4 changes: 2 additions & 2 deletions crates/component-macro/tests/codegen/function-new.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;
world foo {
export new: func()
export new: func();
}
42 changes: 21 additions & 21 deletions crates/component-macro/tests/codegen/integers.wit
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package foo:foo
package foo:foo;

interface integers {
a1: func(x: u8)
a2: func(x: s8)
a3: func(x: u16)
a4: func(x: s16)
a5: func(x: u32)
a6: func(x: s32)
a7: func(x: u64)
a8: func(x: s64)
a1: func(x: u8);
a2: func(x: s8);
a3: func(x: u16);
a4: func(x: s16);
a5: func(x: u32);
a6: func(x: s32);
a7: func(x: u64);
a8: func(x: s64);

a9: func(
p1: u8,
Expand All @@ -19,22 +19,22 @@ interface integers {
p6: s32,
p7: u64,
p8: s64,
)
);


r1: func() -> u8
r2: func() -> s8
r3: func() -> u16
r4: func() -> s16
r5: func() -> u32
r6: func() -> s32
r7: func() -> u64
r8: func() -> s64
r1: func() -> u8;
r2: func() -> s8;
r3: func() -> u16;
r4: func() -> s16;
r5: func() -> u32;
r6: func() -> s32;
r7: func() -> u64;
r8: func() -> s64;

pair-ret: func() -> tuple<s64, u8>
pair-ret: func() -> tuple<s64, u8>;
}

world the-world {
import integers
export integers
import integers;
export integers;
}
66 changes: 33 additions & 33 deletions crates/component-macro/tests/codegen/lists.wit
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
package foo:foo
package foo:foo;

interface lists {
list-u8-param: func(x: list<u8>)
list-u16-param: func(x: list<u16>)
list-u32-param: func(x: list<u32>)
list-u64-param: func(x: list<u64>)
list-s8-param: func(x: list<s8>)
list-s16-param: func(x: list<s16>)
list-s32-param: func(x: list<s32>)
list-s64-param: func(x: list<s64>)
list-float32-param: func(x: list<float32>)
list-float64-param: func(x: list<float64>)
list-u8-param: func(x: list<u8>);
list-u16-param: func(x: list<u16>);
list-u32-param: func(x: list<u32>);
list-u64-param: func(x: list<u64>);
list-s8-param: func(x: list<s8>);
list-s16-param: func(x: list<s16>);
list-s32-param: func(x: list<s32>);
list-s64-param: func(x: list<s64>);
list-float32-param: func(x: list<float32>);
list-float64-param: func(x: list<float64>);

list-u8-ret: func() -> list<u8>
list-u16-ret: func() -> list<u16>
list-u32-ret: func() -> list<u32>
list-u64-ret: func() -> list<u64>
list-s8-ret: func() -> list<s8>
list-s16-ret: func() -> list<s16>
list-s32-ret: func() -> list<s32>
list-s64-ret: func() -> list<s64>
list-float32-ret: func() -> list<float32>
list-float64-ret: func() -> list<float64>
list-u8-ret: func() -> list<u8>;
list-u16-ret: func() -> list<u16>;
list-u32-ret: func() -> list<u32>;
list-u64-ret: func() -> list<u64>;
list-s8-ret: func() -> list<s8>;
list-s16-ret: func() -> list<s16>;
list-s32-ret: func() -> list<s32>;
list-s64-ret: func() -> list<s64>;
list-float32-ret: func() -> list<float32>;
list-float64-ret: func() -> list<float64>;

tuple-list: func(x: list<tuple<u8, s8>>) -> list<tuple<s64, u32>>
string-list-arg: func(a: list<string>)
string-list-ret: func() -> list<string>
tuple-string-list: func(x: list<tuple<u8, string>>) -> list<tuple<string, u8>>
string-list: func(x: list<string>) -> list<string>
tuple-list: func(x: list<tuple<u8, s8>>) -> list<tuple<s64, u32>>;
string-list-arg: func(a: list<string>);
string-list-ret: func() -> list<string>;
tuple-string-list: func(x: list<tuple<u8, string>>) -> list<tuple<string, u8>>;
string-list: func(x: list<string>) -> list<string>;

record some-record {
x: string,
Expand All @@ -46,8 +46,8 @@ interface lists {
b: string,
c: list<u8>,
}
record-list: func(x: list<some-record>) -> list<other-record>
record-list-reverse: func(x: list<other-record>) -> list<some-record>
record-list: func(x: list<some-record>) -> list<other-record>;
record-list-reverse: func(x: list<other-record>) -> list<some-record>;

variant some-variant {
a(string),
Expand All @@ -60,7 +60,7 @@ interface lists {
b(u32),
c(string),
}
variant-list: func(x: list<some-variant>) -> list<other-variant>
variant-list: func(x: list<some-variant>) -> list<other-variant>;

type load-store-all-sizes = list<tuple<
string,
Expand All @@ -75,11 +75,11 @@ interface lists {
float32,
float64,
char,
>>
load-store-everything: func(a: load-store-all-sizes) -> load-store-all-sizes
>>;
load-store-everything: func(a: load-store-all-sizes) -> load-store-all-sizes;
}

world the-lists {
import lists
export lists
import lists;
export lists;
}
10 changes: 5 additions & 5 deletions crates/component-macro/tests/codegen/many-arguments.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package foo:foo
package foo:foo;

interface manyarg {
many-args: func(
Expand All @@ -18,7 +18,7 @@ interface manyarg {
a14: u64,
a15: u64,
a16: u64,
)
);

record big-struct {
a1: string,
Expand All @@ -43,10 +43,10 @@ interface manyarg {
a20: string,
}

big-argument: func(x: big-struct)
big-argument: func(x: big-struct);
}

world the-world {
import manyarg
export manyarg
import manyarg;
export manyarg;
}
16 changes: 8 additions & 8 deletions crates/component-macro/tests/codegen/multi-return.wit
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package foo:foo
package foo:foo;

interface multi-return {
mra: func()
mrb: func() -> ()
mrc: func() -> u32
mrd: func() -> (a: u32)
mre: func() -> (a: u32, b: float32)
mra: func();
mrb: func() -> ();
mrc: func() -> u32;
mrd: func() -> (a: u32);
mre: func() -> (a: u32, b: float32);
}

world the-world {
import multi-return
export multi-return
import multi-return;
export multi-return;
}
Loading

0 comments on commit 0bb3407

Please sign in to comment.