authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-11-21 19:56:15-08:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-11-21 19:56:15-08:00
logd828115dabf3b06711788dc2f424a1ef3cedd6a3
tree11406fad4c3e6777081941252932ac54eea77c23
parentd54fbc01234688b37a48b29fee499529a500ccf5
parentaf7dec94c636769741e746090c9bd0590e3bbc22
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #25903 from aznashwan/minor-docs-fixes

docs: minor fixes to main language reference page.

2 files changed, 7 insertions(+), 3 deletions(-)

doc/langref.html.in+1-2
...@@ -421,8 +421,7 @@...@@ -421,8 +421,7 @@
421 {#code|unattached_doc-comment.zig#}421 {#code|unattached_doc-comment.zig#}
422422
423 <p>423 <p>
424 Doc comments can be interleaved with normal comments. Currently, when producing424 Doc comments can be interleaved with normal comments, which are ignored.
425 the package documentation, normal comments are merged with doc comments.
426 </p>425 </p>
427 {#header_close#}426 {#header_close#}
428 {#header_open|Top-Level Doc Comments#}427 {#header_open|Top-Level Doc Comments#}
doc/langref/values.zig+6-1
...@@ -4,6 +4,11 @@ const std = @import("std");...@@ -4,6 +4,11 @@ const std = @import("std");
4const os = std.os;4const os = std.os;
5const assert = std.debug.assert;5const assert = std.debug.assert;
66
7// Custom error set definition:
8const ExampleErrorSet = error{
9 ExampleErrorVariant,
10};
11
7pub fn main() void {12pub fn main() void {
8 // integers13 // integers
9 const one_plus_one: i32 = 1 + 1;14 const one_plus_one: i32 = 1 + 1;
...@@ -36,7 +41,7 @@ pub fn main() void {...@@ -36,7 +41,7 @@ pub fn main() void {
36 });41 });
3742
38 // error union43 // error union
39 var number_or_error: anyerror!i32 = error.ArgNotFound;44 var number_or_error: ExampleErrorSet!i32 = ExampleErrorSet.ExampleErrorVariant;
4045
41 print("\nerror union 1\ntype: {}\nvalue: {!}\n", .{46 print("\nerror union 1\ntype: {}\nvalue: {!}\n", .{
42 @TypeOf(number_or_error),47 @TypeOf(number_or_error),