Commit Graph

776 Commits (f33a610c84313255477cc04d930b02ad984118ae)

Author SHA1 Message Date
Tadeo Kondrak 6b8ae6fffb
langref: update for opaque {} syntax 2020-10-06 22:08:29 -06:00
Tadeo Kondrak 069fbb3c01
Add opaque type syntax 2020-10-06 22:08:24 -06:00
Andrew Kelley 750b00c642 Merge remote-tracking branch 'origin/master' into stage2-zig-cc 2020-09-29 00:27:48 -07:00
Andrew Kelley 9d0da1612e langref: use general purpose allocator in the wasi example 2020-09-29 00:24:17 -07:00
Andrew Kelley b6556c944b fix another round of regressions in this branch
* std.log: still print error messages in ReleaseSmall builds.
   - when start code gets an error code from main, it uses std.log.err
     to report the error. this resulted in a test failure because
     ReleaseSmall wasn't printing `error: TheErrorCode` when an error
     was returned from main. But that seems like it should keep working.
     So I changed the std.log defaults. I plan to follow this up with a
     proposal to change the names of and reduce the quantity of the
     log levels.
 * warning emitted when using -femit-h when using stage1 backend; fatal
   log message when using -femit-h with self-hosted backend (because the
   feature is not yet available)
 * fix double `test-cli` build steps in zig's build.zig
 * update docgen to use new CLI
 * translate-c uses `-x c` and generates a temporary basename with a
   `.h` extension. Otherwise clang reports an error.
 * --show-builtin implies -fno-emit-bin
 * restore the compile error for using an extern "c" function without
   putting -lc on the build line. we have to know about the libc
   dependency up front.
 * Fix ReleaseFast and ReleaseSmall getting swapped when passing the
   value to the stage1 backend.
 * correct the zig0 CLI usage text.
 * update test harness code to the new CLI.
2020-09-26 21:03:38 -07:00
Ogromny bba4576281 Fix typo in documentation 2020-09-24 13:14:03 -04:00
Isaac Freund 72f4cdb2b4 docs: update implementation status for @Type() 2020-09-24 00:01:57 -04:00
Andrew Kelley 0c70bb4fce Merge remote-tracking branch 'origin/master' into stage2-zig-cc 2020-09-21 21:16:46 -07:00
Nathan Michaels 7801a6d17f Fix a typo. 2020-09-15 22:49:53 -04:00
Andrew Kelley c803d334d0 update the zen of zig 2020-09-15 13:40:01 -07:00
Veikka Tuominen 41bbadbb9a
Merge pull request #6246 from Vexu/field
Remove deprecated fields on `type`
2020-09-05 13:58:02 +03:00
Vexu 09c861b829
update rest of tests 2020-09-04 22:49:14 +03:00
Vexu 6b2f4fd20d
langref: atomic ops are allowed on pointers
Closes #6217
2020-09-04 22:02:39 +03:00
Andrew Kelley 212fe21d68 zen of zig: reword the last one a little bit 2020-08-31 14:40:08 -07:00
extrasharp d4b1ed1bc9 Add "table-wrapper" div 2020-08-24 17:29:53 -05:00
extrasharp 4d1710c899 Make changes 2020-08-24 13:12:23 -05:00
extrasharp 7d6ed1cd85 Add Keyword Reference section 2020-08-24 11:11:42 -05:00
Andrew Kelley 624e643872
Merge pull request #6046 from heidezomp/std-log-scoped-part2
std.log: (breaking) remove scope parameter from logging functions
2020-08-17 16:59:27 -04:00
Andrew Kelley 4adc052f0b langref: fix html error
thanks tidy
2020-08-14 09:33:45 -07:00
Maks S 50139aa232
langref: explain why comptime_float cannot be divided by comptime_int
Co-authored-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2020-08-13 22:08:37 +03:00
heidezomp 2439f67061 std.log: update documentation and example for scoped logging 2020-08-13 17:12:16 +02:00
Josias 67d684d89a docs: Fix reference to General Purpose Allocator 2020-08-12 05:08:41 -04:00
Andrew Kelley 051aadd781 std lib general purpose allocator: disable stack tracing on mips
Sadly, trying to collect stack frames goes into an infinite loop on
mips. This sets the default number of stack frames to collect to 0 on
mips.
2020-08-08 02:38:32 -07:00
Andrew Kelley 72b5ceed66 update langref in light of new general purpose allocator 2020-08-08 02:15:34 -07:00
Ashok Gautham d1755e7f16
Add meta viewport to fix mobile rendering, add missing <code> block
Co-authored-by: Vexu <git@vexu.eu>
2020-07-27 17:10:55 +03:00
data-man 3cdc0f104e Vectors clarification in docs 2020-07-16 16:22:28 +03:00
Nathan Michaels bc900cdeaf Document top-level doc comments, per #2288. 2020-07-13 22:57:23 +00:00
Andrew Kelley fabdef44a8
Merge pull request #5831 from paulespinosa/langref-hello-world-more
Explain Language Ref's Hello World
2020-07-13 22:45:32 +00:00
Paul Espinosa a8d8ce9733 Use Writer for Language Reference Hello World Example
`OutStream` has been deprecated, so the "Hello, World!" example has been
updated to use `Writer`.
2020-07-13 22:41:57 +00:00
Vexu be1507a7af
update compile error tests and some doc comments 2020-07-12 00:54:07 +03:00
Vexu 8110639c79
add 'anytype' to stage1 and langref 2020-07-11 17:41:33 +03:00
Paul Espinosa b45a2d72c8 Introduce Error Union and Use Writer
This commit edits the "Hello, World!" introduction. It introduces Error Union
Types. Also, it changes `outStream` to `writer` in the code example and description.
2020-07-11 18:08:00 +07:00
Paul e57458a94f
Update doc/langref.html.in
Co-authored-by: Joachim Schmidt <joachim.schmidt557@outlook.com>
2020-07-11 09:10:08 +07:00
Paul 50df1334f3
Update doc/langref.html.in
Co-authored-by: Joachim Schmidt <joachim.schmidt557@outlook.com>
2020-07-11 09:09:57 +07:00
Paul 656b640e79
Update doc/langref.html.in
Co-authored-by: Joachim Schmidt <joachim.schmidt557@outlook.com>
2020-07-11 09:09:43 +07:00
Paul 5afa7f2545
Update doc/langref.html.in
Co-authored-by: Joachim Schmidt <joachim.schmidt557@outlook.com>
2020-07-11 09:09:07 +07:00
Paul Espinosa f510f38592 Explain Language Ref's Hello World
To introduce the Zig programming language, the "Hello, world!" code sample now has
documentation to explain some of the features shown in the code sample
and contains links to those features in the rest of the documentation.

