In the "Type Coercion" section, rename:
- Coercion Float to Int => Float to Int
- unions and enums => Unions and Enums
- tuples to arrays => Tuples to Arrays
In the "C Translation CLI" section, move the paragraph inside the p
element.
The current HTML is valid, but, as an example, a paragraph outside a p
element is not handled correctly by the browser Inspect tool.
In commit 3542dbf0ea (langref: add section numbers) I accidentally
added an extra closing curly bracket at the end of the style element.
Sorry for not validating the HTML file before creating the PR.
Update the genToc funtion to make the name required in the Code node,
and add an additional optional field for the expected error, to use with
test_err, test_safety and obj_err.
Update langref.html.in to ensure all code blocks have a name that
- is unique, so that a doctest can be identified by it
- is descriptive
For test, test_err and test_safefy, ensure that the doctest name starts
with "test_", excluding doctests in the "Zig Test" section and doctests
that are imported by other doctests.
Ensure that the indentation of code_begin and code_end blocks are
consistent.
Fix a typo in pointer_arthemtic.
In a syntax_block the code always start on a separate code, expect for
C, JavaScript, Peg and with Zig inline assembly.
Ensure that the code starts on a separate line, even in cases where
there is only one line.
Ensure that the end_syntax_block is always on a separate line and that
the indentation is consistent.
The current compiler ignores the UTF-8 BOM if it is at the start of the
file, and disallows it anywhere else. Document it in the Source Encoding
section.
Add the new addrspace keyword in the Keyword Reference section, without
documentation.
Move the linksection keyword in order to keep the keywords list sorted.
The deallocations of the process arguments are unnecessary, since the
memory will be deallocated by arena.deinit().
The deallocations are incorrect, since ArgIterator.next() returns a
slice pointing to the iterator's internal buffer, that should be
deallocated with args_it.deinit().
When reading a document with nested sections, it is not easy to discover
the depth of the current section.
Add support for nested section numbers, from the h2 to the h4 heading,
in the format "lv1. ", "lv1.lv2. ", "lv1.lv2.lv3. ". The "Zig Version"
and "Table of Content" sections are excluded.
The section numbers are implemented in CSS, with the CSS rules declared
inside a @media rule. Currently the @media rule targets all media.
This was a poor naming choice; these are parameters, not arguments.
Parameters specify what kind of arguments are expected, whereas the arguments are the actual values passed.
Add a missing ReleaseSmall when describing unreachable in the try
section and the unreachable entry in the Keyword Reference section.
Additionally, transform Debug, ReleaseSafe, ReleaseFast and ReleaseSmall
into links in the try section.
Co-authored-by: Andrew Kelley <andrew@ziglang.org>
Currently, the test_fn_reflection.zig doctest has an example of
.Fn.is_var_args. This example can confuse the reader, since there is no
documentation about variadic functions and is_var_args is mainly used in
the compiler.
Remove the example with .Fn.is_var_args and add instead examples with
.Fn.return_type and .Fn.is_generic.
In the slice_bounds.zig doctest, the code "const slice = array[2..4]" is
incorrect, since the actual type is a pointer to an array, instead of a
slice.
Use a runtime know value to slice the array.
In the slices.zig doctest, the code
`const all_together_slice = all_together[0..]` is incorrect, since the
actual type is a pointer to an array, instead of a slice.
Use a runtime-known value to slice the array.
In the next "slice pointer" test, clarify that slicing a slice to
produce a pointer to an array, requires comptime-known indexes, not just
constant indexes.
Split the original `defer.zig` doctest into 3 doctest:
1. Document the defer keyword
2. Document that the return statement is not allowed inside a defer
expression
3. Document the errdefer keyword
Replace "method" with "expression" in the text `defer method`.
Several <em> elements where added inside a shell node in the
Using--target-and--cflags section. Remove them, since they are not
supposed to be handled by codegen.
For the original commit, see
0c091feb5 (Improve HTML semantics and a11y of language reference).
Fixes#13846