Skip to content

Commit 38b91e3

Browse files
committed
Update to latest Zig version (post-writergate)
1 parent cacf1d3 commit 38b91e3

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<img align="right" width="160" height="160" src="https://user-images.githubusercontent.com/34946442/152222895-9c8adb22-a22d-4bce-a513-3486ca28bdd5.png"> zig**fsm** is a [finite state machine](https://en.wikipedia.org/wiki/Finite-state_machine) library for Zig.
22

3-
This library supports Zig 0.12.x, 0.13, 0.14, as well as Zig master. Last test was on Zig version `0.15.0-dev.11+5c57e90ff`
3+
This library supports Zig 0.12.x, 0.13, 0.14, as well as Zig master. Last test was on Zig version `0.15.0-dev.1018+1a998886c`
44

55
Use the zigfsm main branch to compile with Zig master. Use the appropriate zig-*version* tag to target a Zig version not compatible with the main branch.
66

src/benchmark.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ pub fn main() !void {
4242
const elapsed_microsec = @as(f64, @floatFromInt(end - start)) / 1000;
4343
const rate = @as(f64, changes_per_iteration) * @as(f64, @floatFromInt(iterations)) / elapsed_microsec;
4444

45-
try std.io.getStdOut().writer().print("{d:.2} transitions per µs ({d:.2} nanoseconds on avg. per transition)\n", .{ rate, 1000 / rate });
45+
std.debug.print("{d:.2} transitions per µs ({d:.2} nanoseconds on avg. per transition)\n", .{ rate, 1000 / rate });
4646
}

src/main.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ pub const Interface = struct {
663663
/// An enum generator useful for testing, as well as state machines with sequenced states or events.
664664
/// If `prefix` is an empty string, use @"0", @"1", etc to refer to the enum field.
665665
pub fn GenerateConsecutiveEnum(comptime prefix: []const u8, comptime element_count: usize) type {
666+
@setEvalBranchQuota(100_000);
666667
var fields: []const EnumField = &[_]EnumField{};
667668

668669
for (0..element_count) |i| {

src/tests.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ test "csv parser" {
248248
const input = reader.readByte() catch {
249249
// An example of how to handle parsing errors
250250
_ = self.fsm.do(.eof) catch {
251-
try std.io.getStdErr().writer().print("Unexpected end of stream\n", .{});
251+
std.debug.print("Unexpected end of stream\n", .{});
252252
};
253253
return;
254254
};
@@ -376,7 +376,7 @@ test "csv parser, without handler callback" {
376376
const input = reader.readByte() catch {
377377
// An example of how to handle parsing errors
378378
_ = self.fsm.do(.eof) catch {
379-
try std.io.getStdErr().writer().print("Unexpected end of stream\n", .{});
379+
std.debug.print("Unexpected end of stream\n", .{});
380380
};
381381
return;
382382
};

0 commit comments

Comments
 (0)