aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDave Gauer <ratfactor@gmail.com>2021-05-25 11:50:12 -0400
committerGitHub <noreply@github.com>2021-05-25 11:50:12 -0400
commit58daa603a447f1757c92ece65b0cf83f4449c9ae (patch)
tree65be352408996b76871b0a747dd0d115c7a8baac
parent7ef800c1bfd52e020d0724fb8d57e4820a671de5 (diff)
parent433202d429b781d7b9dcada16c47c29314b9a08d (diff)
Merge pull request #56 from g-w1/sus
change `suspend;` to `suspend {}`
-rw-r--r--exercises/084_async.zig4
-rw-r--r--exercises/085_async2.zig4
-rw-r--r--exercises/086_async3.zig2
-rw-r--r--patches/patches/087_async4.patch2
4 files changed, 6 insertions, 6 deletions
diff --git a/exercises/084_async.zig b/exercises/084_async.zig
index fe68b03..6a67907 100644
--- a/exercises/084_async.zig
+++ b/exercises/084_async.zig
@@ -21,7 +21,7 @@
// functions.
//
// fn fooThatSuspends() void {
-// suspend; // return control, but leave the frame alone
+// suspend {} // return control, but leave the frame alone
// }
//
// 4. To call any function in async context and get a reference
@@ -51,6 +51,6 @@ pub fn main() void {
fn foo() void {
print("foo() A\n", .{});
- suspend;
+ suspend {}
print("foo() B\n", .{});
}
diff --git a/exercises/085_async2.zig b/exercises/085_async2.zig
index 0ca322e..cec5c2b 100644
--- a/exercises/085_async2.zig
+++ b/exercises/085_async2.zig
@@ -7,7 +7,7 @@
// async function invocation's frame and returns control to it.
//
// fn fooThatSuspends() void {
-// suspend;
+// suspend {}
// }
//
// var foo_frame = async fooThatSuspends();
@@ -23,7 +23,7 @@ pub fn main() void {
fn foo() void {
print("Hello ", .{});
- suspend;
+ suspend {}
print("async!\n", .{});
}
diff --git a/exercises/086_async3.zig b/exercises/086_async3.zig
index ae5a9a6..c8f1113 100644
--- a/exercises/086_async3.zig
+++ b/exercises/086_async3.zig
@@ -24,6 +24,6 @@ fn foo(countdown: u32) void {
while (current > 0) {
print("{} ", .{current});
current -= 1;
- suspend;
+ suspend {}
}
}
diff --git a/patches/patches/087_async4.patch b/patches/patches/087_async4.patch
index 9ea5012..3aec891 100644
--- a/patches/patches/087_async4.patch
+++ b/patches/patches/087_async4.patch
@@ -7,4 +7,4 @@
< ???
---
> global_counter += 1;
-> suspend;
+> suspend {}