diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-09 03:31:33 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-09 03:31:33 -0300 |
| commit | 5de9d27458cd8ff7e326532e8923c933e141ea7f (patch) | |
| tree | 4b6f63dcfbeea1c4727c6790522c645e082ed150 /src/exec.zig | |
| parent | 396791f7ca7a03d1cb58a9db35d4d4314ee0c6e9 (diff) | |
| download | pardes-5de9d27458cd8ff7e326532e8923c933e141ea7f.tar.gz pardes-5de9d27458cd8ff7e326532e8923c933e141ea7f.zip | |
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 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 9 |
1 files changed, 5 insertions, 4 deletions
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; } |
