Commit Graph

1332 Commits

Author SHA1 Message Date
Andrew Kelley c2cf04086a add docs for enum literals
closes #683
2019-07-03 23:09:58 -04:00
emekoi a1b952f4b0 added tests for #1107 and a note in the reference 2019-07-03 13:12:14 -05:00
Andrew Kelley 4bae87764f update @unionInit to integrate with result location semantics 2019-07-03 13:40:40 -04:00
Andrew Kelley df11512f85 fixups 2019-07-02 16:52:55 -04:00
Andrew Kelley 140335b99f Merge branch 'has-field' of https://github.com/shawnl/zig into shawnl-has-field 2019-07-02 16:21:40 -04:00
Andrew Kelley 04b32d6a8a docs: mention the standard library documentation
also mention the FAQ in the README.

also link to the other documentation versions.
2019-07-02 15:21:58 -04:00
emekoi 8156a61de8 fix syntax highlighting 2019-06-29 13:21:27 -04:00
Andrew Kelley 3085d29af8 Merge remote-tracking branch 'origin/master' into copy-elision-3 2019-06-26 14:44:01 -04:00
Andrew Kelley 33f996bb16 all tests passing on linux 2019-06-26 14:00:44 -04:00
Andrew Kelley b2cbc59e4c Merge branch 'simd2' of https://github.com/shawnl/zig into shawnl-simd2 2019-06-23 17:10:33 -04:00
Shawn Landden 71e014caec stage1: add @sin @cos @exp @exp2 @ln @log2 @log10 @fabs @floor @ceil @trunc @round
and expand @sqrt

This revealed that the accuracy of ln is not as good as the current algorithm in
musl and glibc, and should be ported again.

v2: actually include tests
v3: fix reversal of in and out arguments on f128M_sqrt()
    add test for @sqrt on comptime_float
    do not include @nearbyInt() until it works on all targets.
2019-06-22 14:34:34 -05:00
Sahnvour 987c209b40 heap: make one global instance of DirectAllocator
it is now stateless, so the de/init are not necessary anymore
2019-06-22 14:10:53 -04:00
Gray Olson be51511d29 Update langref.html.in 2019-06-22 01:15:47 -04:00
Shawn Landden fce2d2d18b stage1: add support for @mulAdd fused-multiply-add for floats and vectors of floats
Not all of the softfloat library is being built....

Vector support is very buggy at the moment, but should work when the bugs are fixed.
(as I had the same code working with another vector function, that hasn't been merged yet).
2019-06-19 12:07:02 -05:00
Boris 99112b5d4a fix tiny typo in langref.html.in 2019-06-18 10:01:48 -04:00
Andrew Kelley f8f054b354 fix @export for arrays not respecting the symbol name
Previously, the symbol name parameter of `@export` would be ignored for
variables, and the variable name would be used for the symbol name.
Now it works as expected.

See #2679
2019-06-14 17:23:24 -04:00
Nicholas Walton fcc0728a35 Update langref.html.in
Missing an "it"
2019-06-11 14:37:15 -04:00
Andrew Kelley b735764898 different array literal syntax when inferring the size
old syntax:  []i32{1, 2, 3}
new syntax: [_]i32{1, 2, 3}

closes #1797
2019-06-09 19:26:32 -04:00
markfirmware 10e33b3536 grammar 2019-06-09 01:34:13 -04:00
Jonathan Pentecost ad064b4a0b docs: update for else example
Updates: #2614
2019-06-08 22:58:31 -04:00
Shritesh Bhattarai 404e4b0268 docs: add comment about for else and break 2019-06-08 16:21:46 -04:00
Shritesh Bhattarai 6d73e5de05 doc: recommend optional pointers for nullptrs instead of allowzero 2019-05-31 02:26:19 -04:00
Andrew Kelley 78f32259da default struct field initialization expressions
closes #485
2019-05-30 15:46:11 -04:00
tgschultz f9e7bd2682 std.meta/trait: def/definition => decl/declaration
TypeInfo: defs/Definition => decls/Declarations
2019-05-29 20:43:07 -04:00
Andrew Kelley b7a82288ad change use to usingnamespace
See #2014

`use` syntax is still accepted for now. `zig fmt` automatically
updates code. After a release cycle the old syntax will be removed.
2019-05-29 19:09:58 -04:00
Andrew Kelley d1b6f29d22 Merge pull request #2523 from shritesh/wasmdoc
docs: wasm
2019-05-27 22:37:15 -04:00
Andrew Kelley abf959a0c9 fix debug builds of WASI 2019-05-27 02:16:05 -04:00
Andrew Kelley fda7e0bb01 std lib fixes for zig build on windows 2019-05-27 02:00:39 -04:00
Shawn Landden 5a91dbc16c allow const to be passed to @hasField()
Actually include the tests I wrote
2019-05-27 00:38:36 -05:00
Andrew Kelley 0c6ab61b22 tests passing on linux 2019-05-26 23:35:26 -04:00
Andrew Kelley 2f040a23c8 clean up references to os 2019-05-26 18:32:44 -04:00
Andrew Kelley daae7e1f5a more progress on posix API layer
see #2380
2019-05-26 18:32:43 -04:00
Andrew Kelley 67726e36b0 extract posix functions from std/os.zig to std/os/posix.zig
See #2380
2019-05-26 18:32:40 -04:00
Andrew Kelley 269a53b6af introduce @hasDecl builtin function
closes #1439
2019-05-26 16:21:03 -04:00
Shritesh Bhattarai b618a0b866 doc: wasm: embedded->host 2019-05-22 09:37:37 -07:00
Shritesh Bhattarai 9e65a144fa docs: clarify why wasm_allocator should be used 2019-05-22 07:43:17 -07:00
Shritesh Bhattarai 3b6fc3fdc7 docs: wasm 2019-05-19 19:32:28 -07:00
Andrew Kelley 80983ca1ca fixups to the previous commit 2019-05-16 16:37:58 -04:00
Shawn Landden 1fdb24827f breaking changes to all bit manipulation intrinsics
* `@clz`, `@ctz`, `@popCount`, `@bswap`, `@bitreverse` now
   have a type parameter
 * rename @bitreverse to @bitReverse
 * rename @bswap to @byteSwap

Closes #2119
Closes #2120
2019-05-16 16:37:58 -04:00
Shritesh Bhattarai 56a905c7d1 docgen: add lib codeblock type and use it for wasm32-freestanding 2019-05-16 14:58:10 -04:00
Jimmi Holst Christensen ba3d18a80e added grammar rule for enum literal to docs 2019-05-11 20:26:41 +02:00
Shawn Landden d1f9b8184d docs for @hasField 2019-05-06 11:58:04 -05:00
Shritesh Bhattarai 2f39da7cdd docgen: show -target command line argument 2019-05-03 15:56:33 -04:00
Shritesh Bhattarai 5c04c22bcc docgen: support wasm and wasi 2019-05-03 15:56:33 -04:00
Andrew Kelley 8cda4fd73a docs: remove @setGlobalLinkage section
`@setGlobalLinkage` was removed with #462. The not-yet-implemented
proposal for external weak symbols is #1917.
2019-05-03 13:38:24 -04:00
Andrew Kelley f8117a0799 docs: update for shared libraries 2019-05-02 12:00:16 -04:00
Andrew Kelley 6e4f69a54a docgen: add exe_build_err tag 2019-05-01 15:34:36 -04:00
Andrew Kelley 54a93e5393 docs: add note to @setRuntimeSafety 2019-05-01 15:09:03 -04:00
Shritesh Bhattarai efc5122fb6 docgen: properly close tags for skipped execs 2019-04-26 19:33:33 -04:00
Andrew Kelley fb2acaff06 @sizeOf returns 0 for comptime types
This defines `@sizeOf` to be the runtime size of a type, which means
that it is zero for types such as comptime_int, type, and (enum
literal).

See #2209
2019-04-24 22:31:53 -04:00