summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-21 17:25:52 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commit23518c9d7c061f8a06f6632da8b64b37801b514f (patch)
tree1f9688a5c2b2c224f47dd538ffab275b1f54da5c /src/builtins.zig
parentbc3d18d27f9fc1155db7fac3946c4d38774f9e65 (diff)
downloadpardes-23518c9d7c061f8a06f6632da8b64b37801b514f.tar.gz
pardes-23518c9d7c061f8a06f6632da8b64b37801b514f.zip
zig fmt for Zig 0.17
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index d9cef8c9..83966228 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -199,7 +199,7 @@ pub const registry = struct {
pub fn takesArg(b: Builtin()) bool {
inline for (manualBuiltinList(), 0..) |T, i|
- if (@intFromEnum(b) == i) return @hasDecl(T, "takes_arg") and T.takes_arg;
+ if (@backingInt(b) == i) return @hasDecl(T, "takes_arg") and T.takes_arg;
// Every setting takes its value, and a switch flips when bare.
return true;
}
@@ -210,7 +210,7 @@ pub const registry = struct {
/// may be in (`Dump+2024.zon` is a name, not Dump's argument).
pub fn plusArg(b: Builtin()) bool {
inline for (manualBuiltinList(), 0..) |T, i|
- if (@intFromEnum(b) == i) return @hasDecl(T, "plus_arg") and T.plus_arg;
+ if (@backingInt(b) == i) return @hasDecl(T, "plus_arg") and T.plus_arg;
return false;
}
@@ -223,15 +223,15 @@ pub const registry = struct {
/// pane it is refused (exec.runBuiltinFrom), as Repl and Edit are.
pub fn needs(b: Builtin()) ?PaneKind {
inline for (manualBuiltinList(), 0..) |T, i|
- if (@intFromEnum(b) == i) return if (@hasDecl(T, "needs")) T.needs else null;
+ if (@backingInt(b) == i) return if (@hasDecl(T, "needs")) T.needs else null;
return null;
}
pub fn requiresArg(b: Builtin()) bool {
inline for (manualBuiltinList(), 0..) |T, i|
- if (@intFromEnum(b) == i) return @hasDecl(T, "requires_arg") and T.requires_arg;
+ if (@backingInt(b) == i) return @hasDecl(T, "requires_arg") and T.requires_arg;
inline for (comptime settingList(), manualBuiltinCount()..) |setting, i|
- if (@intFromEnum(b) == i) return switch (setting.action) {
+ if (@backingInt(b) == i) return switch (setting.action) {
// a switch flips bare, a choice steps, and DumpDir and Shell bare
// are the default
.toggle, .transition, .scene, .dump_dir, .choice, .lift, .shader_animation, .motion, .shell => false,
@@ -244,15 +244,15 @@ pub const registry = struct {
pub fn scope(b: Builtin()) Scope {
inline for (manualBuiltinList(), 0..) |T, i|
- if (@intFromEnum(b) == i) return if (@hasDecl(T, "scope")) T.scope else .pane;
+ if (@backingInt(b) == i) return if (@hasDecl(T, "scope")) T.scope else .pane;
return .session; // a setting
}
pub fn outputTraits(b: Builtin()) ?OutputTraits {
inline for (manualBuiltinList(), 0..) |T, i|
- if (@intFromEnum(b) == i) return if (@hasDecl(T, "output")) T.output else null;
+ if (@backingInt(b) == i) return if (@hasDecl(T, "output")) T.output else null;
inline for (comptime settingList(), manualBuiltinCount()..) |_, i|
- if (@intFromEnum(b) == i) return null;
+ if (@backingInt(b) == i) return null;
unreachable;
}
@@ -260,15 +260,15 @@ pub const registry = struct {
/// The ones that own that row themselves declare `quiet` and do not.
pub fn announces(b: Builtin()) bool {
inline for (manualBuiltinList(), 0..) |T, i|
- if (@intFromEnum(b) == i) return !(@hasDecl(T, "quiet") and T.quiet);
+ if (@backingInt(b) == i) return !(@hasDecl(T, "quiet") and T.quiet);
return true; // a setting builtin changes something invisible; say so
}
pub fn dispatch(b: Builtin(), c: Ctx) void {
inline for (manualBuiltinList(), 0..) |T, i|
- if (@intFromEnum(b) == i) return T.run(c);
+ if (@backingInt(b) == i) return T.run(c);
inline for (comptime settingList(), manualBuiltinCount()..) |setting, i|
- if (@intFromEnum(b) == i) return exec.applySettingBuiltin(c.p, setting, c.arg);
+ if (@backingInt(b) == i) return exec.applySettingBuiltin(c.p, setting, c.arg);
unreachable;
}
};