Commit graph

964 commits

Author SHA1 Message Date
Andrew Kelley
f29217ae0c langref: reduce verbosity of string literal section 2024-01-21 20:31:13 -07:00
Andrew Kelley
9be831e15a langref: remove line numbers from code samples
It's unnecessary, more complicated, bloated, and it messes up the table
of operators.
2024-01-21 20:31:13 -07:00
Andrew Kelley
a054c01f5c Revert "langref: add section numbers"
This reverts commit 3542dbf0ea.

I don't like them
2024-01-21 20:31:13 -07:00
Andrew Kelley
e9c7ebe79e langref: simplify Hello World section
reverts f510f38592
2024-01-21 20:31:13 -07:00
Andrew Kelley
6fef362992 Revert "langref: emphasize the use of dereferencing string literals"
This reverts commit 27353bb936.

* unnecessary example
* poor phrasing (avoid "you")
2024-01-21 20:31:13 -07:00
Andrew Kelley
559bbf1cc6 langref: explicitly mention inline combined with multiple cases
closes #18524
2024-01-21 20:31:13 -07:00
Ian Johnson
fdb4eb3056 langref: add information about doctests
This creates a section in the language reference about doctests, which
is currently referenced by Autodoc in a tooltip when displaying a
doctest.

Some advice relevant to writing doctests is included, based on the
discussion on #16472.
2024-01-21 19:28:52 -08:00
Andrew Kelley
96e54e7017 langref: extract code comments into paragraphs
Related #18496
2024-01-18 22:01:09 -07:00
Andrew Kelley
56db624643 langref: update Zig Build System section
It's hosted externally for now.

closes #18103
2024-01-18 22:01:09 -07:00
Andrew Kelley
8662c0ff43 langref: avoid the ambiguous word "safe"
See #2402
2024-01-18 22:01:09 -07:00
Andrew Kelley
9e6ff71330 langref: delete Nested Container Tests section
This section documented how a buggy feature worked at one point in time
but it's not a description of what is supposed to happen. What is
supposed to happen is simple enough to not warrant any documentation
about it. When a file is imported, all the test decls are supposed to be
queued for analysis.

Also, refAllDecls() is a hack which should not be celebrated or even
mentioned in the language reference.

closes #18042
2024-01-18 22:01:09 -07:00
Andrew Kelley
9b714e019c
Merge pull request #18219 from g-cassie/optional-documentation-tweaks
Minor improvements to the Optionals documentation
2024-01-18 20:34:00 -08:00
Piotr Szlachciak
c724cc6487 Move the paragraph to under variables 2024-01-16 20:18:45 +02:00
Piotr Szlachciak
2d4ebcffbf Move the extern paragraph to a more logical place 2024-01-16 20:18:45 +02:00
Piotr Szlachciak
6a3f9a0b50 Add missing != null operator 2024-01-16 20:17:29 +02:00
emberfade
c2659e0371 langref: Fix example for Generic Data Structures 2024-01-13 23:13:44 -08:00
Andrew Kelley
63de8a5989 langref: fix typo 2024-01-11 01:02:21 -08:00
Andrew Kelley
aba8d4f62c langref: document inline functions 2024-01-10 19:31:45 -07:00
dweiller
8695bc7ed3 langref: mention error union switch peer resolution 2024-01-09 14:42:12 +11:00
Andrew Kelley
8c9efc95a1 langref: update target section
* remove outdated information
* add new information

