| ... | @@ -106,10 +106,9 @@ fn addOptionFallible(self: *Options, comptime T: type, name: []const u8, value: | ... | @@ -106,10 +106,9 @@ fn addOptionFallible(self: *Options, comptime T: type, name: []const u8, value: |
| 106 | try out.print(" {},\n", .{std.zig.fmtId(field.name)}); | 106 | try out.print(" {},\n", .{std.zig.fmtId(field.name)}); |
| 107 | } | 107 | } |
| 108 | try out.writeAll("};\n"); | 108 | try out.writeAll("};\n"); |
| 109 | try out.print("pub const {}: {s} = {s}.{s};\n", .{ | 109 | try out.print("pub const {}: {s} = .{s};\n", .{ |
| 110 | std.zig.fmtId(name), | 110 | std.zig.fmtId(name), |
| 111 | std.zig.fmtId(@typeName(T)), | 111 | std.zig.fmtId(@typeName(T)), |
| 112 | std.zig.fmtId(@typeName(T)), | | |
| 113 | std.zig.fmtId(@tagName(value)), | 112 | std.zig.fmtId(@tagName(value)), |
| 114 | }); | 113 | }); |
| 115 | return; | 114 | return; |
| ... | @@ -322,10 +321,9 @@ test Options { | ... | @@ -322,10 +321,9 @@ test Options { |
| 322 | | 321 | |
| 323 | const options = builder.addOptions(); | 322 | const options = builder.addOptions(); |
| 324 | | 323 | |
| 325 | // TODO this regressed at some point | 324 | const KeywordEnum = enum { |
| 326 | //const KeywordEnum = enum { | 325 | @"0.8.1", |
| 327 | // @"0.8.1", | 326 | }; |
| 328 | //}; | | |
| 329 | | 327 | |
| 330 | const nested_array = [2][2]u16{ | 328 | const nested_array = [2][2]u16{ |
| 331 | [2]u16{ 300, 200 }, | 329 | [2]u16{ 300, 200 }, |
| ... | @@ -341,7 +339,7 @@ test Options { | ... | @@ -341,7 +339,7 @@ test Options { |
| 341 | options.addOption(?[]const u8, "optional_string", null); | 339 | options.addOption(?[]const u8, "optional_string", null); |
| 342 | options.addOption([2][2]u16, "nested_array", nested_array); | 340 | options.addOption([2][2]u16, "nested_array", nested_array); |
| 343 | options.addOption([]const []const u16, "nested_slice", nested_slice); | 341 | options.addOption([]const []const u16, "nested_slice", nested_slice); |
| 344 | //options.addOption(KeywordEnum, "keyword_enum", .@"0.8.1"); | 342 | options.addOption(KeywordEnum, "keyword_enum", .@"0.8.1"); |
| 345 | options.addOption(std.SemanticVersion, "semantic_version", try std.SemanticVersion.parse("0.1.2-foo+bar")); | 343 | options.addOption(std.SemanticVersion, "semantic_version", try std.SemanticVersion.parse("0.1.2-foo+bar")); |
| 346 | | 344 | |
| 347 | try std.testing.expectEqualStrings( | 345 | try std.testing.expectEqualStrings( |
| ... | @@ -371,10 +369,10 @@ test Options { | ... | @@ -371,10 +369,10 @@ test Options { |
| 371 | \\ 200, | 369 | \\ 200, |
| 372 | \\ }, | 370 | \\ }, |
| 373 | \\}; | 371 | \\}; |
| 374 | //\\pub const KeywordEnum = enum { | 372 | \\pub const @"Build.Step.Options.decltest.Options.KeywordEnum" = enum { |
| 375 | //\\ @"0.8.1", | 373 | \\ @"0.8.1", |
| 376 | //\\}; | 374 | \\}; |
| 377 | //\\pub const keyword_enum: KeywordEnum = KeywordEnum.@"0.8.1"; | 375 | \\pub const keyword_enum: @"Build.Step.Options.decltest.Options.KeywordEnum" = .@"0.8.1"; |
| 378 | \\pub const semantic_version: @import("std").SemanticVersion = .{ | 376 | \\pub const semantic_version: @import("std").SemanticVersion = .{ |
| 379 | \\ .major = 0, | 377 | \\ .major = 0, |
| 380 | \\ .minor = 1, | 378 | \\ .minor = 1, |