Commit Graph

1169 Commits

Author SHA1 Message Date
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
XXIV
2f3add4f30 build.zig.zon.md: remove duplicate word 2023-10-24 17:46:10 +03: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
Andrew Kelley
b795925ee4 doc: add minimum_zig_version field reference 2023-10-18 18:59:13 -07: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
Andrew Kelley
d06da95884 add basic build.zig.zon documentation 2023-10-08 16:54:31 -07: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
Michael Dusan
acc9471915 doc: inline comptime conditional block
Better illustrate what happens to the block after inlining comptime
conditionals.

closes #17106
2023-09-11 00:29:56 +03:00
Hashi364
b0d9bb0bb8
langref: keyword consistency (between keyword list and grammar)
Add missing keywords in Keyword Reference.
Reorder keywords in grammar.
2023-09-06 19:10:24 +03:00
Nitin Prakash
f1992a39a5
langref: minor documentation fixes to addCSourceFile (#16785) 2023-08-16 15:35:58 -04:00
Andrew Kelley
67709b6382 Release 0.11.0 2023-08-03 11:22:03 -07:00
Jacob G-W
4d22bae27e langref: fix documentation for @extern 2023-08-02 17:39:52 -04:00
Andrew Kelley
acbb6418c3 move docgen.zig to tools/ 2023-07-30 18:44:31 -07:00
Andrew Kelley
25a9487caa std.Build.LazyPath: fix resolution of cwd_relative
The callsites of getPath rely on the result being absolute so that they
can pass the path to a child process with the cwd set to the build root.
2023-07-30 18:42:08 -07:00
Niles Salter
6548331ec9 Doc nitpick
`slice[i]` should assert `len > i`
2023-07-28 10:30:32 -07:00
Evin Yulo
f1bd598768 langref: document out of bounds float to integer cast 2023-07-24 12:57:11 -07:00
Wooster
aea29afc44 langref: update docs for ** and ++
This behavior changed with https://github.com/ziglang/zig/issues/7147
2023-07-24 10:57:11 -07:00
r00ster91
295b96f78b langref builtin parameters: []u8 -> []const u8
None of these builtins modify the passed string.
This parameter type can be misleading.
2023-07-21 23:03:26 +02:00
Luiz Berti
a86f589a9f
Small documentation fixes on std.crypto (#16427)
* Small documentation fix of ChaCha variants

Previous documentation was seemingly copy-pasted and left
behind some errors where the number of rounds was not
properly updated.

* Suggest `std.crypto.utils.secureZero` on `@memset` docs

* Revert previous change
2023-07-17 21:16:41 +00:00
antlilja
299e86598d Update langref to new splat syntax 2023-07-12 15:35:57 -07:00
Evan Haas
77dcd903a0 langref: Add c_char to the list of primitive types 2023-06-28 17:35:22 -07:00
Bertie Wheen
7166407d8f langref: correct ordering of @xFromY builtins 2023-06-28 17:38:41 +03:00
Andrew Kelley
df389b62de
Merge pull request #16192 from mlugg/builtins-infer-dest-ty-fixes
Follow-up to cast builtin result type inference
2023-06-25 12:38:56 -07:00
Evin Yulo
17e12960b5 remove mention of stage1 from langref 2023-06-25 21:13:56 +03:00
mlugg
5311916928
langref: neaten up @errSetCast example 2023-06-25 13:28:31 +01:00
mlugg
a84a895325 langref: update to new cast builtin syntax 2023-06-24 16:56:39 -07:00
Sebastian Bensusan
64faaa7d8f Langref: Add example for catching some errors and narrowing the error set 2023-06-23 01:09:04 +03:00
dweiller
e45d24c0de rename ZIG_DEBUG_COLOR env variable to YES_COLOR 2023-06-22 10:29:45 +10:00
begly
da1f457e3b Fix Typo in langref.html.in 2023-06-20 11:51:11 -07:00
Eric Joldasov
50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00
Arya-Elfren
c13ac52972 Fix a confusing comment in langref.html.in 2023-06-18 09:19:23 -07:00
Andrew Kelley
9370fb8b81
Merge pull request #14844 from perillo/fix-issue-13280
Fix issue 13280
2023-06-17 13:37:28 -07:00
Manlio Perillo
366e3c657f
Langref misc fix and improvement (#14695)
* langref: improve the Hello World section

Clarify that a Zig source file must have the .zig extension.

Fix a typo.

* langref: improve the Comments section

  - Document how doc comments are used by -femit-docs
  - Rename "Doc comments" to "Doc Comments", for consistency
  - Clarify that placing a doc comment in an unexpected place is a
    compiler error and add two incorrect examples
  - Document the current Autodoc behavior, when normal comments are
    interleaved with doc comments
  - Rewrite the documentation for top-level doc comments

* langref: improve the Zig Test section

Document that the test name can also be an identifier, in addition to a
string literal.

Update the test output for the first test.

Closes #14085
2023-06-17 16:35:50 -04:00
John Zhang
e95fc2023f Change outdated filename in langref 2023-06-16 23:12:45 -07:00
r00ster91
2593156068 migration: std.math.{min, min3, max, max3} -> @min & @max 2023-06-16 13:44:09 -07:00
jcalabro
666ae24816 Clarify @sin, @cos, @tan use radians 2023-06-14 06:04:52 -07:00
Eric Joldasov
d884d7050e
all: replace comptime try with try comptime
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:46:58 +06:00