closes #17032
closes #17044
2024-01-08 18:48:10 -07:00
Scott Schwarz
f5978181e4
langref: reword Hello World section (#18458)
closes #14347
2024-01-08 01:32:26 -05:00
Andrew Kelley
52ebba6bdf @shlExact fixups
* Add clarification in langref
* move test case to behavior tests
2024-01-04 00:44:44 -07:00
Samuel Nevarez
25a556107c langref: order comment to align with code example 2024-01-02 12:06:59 +02:00
Gordon Cassie
ef93a36cd5 Add comment. Split up if docs for optionals. 2023-12-07 13:51:03 -08:00
Gordon Cassie
cce820f93d Add cross references for optional documentation and another example of optional capture in while loop. 2023-12-07 10:53:05 -08:00
Nan Zhong
72568c131d langref: fix incorrect reference to string literal 2023-12-05 10:17:36 +02:00
David Rubin
1e42a3de89
Remove all usages of std.mem.copy and remove std.mem.set (#18143) 2023-11-29 16:03:02 -05:00
expikr
27353bb936
langref: emphasize the use of dereferencing string literals 2023-11-21 13:54:13 +02:00
mlugg
ed4bab66d8
langref: correct unnecessary uses of 'var' 2023-11-19 11:11:49 +00:00
dweiller
81219586bc sema: allow slicing [*]T without end 2023-11-07 17:01:32 +02:00
XXIV
5ea973dc39 langref: fix malloc return type 2023-11-06 23:46:17 +02:00
Luuk de Gram
5b2ee5eacc
docs: update WebAssembly freestanding example 2023-11-03 12:48:53 +01:00
Andrew Kelley
3fc6fc6812 std.builtin.Endian: make the tags lower case
Let's take this breaking change opportunity to fix the style of this
enum.
2023-10-31 21:37:35 -04:00
Andrew Kelley
ffaeb45333 langref: clarify struct memory layout 2023-10-30 16:27:12 -07:00
expikr
aecdf6ad50
Doc: elaborate on Slice section
somehow the concept of slices had less elaboration in its own dedicated section than the mentions of it elsewhere.
2023-10-27 23:11:56 +00:00
Niles Salter
87a397ab0c Fix typo in docs 2023-10-23 12:30:37 +03:00
Kirk Scheibelhut
ed82e4f7ac langref: update to document --error-limit flag 2023-10-22 14:29:26 +03:00
Veikka Tuominen
9d9e22e716 remove uses of non-configurable err_int 2023-10-22 14:29:26 +03:00
dbandstra
6822a7a123 langref: bring build.zig examples up to date
Update to match current outputs of init-exe and init-lib.
2023-10-20 04:50:29 -04:00
Ryan Barth
8a15c9249c update build.zig examples from current stdlib 2023-10-14 19:57:47 +03:00
Jonathan Marler
3a47bc7154 Grammar: Use ContainerDeclaration* instead of ContainerDeclarations
`ContainerDeclarations` is an abstraction of `ContainerDeclaration*`.
Removing this abstraction allows the `ContainerMembers` rule to contain
more concrete information without having to look at the definition
of `ContainerDeclarations`.
2023-10-10 00:51:58 +03:00
Veikka Tuominen
63bd2bff12 Sema: add @errorCast which works for both error sets and error unions
Closes #17343
2023-10-01 17:00:01 +03:00
Jonathan Marler
e0ef61d46d simplify ContainerDeclarations grammar rule
Noticed this grammar rule could be simplified using a repeating sequence
rather than recursion.
2023-09-28 14:18:54 +03:00
Jonathan Marler
18f1db134c docs: remove unnecessary nesting in grammar
noticed this extra level of nesting in the Decl grammar that looks
unnecssary.
2023-09-28 13:58:14 +03:00
antlilja
c62bf068e5 Change @fabs to @abs in langref 2023-09-27 11:24:39 -07:00
Jay Petacat
731fd217db Add embedded SVG favicon to reference doc templates
The SVG looks way better than the pixelated PNG and will adapt best to
whatever screen it is being displayed on. The PNG continues to be used
because Apple Safari does not support SVG favicons yet. All other major
browsers do. See https://caniuse.com/link-icon-svg.

This is a companion PR to ziglang/www.ziglang.org#310.
2023-09-25 12:24:06 +03:00
Pat Tullmann
00f42909ad
langref: small fixes to wording and examples
Simplify wording and add some formatting in several locations.

Expand sentinel array tests to highlight (non-)handling of internal
sentinels.

Fix format of symbol names in function pointers example.

Clarify wording a bit on the builin atomic* documentation.

Remove the (second) builtin compileLog example that demonstrated a lack of
compileLog entries.

* langref: address comments from rohlem

Use "0-terminated" instead of "null-terminated".

Undo some changes that were not as clear an improvement as I though.

* langref: remove stray ""

Thanks to rohlem for spotting this typo.
2023-09-21 17:50:48 +03:00
Andrew Kelley
660b3e2090 langref: disable var args example on aarch64-windows
See tracking issues #14096 and #16961.

Also, any time a test is skipped it should link to the open bug report
for it.
2023-09-19 09:37:53 -07:00
mlugg
aec821c083 langref: apply grammar changes
This applies the changes to the grammar introduced by the new
destructuring syntax, as well as some existing changes which were not
copied into the langref.
2023-09-15 11:34:07 -07:00
Arnau
a0968be83c
Documented linksection
Fixes #1520
2023-09-11 10:54:59 +03:00