Merge branch 'main' into main

This commit is contained in:
Chris Boesch 2026-03-20 19:13:22 +01:00
commit 9f6092aea6

View File

@ -72,6 +72,9 @@ pub const Exercise = struct {
/// This exercise is not supported by the current Zig compiler. /// This exercise is not supported by the current Zig compiler.
skip: bool = false, skip: bool = false,
/// Hint to the user, why this has been skipped
skip_hint: ?[]const u8 = null,
/// Returns the name of the main file with .zig stripped. /// Returns the name of the main file with .zig stripped.
pub fn name(self: Exercise) []const u8 { pub fn name(self: Exercise) []const u8 {
return std.fs.path.stem(self.main_file); return std.fs.path.stem(self.main_file);
@ -347,8 +350,12 @@ const ZiglingStep = struct {
const self: *ZiglingStep = @alignCast(@fieldParentPtr("step", step)); const self: *ZiglingStep = @alignCast(@fieldParentPtr("step", step));
if (self.exercise.skip) { if (self.exercise.skip) {
print("Skipping {s}\n\n", .{self.exercise.main_file}); print("Skipping {s}", .{self.exercise.main_file});
if (self.exercise.skip_hint) |hint|
print("\n{s}Reason: {s}{s}\n", .{ bold_text, hint, reset_text });
print( "\n\n", .{});
return; return;
} }
@ -1038,7 +1045,8 @@ const exercises = [_]Exercise{
.{ .{
.main_file = "074_comptime9.zig", .main_file = "074_comptime9.zig",
.output = "My llama value is 2.", .output = "My llama value is 2.",
.skip = true, .skip = false,
.skip_hint = "This is actually correct as it is. :-)"
}, },
.{ .{
.main_file = "075_quiz8.zig", .main_file = "075_quiz8.zig",
@ -1089,41 +1097,49 @@ const exercises = [_]Exercise{
.output = "foo() A", .output = "foo() A",
.hint = "Read the facts. Use the facts.", .hint = "Read the facts. Use the facts.",
.skip = true, .skip = true,
.skip_hint = "async has not been implemented in the current compiler version.",
}, },
.{ .{
.main_file = "085_async2.zig", .main_file = "085_async2.zig",
.output = "Hello async!", .output = "Hello async!",
.skip = true, .skip = true,
.skip_hint = "async has not been implemented in the current compiler version.",
}, },
.{ .{
.main_file = "086_async3.zig", .main_file = "086_async3.zig",
.output = "5 4 3 2 1", .output = "5 4 3 2 1",
.skip = true, .skip = true,
.skip_hint = "async has not been implemented in the current compiler version.",
}, },
.{ .{
.main_file = "087_async4.zig", .main_file = "087_async4.zig",
.output = "1 2 3 4 5", .output = "1 2 3 4 5",
.skip = true, .skip = true,
.skip_hint = "async has not been implemented in the current compiler version.",
}, },
.{ .{
.main_file = "088_async5.zig", .main_file = "088_async5.zig",
.output = "Example Title.", .output = "Example Title.",
.skip = true, .skip = true,
.skip_hint = "async has not been implemented in the current compiler version.",
}, },
.{ .{
.main_file = "089_async6.zig", .main_file = "089_async6.zig",
.output = ".com: Example Title, .org: Example Title.", .output = ".com: Example Title, .org: Example Title.",
.skip = true, .skip = true,
.skip_hint = "async has not been implemented in the current compiler version.",
}, },
.{ .{
.main_file = "090_async7.zig", .main_file = "090_async7.zig",
.output = "beef? BEEF!", .output = "beef? BEEF!",
.skip = true, .skip = true,
.skip_hint = "async has not been implemented in the current compiler version.",
}, },
.{ .{
.main_file = "091_async8.zig", .main_file = "091_async8.zig",
.output = "ABCDEF", .output = "ABCDEF",
.skip = true, .skip = true,
.skip_hint = "async has not been implemented in the current compiler version.",
}, },
.{ .{