aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Step/Options.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-08-28 10:49:31 -0700
committerGitHub <noreply@github.com>2024-08-28 10:49:31 -0700
commit31fef6f1103ea64a899729adea13b0ab9b66cb46 (patch)
tree31c13b06483af84cd0977be8de00d3539e3e3c4d /lib/std/Build/Step/Options.zig
parent9a12905a2da045b0948f612583b526bca3a1b2f0 (diff)
parentaaa7e739831f39151a37c7beb08660f0fb6ae0ed (diff)
downloadzig-31fef6f1103ea64a899729adea13b0ab9b66cb46.tar.gz
zig-31fef6f1103ea64a899729adea13b0ab9b66cb46.zip
Merge pull request #21225 from mlugg/std-builtin-type
std: update `std.builtin.Type` fields to follow naming conventions
Diffstat (limited to 'lib/std/Build/Step/Options.zig')
-rw-r--r--lib/std/Build/Step/Options.zig34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/std/Build/Step/Options.zig b/lib/std/Build/Step/Options.zig
index 6131912b1b..41739dba47 100644
--- a/lib/std/Build/Step/Options.zig
+++ b/lib/std/Build/Step/Options.zig
@@ -151,7 +151,7 @@ fn printType(options: *Options, out: anytype, comptime T: type, value: T, indent
}
switch (@typeInfo(T)) {
- .Array => {
+ .array => {
if (name) |some| {
try out.print("pub const {}: {s} = ", .{ std.zig.fmtId(some), @typeName(T) });
}
@@ -171,7 +171,7 @@ fn printType(options: *Options, out: anytype, comptime T: type, value: T, indent
}
return;
},
- .Pointer => |p| {
+ .pointer => |p| {
if (p.size != .Slice) {
@compileError("Non-slice pointers are not yet supported in build options");
}
@@ -195,7 +195,7 @@ fn printType(options: *Options, out: anytype, comptime T: type, value: T, indent
}
return;
},
- .Optional => {
+ .optional => {
if (name) |some| {
try out.print("pub const {}: {s} = ", .{ std.zig.fmtId(some), @typeName(T) });
}
@@ -216,12 +216,12 @@ fn printType(options: *Options, out: anytype, comptime T: type, value: T, indent
}
return;
},
- .Void,
- .Bool,
- .Int,
- .ComptimeInt,
- .Float,
- .Null,
+ .void,
+ .bool,
+ .int,
+ .comptime_int,
+ .float,
+ .null,
=> {
if (name) |some| {
try out.print("pub const {}: {s} = {any};\n", .{ std.zig.fmtId(some), @typeName(T), value });
@@ -230,7 +230,7 @@ fn printType(options: *Options, out: anytype, comptime T: type, value: T, indent
}
return;
},
- .Enum => |info| {
+ .@"enum" => |info| {
try printEnum(options, out, T, info, indent);
if (name) |some| {
@@ -242,7 +242,7 @@ fn printType(options: *Options, out: anytype, comptime T: type, value: T, indent
}
return;
},
- .Struct => |info| {
+ .@"struct" => |info| {
try printStruct(options, out, T, info, indent);
if (name) |some| {
@@ -260,10 +260,10 @@ fn printType(options: *Options, out: anytype, comptime T: type, value: T, indent
fn printUserDefinedType(options: *Options, out: anytype, comptime T: type, indent: u8) !void {
switch (@typeInfo(T)) {
- .Enum => |info| {
+ .@"enum" => |info| {
return try printEnum(options, out, T, info, indent);
},
- .Struct => |info| {
+ .@"struct" => |info| {
return try printStruct(options, out, T, info, indent);
},
else => {},
@@ -323,8 +323,8 @@ fn printStruct(options: *Options, out: anytype, comptime T: type, comptime val:
try out.writeAll(" = ");
switch (@typeInfo(@TypeOf(default_value))) {
- .Enum => try out.print(".{s},\n", .{@tagName(default_value)}),
- .Struct => |info| {
+ .@"enum" => try out.print(".{s},\n", .{@tagName(default_value)}),
+ .@"struct" => |info| {
try printStructValue(options, out, info, default_value, indent + 4);
},
else => try printType(options, out, @TypeOf(default_value), default_value, indent, null),
@@ -359,8 +359,8 @@ fn printStructValue(options: *Options, out: anytype, comptime struct_val: std.bu
const field_name = @field(val, field.name);
switch (@typeInfo(@TypeOf(field_name))) {
- .Enum => try out.print(".{s},\n", .{@tagName(field_name)}),
- .Struct => |struct_info| {
+ .@"enum" => try out.print(".{s},\n", .{@tagName(field_name)}),
+ .@"struct" => |struct_info| {
try printStructValue(options, out, struct_info, field_name, indent + 4);
},
else => try printType(options, out, @TypeOf(field_name), field_name, indent, null),