summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-21 14:35:15 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commitbc3d18d27f9fc1155db7fac3946c4d38774f9e65 (patch)
tree9178ce95952797f8a78b16c2b805e53368efb35a /src/builtins.zig
parent1ecb9b720840ea8e4753823fa8cddcf5d6a3a4d2 (diff)
downloadpardes-bc3d18d27f9fc1155db7fac3946c4d38774f9e65.tar.gz
pardes-bc3d18d27f9fc1155db7fac3946c4d38774f9e65.zip
Build with Zig 0.17
ghostty, libvaxis and uucode move to ghostty's 0.17 pins, cloud9 to its 0.17 main, SDL to castholm's release-3.4.x (3.4.18), zstbi and tree-sitter to forks with 0.17 build files (see build.zig.zon). A bare zig build copies the binaries into ~/.local/bin (-Dhome-install=false leaves it out): 0.17 keeps the prefix from build scripts. A terminal's edited copy goes when the program clears the screen. tinywin.snap is gone; perf baselines are re-recorded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index f73c5982..d9cef8c9 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -98,11 +98,11 @@ fn isEnabled(comptime T: type) bool {
/// word that is one here, or in no build.
pub fn absentWhy(name: []const u8) ?[]const u8 {
@setEvalBranchQuota(20000);
- inline for (@typeInfo(@This()).@"struct".decls) |d| {
- if (comptime @TypeOf(@field(@This(), d.name)) == type) {
- const T = @field(@This(), d.name);
+ inline for (@typeInfo(@This()).@"struct".decl_names) |d| {
+ if (comptime @TypeOf(@field(@This(), d)) == type) {
+ const T = @field(@This(), d);
if (comptime @typeInfo(T) == .@"struct" and @hasDecl(T, "run") and !isEnabled(T)) {
- if (std.mem.eql(u8, d.name, name)) return if (@hasDecl(T, "gui_only")) "GUI-only" else "not in this build";
+ if (std.mem.eql(u8, d, name)) return if (@hasDecl(T, "gui_only")) "GUI-only" else "not in this build";
}
}
}
@@ -112,12 +112,12 @@ pub fn absentWhy(name: []const u8) ?[]const u8 {
fn manualBuiltinCount() comptime_int {
comptime {
var count = 0;
- for (@typeInfo(@This()).@"struct".decls) |d| {
- if (@TypeOf(@field(@This(), d.name)) != type) continue;
- const T = @field(@This(), d.name);
+ for (@typeInfo(@This()).@"struct".decl_names) |d| {
+ if (@TypeOf(@field(@This(), d)) != type) continue;
+ const T = @field(@This(), d);
if (@typeInfo(T) != .@"struct" or !@hasDecl(T, "run") or !isEnabled(T)) continue;
if (@TypeOf(T.run) != fn (Ctx) void)
- @compileError(d.name ++ ".run must have signature fn (Ctx) void");
+ @compileError(d ++ ".run must have signature fn (Ctx) void");
count += 1;
}
return count;
@@ -129,9 +129,9 @@ fn manualBuiltinList() [manualBuiltinCount()]type {
@setEvalBranchQuota(4000);
var list: [manualBuiltinCount()]type = undefined;
var count = 0;
- for (@typeInfo(@This()).@"struct".decls) |d| {
- if (@TypeOf(@field(@This(), d.name)) != type) continue;
- const T = @field(@This(), d.name);
+ for (@typeInfo(@This()).@"struct".decl_names) |d| {
+ if (@TypeOf(@field(@This(), d)) != type) continue;
+ const T = @field(@This(), d);
if (@typeInfo(T) != .@"struct" or !@hasDecl(T, "run") or !isEnabled(T)) continue;
list[count] = T;
count += 1;
@@ -317,7 +317,7 @@ test "Exit over a ctl write or a click names every pane it asks about, a second
first.file.?.saved_hash = 0; // edited: what it had is not what it has
p.newScratchBelow(p.active);
const second = p.panes[p.active].?;
- panes.File.setContent(p, &second.file.?, try std.testing.allocator.dupe(u8, "x" ** 120));
+ panes.File.setContent(p, &second.file.?, try std.testing.allocator.dupe(u8, &@as([120]u8, @splat('x'))));
try std.testing.expect(second.file.?.revision != second.file.?.saved_revision);
// A ctl write, or a click through exec (ctl.captured).
if (clicked) p.fs.capturing = true else p.fs.no_prompt = true;
@@ -341,7 +341,7 @@ test "Exit over a ctl write or a click names every pane it asks about, a second
try std.testing.expect(noticed);
// Edited since: only that one is named again (acme's rule).
p.fs.failure_len = 0;
- panes.File.setContent(p, &second.file.?, try std.testing.allocator.dupe(u8, "y" ** 120));
+ panes.File.setContent(p, &second.file.?, try std.testing.allocator.dupe(u8, &@as([120]u8, @splat('y'))));
try std.testing.expect(p.executeBuiltinLine(p.active, "Exit"));
try std.testing.expect(!p.quit);
const again = p.fs.failure[0..p.fs.failure_len];