| author | |
| committer | |
| log | 0e9f86b1db1343b7e57f73906849c88627124a74 |
| tree | fb1601af9b3749234b8e6303543f7c4697673d17 |
| parent | ffaf37a7e7ab655265f10c2fd1060dc665520683 |
| signature | Commit is signed but in an unrecognized format. |
and make the type names of `@hasDecl` and `@hasField` consistent2 files changed, 4 insertions(+), 2 deletions(-)
doc/docgen.zig+2| ... | ... | @@ -528,6 +528,8 @@ fn genToc(allocator: *mem.Allocator, tokenizer: *Tokenizer) !Toc { |
| 528 | 528 | const end_tag_name = tokenizer.buffer[end_code_tag.start..end_code_tag.end]; |
| 529 | 529 | if (mem.eql(u8, end_tag_name, "code_release_fast")) { |
| 530 | 530 | mode = builtin.Mode.ReleaseFast; |
| 531 | } else if (mem.eql(u8, end_tag_name, "code_release_safe")) { | |
| 532 | mode = builtin.Mode.ReleaseSafe; | |
| 531 | 533 | } else if (mem.eql(u8, end_tag_name, "code_link_object")) { |
| 532 | 534 | _ = try eatToken(tokenizer, Token.Id.Separator); |
| 533 | 535 | const obj_tok = try eatToken(tokenizer, Token.Id.TagContent); |
doc/langref.html.in+2-2| ... | ... | @@ -7137,7 +7137,7 @@ fn func() void { |
| 7137 | 7137 | {#header_close#} |
| 7138 | 7138 | |
| 7139 | 7139 | {#header_open|@hasDecl#} |
| 7140 | <pre>{#syntax#}@hasDecl(comptime container: type, comptime name: []const u8) bool{#endsyntax#}</pre> | |
| 7140 | <pre>{#syntax#}@hasDecl(comptime Container: type, comptime name: []const u8) bool{#endsyntax#}</pre> | |
| 7141 | 7141 | <p> |
| 7142 | 7142 | Returns whether or not a {#link|struct#}, {#link|enum#}, or {#link|union#} has a declaration |
| 7143 | 7143 | matching {#syntax#}name{#endsyntax#}. |
| ... | ... | @@ -7170,7 +7170,7 @@ test "@hasDecl" { |
| 7170 | 7170 | {#header_close#} |
| 7171 | 7171 | |
| 7172 | 7172 | {#header_open|@hasField#} |
| 7173 | <pre>{#syntax#}@hasField(comptime T: type, comptime name: []const u8) bool{#endsyntax#}</pre> | |
| 7173 | <pre>{#syntax#}@hasField(comptime Container: type, comptime name: []const u8) bool{#endsyntax#}</pre> | |
| 7174 | 7174 | <p>Returns whether the field name of a struct, union, or enum exists.</p> |
| 7175 | 7175 | <p> |
| 7176 | 7176 | The result is a compile time constant. |