From c57c205672f5338a4c76c5d0d7bfd3120b54b79c Mon Sep 17 00:00:00 2001 From: Qwerasd Date: Mon, 29 Sep 2025 11:17:29 -0600 Subject: [PATCH] fix test failures Very weird failures, not 100% sure of the cause; regardless, this fixes them. --- src/terminal/Parser.zig | 2 +- src/terminal/stream.zig | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/terminal/Parser.zig b/src/terminal/Parser.zig index 61ac4e312..05cbe7957 100644 --- a/src/terminal/Parser.zig +++ b/src/terminal/Parser.zig @@ -254,7 +254,7 @@ pub fn deinit(self: *Parser) void { /// Next consumes the next character c and returns the actions to execute. /// Up to 3 actions may need to be executed -- in order -- representing /// the state exit, transition, and entry actions. -pub inline fn next(self: *Parser, c: u8) [3]?Action { +pub fn next(self: *Parser, c: u8) [3]?Action { const effect = table[c][@intFromEnum(self.state)]; // log.info("next: {x}", .{c}); diff --git a/src/terminal/stream.zig b/src/terminal/stream.zig index 539807b44..db43aae47 100644 --- a/src/terminal/stream.zig +++ b/src/terminal/stream.zig @@ -278,7 +278,14 @@ pub fn Stream(comptime Handler: type) type { return; } - const actions = self.parser.next(c); + // We explicitly inline this call here for performance reasons. + // + // We do this rather than mark Parser.next as inline because doing + // that causes weird behavior in some tests- I'm not sure if they + // miscompile or it's just very counter-intuitive comptime stuff, + // but regardless, this is the easy solution. + const actions = @call(.always_inline, Parser.next, .{ &self.parser, c }); + for (actions) |action_opt| { const action = action_opt orelse continue; if (comptime debug) log.info("action: {}", .{action});