From 5de9d27458cd8ff7e326532e8923c933e141ea7f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 9 Nov 2026 03:31:33 -0300 Subject: idioms: swallows a caller can decide on, decided: a key a macro or a repeat cannot keep is said (Macro.append returns error{OutOfMemory}), a kind's found rows and list pane say their copy's failure as their fill's, a kind word's value past its pane's 256-byte record is said instead of dropped, and the REPL ask record's two prints, which fit, are unreachable with the reason Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/exec.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/exec.zig') diff --git a/src/exec.zig b/src/exec.zig index c636cc7c..93f524cf 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -529,8 +529,8 @@ fn routeToRepl(p: *Pardes, from: usize, text: []const u8) Routed { p.view().active = from; var rec: [96]u8 = undefined; var rw = std.Io.Writer.fixed(&rec); - rw.print("{d} repl", .{src.serial}) catch {}; - for (bound[0..n]) |i| rw.print(" {c}", .{p.panes[i].?.repl.?.letter}) catch {}; + rw.print("{d} repl", .{src.serial}) catch unreachable; // a u32 and bound's 26 letters fit 96 + for (bound[0..n]) |i| rw.print(" {c}", .{p.panes[i].?.repl.?.letter}) catch unreachable; pardes.ctlfs.events.notePath(p, "ask", rw.buffered()); return .asked; } @@ -1251,8 +1251,9 @@ pub fn runWord(p: *Pardes, id: usize, w: *const pardes.Kind.Word, line: []const var next: pardes.Kind.Buf(256) = .{}; var out: std.Io.Writer = .fixed(&next.bytes); var lines = std.mem.tokenizeScalar(u8, s.values.slice(), '\n'); - while (lines.next()) |l| if (!std.mem.eql(u8, l[0 .. std.mem.indexOfScalar(u8, l, ' ') orelse l.len], name)) out.print("{s}\n", .{l}) catch return; - out.print("{s} {s}\n", .{ name, arg }) catch return; + const full = std.fmt.bufPrint(&said, "{s}: the pane's values are past {d} bytes: not kept", .{ name, next.bytes.len }) catch name; + while (lines.next()) |l| if (!std.mem.eql(u8, l[0 .. std.mem.indexOfScalar(u8, l, ' ') orelse l.len], name)) out.print("{s}\n", .{l}) catch return p.reportFailure(id, full); + out.print("{s} {s}\n", .{ name, arg }) catch return p.reportFailure(id, full); next.len = @intCast(out.buffered().len); s.values = next; } -- cgit v1.3