From dbff3a5bb1d47e5a348ce7e91073df43b29b3e44 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 22:49:11 -0300 Subject: kinds #51, builtins-json lists the shipped addons' words, read off the Zig kinds' `Word` lines (image.zig and pdf.zig, handed to the generator and read by the staleness test), each `"addon"` first so the docs test's search for a builtin never meets one and an addon word the docs name is checked against the sources (renaming PdfFit fails it); the glossary says whose addon a word is, and the changelog Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- tools/gen_builtins_json.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools/gen_builtins_json.zig') diff --git a/tools/gen_builtins_json.zig b/tools/gen_builtins_json.zig index 3158c8b2..35dc49dc 100644 --- a/tools/gen_builtins_json.zig +++ b/tools/gen_builtins_json.zig @@ -1,14 +1,17 @@ //! Writes every builtin as JSON to the path given (docs/typ/builtins-.json, -//! by way of `zig build builtins-json`). +//! by way of `zig build builtins-json`), then the words of the addons whose +//! sources follow it (builtins_json.addons, in that order). const std = @import("std"); const pardes = @import("pardes"); pub fn main(init: std.process.Init) !void { const args = try init.minimal.args.toSlice(init.arena.allocator()); + var sources: [pardes.builtins_json.addons.len][]const u8 = undefined; + for (&sources, args[2..][0..sources.len]) |*source, path| source.* = try std.Io.Dir.cwd().readFileAlloc(init.io, path, init.arena.allocator(), .limited(1 << 20)); var file = try std.Io.Dir.cwd().createFile(init.io, args[1], .{}); defer file.close(init.io); var buf: [4096]u8 = undefined; var w = file.writer(init.io, &buf); - try pardes.builtins_json.write(&w.interface); + try pardes.builtins_json.write(&w.interface, &sources); try w.interface.flush(); } -- cgit v1.3