Writing style goals:
* Balance writing style to keep beginner and experience programmers interested.
* Be concise: allow the rest of the documentation to clarify language features.
2020-07-09 21:32:51 +07:00
Ryan Liptak 12a7dedb1f langref: Expand "if error union with optional" test case
Follow-up to #5818, closes #5819
2020-07-09 03:30:35 +00:00
xackus 2064e84cdd ci: check langref.html for html errors 2020-07-08 19:34:44 +00:00
Ryan Liptak f77c968cf8 langref: Add test case for "if error union with optional"
This is an edge case that isn't too uncommon but is rather confusing to try to deduce without documentation, since it feels like `else` is being overloaded in this scenario and there's no obvious 'correct' behavior here. This just adds a test demonstrating how Zig currently behaves in this scenario.
2020-07-08 19:32:15 +00:00
Paul Espinosa eeae3a8f9d Rename langref's Index to Contents (TOC)
The language reference's Index is a list of the documentation's contents in
order of appearance. This commit renames "Index" to "Contents" as in table of
contents. It also renames the HTML/CSS identifiers from "index" to "toc".
2020-07-08 19:31:38 +00:00
Andrew Kelley 3a89f214aa update more HashMap API usage 2020-07-05 21:11:42 +00:00
Chris Watson b8d5b3e611 Add documentation for @src() builtin 2020-07-01 22:22:30 +00:00
CodeMyst 7eed220924 in docs removed "path can be absolute" for imports 2020-07-01 22:12:44 +00:00
Alexandros Naskos ff2ddcf38d Updated @asyncCall docs 2020-06-24 19:01:38 +03:00
Jakub Konka 66e5205047 Refactor PreopenList.find()
This commit generalizes `std.fs.wasi.PreopenList.find(...)` allowing
search by `std.fs.wasi.PreopenType` union type rather than by dir
name. In the future releases of WASI, it is expected to have more
preopen types (or capabilities) than just directories. This commit
aligns itself with that vision.

This is a potentially breaking change. However, since `std.fs.wasi.PreopenList`
wasn't made part of any Zig release yet, I think we should be OK
to introduce those changes without pointing to any deprecations.
2020-06-23 21:54:36 +02:00
Sebastian 8527718350
langref - document that This works on enums too 2020-06-20 12:16:57 +01:00
Eleanor NB 605769ec25 Replaced all occurrences of std.debug.warn in the docs with std.debug.print 2020-06-19 19:03:37 -04:00
Andrew Kelley 866651a5a3
Merge pull request #5589 from kubkon/preopens-example
Add doc example for extracting WASI preopens
2020-06-12 13:40:30 -04:00
Veikka Tuominen 7d8fd45267
Merge pull request #5595 from ifreund/doc-arraylist-fix
docs: fix mention of deprecated ArrayList.span()
2020-06-12 19:10:47 +03:00