From 98f84f99e79cccc2344aff2efe10823540d0c7b7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 03:06:49 -0300 Subject: plain: the records the core and the terminal both name, a leaf module (docs/next-terminal.md, Phase 1, its first step): src/plain/plain.zig takes Color, FontRole, CellStyle, Cell, RectPx, RectCell, Raster and Placement from surface.zig and Key from Event.zig, moved as they are, and imports std alone; surface.zig and Event.zig re-export them under their old names, so no caller changes; src/term/'s files name them through `plain` (pager.zig and TerminalImages.zig no longer reach surface.zig); build.zig's wireCore gives every core module the `plain` import; locations.Row stays (it names look.Spot and walk's digest: not free); core-test 985 of 985, lib-test --- build.zig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 903b7ea8..f59d1928 100644 --- a/build.zig +++ b/build.zig @@ -836,7 +836,10 @@ pub fn build(b: *std.Build) void { image_mod.addCSourceFile(.{ .file = b.path("addons/image/stb.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" } }); const image_addon = b.addLibrary(.{ .name = "image", .linkage = .dynamic, .root_module = image_mod }); for (builtin_mods) |m| m.addImport("image_addon", image_mod); + // The records the core and the terminal both name (src/plain/plain.zig). + const plain_mod = b.createModule(.{ .root_source_file = b.path("src/plain/plain.zig"), .target = target, .optimize = optimize }); for (core_mods) |m| wireCore(m, .{ + .plain = plain_mod, .kind = kind_mod, .themes = themes_mod, .tree_sitter = ts_mod, @@ -2188,6 +2191,7 @@ fn library(b: *std.Build) void { } fn wireCore(m: *std.Build.Module, d: struct { + plain: ?*std.Build.Module = null, kind: ?*std.Build.Module = null, themes: ?*std.Build.Module = null, tree_sitter: ?*std.Build.Module = null, @@ -2202,6 +2206,7 @@ fn wireCore(m: *std.Build.Module, d: struct { wuffs: ?*std.Build.Module = null, xitdb: ?*std.Build.Module = null, }) void { + if (d.plain) |x| m.addImport("plain", x); if (d.kind) |x| m.addImport("pardes_addon", x); if (d.themes) |x| m.addImport("generated_themes", x); if (d.tree_sitter) |x| m.addImport("tree-sitter", x); -- cgit v1.3