summaryrefslogtreecommitdiff
path: root/core/Stream.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 04:16:41 -0300
committerGabriel Schneider <[email protected]>2026-11-20 04:16:41 -0300
commit5b7124d10f9b2db8d1c5e99eacb9b6d2fffff0cc (patch)
treedc50936490ad8636f5431da30ec3aaa38339c936 /core/Stream.zig
parent6e8735895d04c0073eb28cc1a2f431a2ba587e9d (diff)
parent8fb080c6208bccf9ef12eca630b0534312ae5fe7 (diff)
downloadpardes-5b7124d10f9b2db8d1c5e99eacb9b6d2fffff0cc.tar.gz
pardes-5b7124d10f9b2db8d1c5e99eacb9b6d2fffff0cc.zip
integration: the core's calls out to the host go through the tape's handle, on the devices once and the attach that is always a client: pardes-handle-6 (6a, 6b, 6c, 8a: p.tape.host(p, .name, .{ args }) derived from the Host table; Wrap, hostOf and wrap deleted; no line of core/ outside the tape names the host's table, held by root.zig's scan; the tape's bytes unmoved) and pardes-merge30, merged without a textual conflict; tui core-test 857/1008 (151 skipped), shell-test 1048/1051, the window builds; the coordinator's gate in the ledger (reorg/merge31)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Stream.zig')
-rw-r--r--core/Stream.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/Stream.zig b/core/Stream.zig
index 5960d249..6f99b504 100644
--- a/core/Stream.zig
+++ b/core/Stream.zig
@@ -311,7 +311,7 @@ pub fn takeAhead(p: *Pardes, serial: u32, revision: u32, need_start: usize, need
/// workers, and only for a grammar a worker can paint (syntax.readyApart).
pub fn paintAhead(p: *Pardes, serial: u32, revision: u32, path: []const u8, content: []const u8, from: usize, to: usize) void {
const s = &p.stream;
- if (p.host.vtable.search == null or p.fs.serving or to <= from or to > content.len) return;
+ if (!p.tape.has(p, .search) or p.fs.serving or to <= from or to > content.len) return;
const a = s.ahead_for;
if (s.ahead.len != 0 and a.serial == serial and a.revision == revision and from >= a.start and to <= a.start + s.ahead.len) return;
// A stretch bigger than this (a few lines of a minified file) is not
@@ -343,7 +343,7 @@ pub fn paintAhead(p: *Pardes, serial: u32, revision: u32, path: []const u8, cont
pub fn askAhead(p: *Pardes) void {
const gen = p.stream.ahead_ask orelse return;
p.stream.ahead_ask = null;
- if (p.host.vtable.search) |f| f(p.host.ctx, gen);
+ _ = p.tape.host(p, .search, .{gen});
}
/// A file's colours for the query rows that show its lines, the whole
@@ -355,7 +355,7 @@ pub fn askAhead(p: *Pardes) void {
/// one revision of a file.
pub fn paintRows(p: *Pardes, path: []const u8) void {
const s = &p.stream;
- if (s.rows_paint != null or p.host.vtable.search == null) return;
+ if (s.rows_paint != null or !p.tape.has(p, .search)) return;
// Asked while a 9P write is served (a script's Grep): not now, as no
// paint is (the write would wait for it to settle); the next step asks.
if (p.fs.serving) {
@@ -452,7 +452,7 @@ pub fn parseFor(p: *Pardes, id: usize) void {
s.parse_next = .{ .serial = pane.serial, .revision = f.revision };
return;
}
- const workers = p.host.vtable.search != null and !p.fs.serving;
+ const workers = p.tape.has(p, .search) and !p.fs.serving;
if (!workers and f.content.len > 64 << 10) return;
const job = TextJob.make(p.gpa, pane.serial, f.revision, 0, f.path, f.content) orelse return;
s.gen +%= 1;
@@ -559,7 +559,7 @@ pub fn step(p: *Pardes) void {
s.state = .searching;
// A script's write (whose answer says whether it found anything) and a
// host with no workers: done before this returns.
- if (p.host.vtable.search != null and !p.fs.serving) p.emit(.{ .search = .{ .gen = s.gen } }) else runHere(p, s.gen, false);
+ if (p.tape.has(p, .search) and !p.fs.serving) p.emit(.{ .search = .{ .gen = s.gen } }) else runHere(p, s.gen, false);
}
/// When the core next needs a tick for the stream: the end of the pause.