langref: Clear up terminology used for top-level doc comments

This commit is contained in:
Sage Hane
2026-04-17 16:12:10 +09:00
committed by Andrew Kelley
parent 9b177a7d21
commit f0649e7709
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -429,7 +429,7 @@
{#header_open|Top-Level Doc Comments#} {#header_open|Top-Level Doc Comments#}
<p> <p>
A top-level doc comment is one that begins with two slashes and an exclamation A top-level doc comment is one that begins with two slashes and an exclamation
point: {#syntax#}//!{#endsyntax#}; it documents the current module. point: {#syntax#}//!{#endsyntax#}; it documents the current source file.
</p> </p>
<p> <p>
It is a compile error if a top-level doc comment is not placed at the start It is a compile error if a top-level doc comment is not placed at the start
@@ -2470,7 +2470,7 @@ or
<p>Unions can be declared with an enum tag type. <p>Unions can be declared with an enum tag type.
This turns the union into a <em>tagged</em> union, which makes it eligible This turns the union into a <em>tagged</em> union, which makes it eligible
to use with {#link|switch#} expressions. When switching on tagged unions, to use with {#link|switch#} expressions. When switching on tagged unions,
the tag value can be obtained using an additional capture. the tag value can be obtained using an additional capture.
Tagged unions coerce to their tag type: {#link|Type Coercion: Unions and Enums#}. Tagged unions coerce to their tag type: {#link|Type Coercion: Unions and Enums#}.
</p> </p>
{#code|test_tagged_union.zig#} {#code|test_tagged_union.zig#}
+2 -2
View File
@@ -3,8 +3,8 @@
//! depend on libc, but will use functions from it if available. //! depend on libc, but will use functions from it if available.
const S = struct { const S = struct {
//! Top level comments are allowed inside a container other than a module, //! Top level comments are allowed inside containers other than source
//! but it is not very useful. Currently, when producing the package //! files, but it is not very useful. Currently, when producing the package
//! documentation, these comments are ignored. //! documentation, these comments are ignored.
}; };