| author | |
| committer | |
| log | d828115dabf3b06711788dc2f424a1ef3cedd6a3 |
| tree | 11406fad4c3e6777081941252932ac54eea77c23 |
| parent | d54fbc01234688b37a48b29fee499529a500ccf5 |
| parent | af7dec94c636769741e746090c9bd0590e3bbc22 |
| signature |
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 | 421 | {#code|unattached_doc-comment.zig#} |
| 422 | 422 | |
| 423 | 423 | <p> |
| 424 | Doc comments can be interleaved with normal comments. Currently, when producing | |
| 425 | the package documentation, normal comments are merged with doc comments. | |
| 424 | Doc comments can be interleaved with normal comments, which are ignored. | |
| 426 | 425 | </p> |
| 427 | 426 | {#header_close#} |
| 428 | 427 | {#header_open|Top-Level Doc Comments#} |
doc/langref/values.zig+6-1| ... | ... | @@ -4,6 +4,11 @@ const std = @import("std"); |
| 4 | 4 | const os = std.os; |
| 5 | 5 | const assert = std.debug.assert; |
| 6 | 6 | |
| 7 | // Custom error set definition: | |
| 8 | const ExampleErrorSet = error{ | |
| 9 | ExampleErrorVariant, | |
| 10 | }; | |
| 11 | ||
| 7 | 12 | pub fn main() void { |
| 8 | 13 | // integers |
| 9 | 14 | const one_plus_one: i32 = 1 + 1; |
| ... | ... | @@ -36,7 +41,7 @@ pub fn main() void { |
| 36 | 41 | }); |
| 37 | 42 | |
| 38 | 43 | // error union |
| 39 | var number_or_error: anyerror!i32 = error.ArgNotFound; | |
| 44 | var number_or_error: ExampleErrorSet!i32 = ExampleErrorSet.ExampleErrorVariant; | |
| 40 | 45 | |
| 41 | 46 | print("\nerror union 1\ntype: {}\nvalue: {!}\n", .{ |
| 42 | 47 | @TypeOf(number_or_error), |