Skip to content

Commit 1ea8a6d

Browse files
authored
wit syntax: require semicolons (#51)
* wit-deps update no functional changes, just adding semicolons * wits: add semicolons as statement separator * CI: use wit-abi-up-to-date@v16, which requires semicolons
1 parent 30af301 commit 1ea8a6d

File tree

9 files changed

+42
-42
lines changed

9 files changed

+42
-42
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
./wit-deps lock
1919
git add -N wit/deps
2020
git diff --exit-code
21-
- uses: WebAssembly/wit-abi-up-to-date@v15
21+
- uses: WebAssembly/wit-abi-up-to-date@v16

wit/deps.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[io]
22
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
3-
sha256 = "6e20bcf4d4f5466b60c05ea8da7289ca361a7febdd22ab1a531e5ef7e394ab8d"
4-
sha512 = "21f6689bce6ed6d9e3bd96372e5c7ed003a7aefbf8d49b4eea949dfbd265cf57a0d7dc67aa71e3de75d48fcc2c0cfe5f06f7e9e7959a23bc98f77da85f4161b9"
3+
sha256 = "a00c29dd57dc224e8ce28b793b19c1b1001dcdbdc229ed451c3df1db91841b34"
4+
sha512 = "8558085eeb5689209101cdfbc9782953d559ad14ce77260fe2f7cc472482d568f65cad9e6a688d40c634c6c54c608f27e27e481633446114d6fdead93d4e34c5"

wit/deps/io/poll.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package wasi:io
1+
package wasi:io;
22

33
/// A poll API intended to let users wait for I/O events on multiple handles
44
/// at once.
55
interface poll {
66
/// A "pollable" handle.
7-
resource pollable
7+
resource pollable;
88

99
/// Poll for completion on a set of pollables.
1010
///
@@ -24,11 +24,11 @@ interface poll {
2424
/// do any I/O so it doesn't fail. If any of the I/O sources identified by
2525
/// the pollables has an error, it is indicated by marking the source as
2626
/// being reaedy for I/O.
27-
poll-list: func(in: list<borrow<pollable>>) -> list<u32>
27+
poll-list: func(in: list<borrow<pollable>>) -> list<u32>;
2828

2929
/// Poll for completion on a single pollable.
3030
///
3131
/// This function is similar to `poll-list`, but operates on only a single
3232
/// pollable. When it returns, the handle is ready for I/O.
33-
poll-one: func(in: borrow<pollable>)
33+
poll-one: func(in: borrow<pollable>);
3434
}

wit/deps/io/streams.wit

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package wasi:io
1+
package wasi:io;
22

33
/// WASI I/O is an I/O abstraction API which is currently focused on providing
44
/// stream types.
55
///
66
/// In the future, the component model is expected to add built-in stream types;
77
/// when it does, they are expected to subsume this API.
88
interface streams {
9-
use poll.{pollable}
9+
use poll.{pollable};
1010

1111
/// Streams provide a sequence of data and then end; once they end, they
1212
/// no longer provide any further data.
@@ -58,14 +58,14 @@ interface streams {
5858
read: func(
5959
/// The maximum number of bytes to read
6060
len: u64
61-
) -> result<tuple<list<u8>, stream-status>>
61+
) -> result<tuple<list<u8>, stream-status>>;
6262

6363
/// Read bytes from a stream, after blocking until at least one byte can
6464
/// be read. Except for blocking, identical to `read`.
6565
blocking-read: func(
6666
/// The maximum number of bytes to read
6767
len: u64
68-
) -> result<tuple<list<u8>, stream-status>>
68+
) -> result<tuple<list<u8>, stream-status>>;
6969

7070
/// Skip bytes from a stream.
7171
///
@@ -82,22 +82,22 @@ interface streams {
8282
skip: func(
8383
/// The maximum number of bytes to skip.
8484
len: u64,
85-
) -> result<tuple<u64, stream-status>>
85+
) -> result<tuple<u64, stream-status>>;
8686

8787
/// Skip bytes from a stream, after blocking until at least one byte
8888
/// can be skipped. Except for blocking behavior, identical to `skip`.
8989
blocking-skip: func(
9090
/// The maximum number of bytes to skip.
9191
len: u64,
92-
) -> result<tuple<u64, stream-status>>
92+
) -> result<tuple<u64, stream-status>>;
9393

9494
/// Create a `pollable` which will resolve once either the specified stream
9595
/// has bytes available to read or the other end of the stream has been
9696
/// closed.
9797
/// The created `pollable` is a child resource of the `input-stream`.
9898
/// Implementations may trap if the `input-stream` is dropped before
9999
/// all derived `pollable`s created with this function are dropped.
100-
subscribe: func() -> pollable
100+
subscribe: func() -> pollable;
101101
}
102102

103103
/// An error for output-stream operations.
@@ -131,7 +131,7 @@ interface streams {
131131
/// When this function returns 0 bytes, the `subscribe` pollable will
132132
/// become ready when this function will report at least 1 byte, or an
133133
/// error.
134-
check-write: func() -> result<u64, write-error>
134+
check-write: func() -> result<u64, write-error>;
135135

136136
/// Perform a write. This function never blocks.
137137
///
@@ -142,7 +142,7 @@ interface streams {
142142
/// the last call to check-write provided a permit.
143143
write: func(
144144
contents: list<u8>
145-
) -> result<_, write-error>
145+
) -> result<_, write-error>;
146146

147147
/// Perform a write of up to 4096 bytes, and then flush the stream. Block
148148
/// until all of these operations are complete, or an error occurs.
@@ -170,7 +170,7 @@ interface streams {
170170
/// ```
171171
blocking-write-and-flush: func(
172172
contents: list<u8>
173-
) -> result<_, write-error>
173+
) -> result<_, write-error>;
174174

175175
/// Request to flush buffered output. This function never blocks.
176176
///
@@ -182,11 +182,11 @@ interface streams {
182182
/// writes (`check-write` will return `ok(0)`) until the flush has
183183
/// completed. The `subscribe` pollable will become ready when the
184184
/// flush has completed and the stream can accept more writes.
185-
flush: func() -> result<_, write-error>
185+
flush: func() -> result<_, write-error>;
186186

187187
/// Request to flush buffered output, and block until flush completes
188188
/// and stream is ready for writing again.
189-
blocking-flush: func() -> result<_, write-error>
189+
blocking-flush: func() -> result<_, write-error>;
190190

191191
/// Create a `pollable` which will resolve once the output-stream
192192
/// is ready for more writing, or an error has occured. When this
@@ -198,7 +198,7 @@ interface streams {
198198
/// The created `pollable` is a child resource of the `output-stream`.
199199
/// Implementations may trap if the `output-stream` is dropped before
200200
/// all derived `pollable`s created with this function are dropped.
201-
subscribe: func() -> pollable
201+
subscribe: func() -> pollable;
202202

203203
/// Write zeroes to a stream.
204204
///
@@ -209,7 +209,7 @@ interface streams {
209209
write-zeroes: func(
210210
/// The number of zero-bytes to write
211211
len: u64
212-
) -> result<_, write-error>
212+
) -> result<_, write-error>;
213213

214214
/// Perform a write of up to 4096 zeroes, and then flush the stream.
215215
/// Block until all of these operations are complete, or an error
@@ -238,7 +238,7 @@ interface streams {
238238
blocking-write-zeroes-and-flush: func(
239239
/// The number of zero-bytes to write
240240
len: u64
241-
) -> result<_, write-error>
241+
) -> result<_, write-error>;
242242

243243
/// Read from one stream and write to another.
244244
///
@@ -252,7 +252,7 @@ interface streams {
252252
src: input-stream,
253253
/// The number of bytes to splice
254254
len: u64,
255-
) -> result<tuple<u64, stream-status>>
255+
) -> result<tuple<u64, stream-status>>;
256256

257257
/// Read from one stream and write to another, with blocking.
258258
///
@@ -263,7 +263,7 @@ interface streams {
263263
src: input-stream,
264264
/// The number of bytes to splice
265265
len: u64,
266-
) -> result<tuple<u64, stream-status>>
266+
) -> result<tuple<u64, stream-status>>;
267267

268268
/// Forward the entire contents of an input stream to an output stream.
269269
///
@@ -280,6 +280,6 @@ interface streams {
280280
forward: func(
281281
/// The stream to read from
282282
src: input-stream
283-
) -> result<tuple<u64, stream-status>>
283+
) -> result<tuple<u64, stream-status>>;
284284
}
285285
}

wit/deps/io/world.wit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package wasi:io
1+
package wasi:io;
22

33
world imports {
4-
import streams
5-
import poll
4+
import streams;
5+
import poll;
66
}

wit/monotonic-clock.wit

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
///
1010
/// It is intended for measuring elapsed time.
1111
interface monotonic-clock {
12-
use wasi:io/poll.{pollable}
12+
use wasi:io/poll.{pollable};
1313

1414
/// A timestamp in nanoseconds.
15-
type instant = u64
15+
type instant = u64;
1616

1717
/// Read the current value of the clock.
1818
///
1919
/// The clock is monotonic, therefore calling this function repeatedly will
2020
/// produce a sequence of non-decreasing values.
21-
now: func() -> instant
21+
now: func() -> instant;
2222

2323
/// Query the resolution of the clock.
24-
resolution: func() -> instant
24+
resolution: func() -> instant;
2525

2626
/// Create a `pollable` which will resolve once the specified time has been
2727
/// reached.
2828
subscribe: func(
2929
when: instant,
3030
absolute: bool
31-
) -> pollable
31+
) -> pollable;
3232
}

wit/timezone.wit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
interface timezone {
2-
use wall-clock.{datetime}
2+
use wall-clock.{datetime};
33

44
/// Return information needed to display the given `datetime`. This includes
55
/// the UTC offset, the time zone name, and a flag indicating whether
@@ -8,10 +8,10 @@ interface timezone {
88
/// If the timezone cannot be determined for the given `datetime`, return a
99
/// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight
1010
/// saving time.
11-
display: func(when: datetime) -> timezone-display
11+
display: func(when: datetime) -> timezone-display;
1212

1313
/// The same as `display`, but only return the UTC offset.
14-
utc-offset: func(when: datetime) -> s32
14+
utc-offset: func(when: datetime) -> s32;
1515

1616
/// Information useful for displaying the timezone of a specific `datetime`.
1717
///

wit/wall-clock.wit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ interface wall-clock {
3232
///
3333
/// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16
3434
/// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time
35-
now: func() -> datetime
35+
now: func() -> datetime;
3636

3737
/// Query the resolution of the clock.
3838
///
3939
/// The nanoseconds field of the output is always less than 1000000000.
40-
resolution: func() -> datetime
40+
resolution: func() -> datetime;
4141
}

wit/world.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package wasi:clocks
1+
package wasi:clocks;
22

33
world imports {
4-
import monotonic-clock
5-
import wall-clock
6-
import timezone
4+
import monotonic-clock;
5+
import wall-clock;
6+
import timezone;
77
}

0 commit comments

Comments
 (0)