aboutsummaryrefslogtreecommitdiff
path: root/doc
AgeCommit message (Collapse)Author
2022-03-18stage2: improve `@typeName`Andrew Kelley
* make it always return a fully qualified name. stage1 is inconsistent about this. * AstGen: fix anon_name_strategy to correctly be `func` when anon type creation happens in the operand of the return expression. * Sema: implement type names for the "function" naming strategy. * Put "enum", "union", "opaque", or "struct" in place of "anon" when creating respective anonymous Decl names. * std.testing: add `expectStringStartsWith`. Didn't end up using it after all. Also this enables the real test runner for stage2 LLVM backend (sans wasm32) since it works now.
2022-03-17langref: small clarification of `@reduce`Andrew Kelley
2022-03-14basic language features do not belong in std.metaAndrew Kelley
2022-03-08langref: fix a stray anyopaque that should be a voidAndrew Kelley
2022-03-06correct `@frameSize()` params in documentationThe Depressed Milkman
The documentation omitted the primary parameter, making it difficult to understand what this function actually does.
2022-02-23Add documentation for common mistakes in errdefer scopingExonorid
2022-02-17stage1: improve error message when casting tuplesVeikka Tuominen
2022-02-14CI: update download page and langref for 0.9.1Andrew Kelley
2022-02-14langref: correct info about type info of declarationsAndrew Kelley
2022-02-08update more API usage of std.ProgressAndrew Kelley
fixes regression introduced in 5a00e249632716b86edac088f69d19d82e307a28
2022-02-04Various documentation fixesKirk Scheibelhut
Co-authored-by: Kirk Scheibelhut <kjs@scheibo.com> Co-authored-by: extrasharp <genericpb@gmail.com>
2022-02-02Correct f80 descriptionGithubPrankster
2022-01-30Full response file (*.rsp) supportPhaseMage
I hit the "quotes in an RSP file" issue when trying to compile gRPC using "zig cc". As a fun exercise, I decided to see if I could fix it myself. I'm fully open to this code being flat-out rejected. Or I can take feedback to fix it up. This modifies (and renames) _ArgIteratorWindows_ in process.zig such that it works with arbitrary strings (or the contents of an RSP file). In main.zig, this new _ArgIteratorGeneral_ is used to address the "TODO" listed in _ClangArgIterator_. This change closes #4833. **Pros:** - It has the nice attribute of handling "RSP file" arguments in the same way it handles "cmd_line" arguments. - High Performance, minimal allocations - Fixed bug in previous _ArgIteratorWindows_, where final trailing backslashes in a command line were entirely dropped - Added a test case for the above bug - Harmonized the _ArgIteratorXxxx._initWithAllocator()_ and _next()_ interface across Windows/Posix/Wasi (Moved Windows errors to _initWithAllocator()_ rather than _next()_) - Likely perf benefit on Windows by doing _utf16leToUtf8AllocZ()_ only once for the entire cmd_line **Cons:** - Breaking Change in std library on Windows: Call _ArgIterator.initWithAllocator()_ instead of _ArgIterator.init()_ - PhaseMage is new with contributions to Zig, might need a lot of hand-holding - PhaseMage is a Windows person, non-Windows stuff will need to be double-checked **Testing Done:** - Wrote a few new test cases in process.zig - zig.exe build test -Dskip-release (no new failures seen) - zig cc now builds gRPC without error
2022-01-29fs: Use `OpenMode` enum instead of read/write flags.Sage Hane
2022-01-28std: add f80 bitsVeikka Tuominen
2022-01-27docs: reorganize `@truncate` and `@intCast` for claritypraschke
2022-01-27fix precedence in langref or examplePhilipp Lühmann
2022-01-27Added documentation for implicit struct pointer dereferencingExonorid
2022-01-07Add missing package to the langref that's always availabler00ster
2021-12-21Change `ArgIterator.next()` return typeominitay
Changes the return type of `ArgIterator.next()` from `?(NextError![:0]u8)` to `NextError!?[:0]u8`.
2021-12-21Langref: replace mentions of c_void with anyopaqueJohn Schmidt
2021-12-20Release 0.9.00.9.0Andrew Kelley
2021-12-18langref: fix tidy html errorAndrew Kelley
regressed in 8468b544e8769b774e2e5988a58c51d991df999a
2021-12-19stage1, stage2: rename c_void to anyopaque (#10316)Isaac Freund
zig fmt now replaces c_void with anyopaque to make updating code easy.
2021-12-18Add Vector documentation (#10303)bnprks
* Create Vector language documentation Main changes to docs: 1. Create brief documentation on Zig vector types with code example 2. Get rid of the SIMD sub-heading under the main Vectors heading, and update links accordingly 3. Add an example to the `@shuffle` docs
2021-12-11langref: document @prefetch() builtinIsaac Freund
2021-12-03Add documentation for sentinel-terminated slicing (#10010)Michael Byrne
closes #9680
2021-12-02improve detection of how to execute binaries on the hostAndrew Kelley
`getExternalExecutor` is moved from `std.zig.CrossTarget` to `std.zig.system.NativeTargetInfo.getExternalExecutor`. The function also now communicates a bit more information about *why* the host is unable to execute a binary. The CLI is updated to report this information in a useful manner. `getExternalExecutor` is also improved to detect such patterns as: * x86_64 is able to execute x86 binaries * aarch64 is able to execute arm binaries * etc. Added qemu-hexagon support to `getExternalExecutor`. `std.Target.canExecBinaries` of is removed; callers should use the more powerful `getExternalExecutor` instead. Now that `zig test` tries to run the resulting binary no matter what, this commit has a follow-up change to the build system and docgen to utilize the `getExternalExecutor` function and pass `--test-no-exec` in some cases to avoid getting the error. Additionally: * refactor: extract NativePaths and NativeTargetInfo into their own files named after the structs. * small improvement to langref to reduce the complexity of the `callconv` expression in a couple examples.
2021-11-30allocgate: apply missed changesLee Cannon
2021-11-30allocgate: renamed getAllocator function to allocatorLee Cannon
2021-11-30allocgate: stage 1 and 2 buildingLee Cannon
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-11-30std lib API deprecations for the upcoming 0.9.0 releaseAndrew Kelley
See #3811
2021-10-23Minor rewording of "Shadowing" section within language referenceMichael Byrne
2021-10-12Merge pull request #9878 from pfgithub/patch-4Andrew Kelley
Add line numbers to langref
2021-10-04migrate from `std.Target.current` to `@import("builtin").target`Andrew Kelley
closes #9388 closes #9321
2021-10-04langref: Explain Zig TestMr. Paul
Updates the Language Reference sections: Comments, Values, and Zig Test. Zig Test section moved down with the goal "make sure it can be read top to bottom sensibly" in mind (issue #1524). Comments and Values section examples changed test declarations to a main function and expect statement to print statements. A print statement was added to the "String Literals and Unicode Code Point" section's example to demonstrate the "u" format specifier. Zig Test Section: * Addresses the question: "How does the syntax work?". * Partially answers the question: "What can I do with the zig test tool?" but should be sufficient to understand the examples in all of this document. * Addresses the question: "How does a top-level test block differ from a function definition?" * Provides a example to run multiple test. Lacks clear definitions of containers, top-level, order independence, lazy analysis, resolve, reference. GitHub Issues: #8221, #8234
2021-10-03fix assuming multiline string tokens end with '\n'pfg
2021-10-03switch back to peg for the grammar typepfg
2021-10-02fix the erroring testspfg
2021-10-02fix grammer file name and .y file typepfg
2021-10-02fix incorrectly escaped htmlpfg
2021-10-01fix fmtpfg
2021-10-01fix style in thpfg
2021-10-01fix line numbers on multiline strings, add line numbers to peg grammarpfg
2021-10-01Add line numbers to langref (fixes #9870)pfg
2021-09-30Fix a typo in @ceil documentation.Nathan Michaels
2021-09-28saturating arithmetic modificationsAndrew Kelley
* Remove the builtins `@addWithSaturation`, `@subWithSaturation`, `@mulWithSaturation`, and `@shlWithSaturation` now that we have first-class syntax for saturating arithmetic. * langref: Clarify the behavior of `@shlExact`. * Ast: rename `bit_shift_left` to `shl` and `bit_shift_right` to `shr` for consistency. * Air: rename to include underscore separator with consistency with the rest of the ops. * Air: add shl_exact instruction * Use non-extended tags for saturating arithmetic, to keep it simple so that all the arithmetic operations can be done the same way. - Sema: unify analyzeArithmetic with analyzeSatArithmetic - implement comptime `+|`, `-|`, and `*|` - allow float operands to saturating arithmetic * `<<|` allows any integer type for the RHS. * C backend: fix rebase conflicts * LLVM backend: reduce the amount of branching for arithmetic ops * zig.h: fix magic number not matching actual size of C integer types
2021-09-28sat-arithmetic: langref - use <th> tagsTravis Staloch
2021-09-28sat-arithmetic: langref - remove syntax disclaimerTravis Staloch