Commit Graph

799 Commits

Author SHA1 Message Date
Martin Wickham
676e416c86 Fix operator precedence documentation 2020-12-09 14:26:29 -05:00
LemonBoy
3f0a4ffbf4 langref: Update setEvalBranchQuota prototype 2020-12-09 20:15:58 +01:00
Vexu
98d5bfbd4d
update grammar in langref 2020-11-22 21:30:09 +02:00
Tadeo Kondrak
c002a5026a
Update code to not use unsupported calling conventions for target 2020-11-19 14:01:07 +02:00
xackus
27b73cc395 std: make meta.IntType a compile error
the function signature changed
also update langref
2020-11-18 12:57:49 +02:00
Jonas Carpay
c9dc30daf7 Fix backticked code in langref 2020-11-11 15:34:01 +02:00
data-man
99932042dc Fix reduce documentation 2020-11-09 11:47:43 +01:00
Andrew Kelley
9af53f8e02 langref: add 0.7.0 link 2020-11-09 00:37:35 -07:00
Andrew Kelley
f4ed5d7d48 langref tidy html fixup 2020-11-01 14:39:45 -07:00
LemonBoy
577b994507 docs: Add @reduce documentation 2020-11-01 14:30:31 -07:00
Veikka Tuominen
80dd432137
Merge pull request #6858 from travv0/no-star-after-dot-star
don't allow a token starting with an asterisk directly following .*
2020-10-30 16:08:04 +02:00
LemonBoy
490cafe2c5 stage1: Error out when trying to execute unreachable
Closes #6802
2020-10-29 20:06:52 -04:00
Travis
f54605ecc2 add missing Invalid_periodasterisks case in docgen 2020-10-29 14:02:08 -05:00
=
6f3c84834d Changed macosx to macos in support os to better relfect the output of zig targets 2020-10-29 14:35:29 -04:00
Paul Espinosa
ddd39b994b Use std.testing.expect in language reference samples
In this commit, the code samples in the language reference have been changed to
use `std.testing.expect` rather than `std.debug.assert` when they are
written in `test` code. This will teach Zig learners best practices when
they write their own test code.

Not all uses of `std.debug.assert` have been replaced. There are examples where
using `assert` fits the context of the sample.

Using `std.debug.assert` in test code can lead to errors if running tests in
ReleaseFast mode. In ReleaseFast mode, the `unreachable` in `assert` is
undefined behavior. It is possible that `assert` always causes `zig test` to
pass thus possibly leading to incorrect test code outcomes. The goal is to
prevent incorrect code from passing test cases.

Closes #5836
2020-10-22 15:54:57 -07:00
Andrew Kelley
e6ac082437
Merge pull request #6744 from LemonBoy/intcast-vec
stage1: Implement `@intCast` between vectors
2020-10-22 17:36:18 -04:00
Rocknest
a123378141 langref: fix equations 2020-10-20 23:22:08 +03:00
LemonBoy
475fc2934b Update langref errors 2020-10-20 10:05:44 +02:00
Nathan Bourgeois
3ab4d112e0 Update Documentation to use -O instead 2020-10-19 13:00:04 +03:00
Andrew Kelley
9ca8bcb4d9 langref cleanups
* move the opaque section to after struct, enum, union, and add
   hyperlinks
 * improve the introduction of the zig build system. don't link to the
   wiki.
 * update to the latest zig init-exe example code
 * rename headers to avoid redundant words such as "zig"
 * simplify example code
2020-10-16 21:29:33 -07:00
Nathan Michaels
eb80cc2b9e Add some basic examples for the Zig Build System. 2020-10-16 21:29:22 -07:00
Isaac Freund
7b150dd05e docs: snake_case enums/unions in langref examples
This follows the accepted change to the style guide:
https://github.com/ziglang/zig/issues/2101
2020-10-15 18:55:57 +03:00
Jakub Konka
53c63bdb73 Update WASI preopens doc section to use GPA
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-10-10 20:07:16 +02:00
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