mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Merge pull request #25903 from aznashwan/minor-docs-fixes
docs: minor fixes to main language reference page.
This commit is contained in:
commit
d828115dab
2 changed files with 7 additions and 3 deletions
|
|
@ -421,8 +421,7 @@
|
|||
{#code|unattached_doc-comment.zig#}
|
||||
|
||||
<p>
|
||||
Doc comments can be interleaved with normal comments. Currently, when producing
|
||||
the package documentation, normal comments are merged with doc comments.
|
||||
Doc comments can be interleaved with normal comments, which are ignored.
|
||||
</p>
|
||||
{#header_close#}
|
||||
{#header_open|Top-Level Doc Comments#}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ const std = @import("std");
|
|||
const os = std.os;
|
||||
const assert = std.debug.assert;
|
||||
|
||||
// Custom error set definition:
|
||||
const ExampleErrorSet = error{
|
||||
ExampleErrorVariant,
|
||||
};
|
||||
|
||||
pub fn main() void {
|
||||
// integers
|
||||
const one_plus_one: i32 = 1 + 1;
|
||||
|
|
@ -36,7 +41,7 @@ pub fn main() void {
|
|||
});
|
||||
|
||||
// error union
|
||||
var number_or_error: anyerror!i32 = error.ArgNotFound;
|
||||
var number_or_error: ExampleErrorSet!i32 = ExampleErrorSet.ExampleErrorVariant;
|
||||
|
||||
print("\nerror union 1\ntype: {}\nvalue: {!}\n", .{
|
||||
@TypeOf(number_or_error),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue