Commit Graph

496 Commits

Author SHA1 Message Date
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
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
hryx
06bf918436 Sync grammar with spec
- Remove rule LabeledExpr
- Add rule CurlySuffixExpr
2019-04-24 14:38:56 -04:00
Matt Stancliff
3b6a4fe4cd Fix test in langref to assert against modified var 2019-04-18 16:14:30 -04:00
Andrew Kelley
b29241fc08
docs: update intro text 2019-04-16 14:23:58 -04:00
Duncan
a43fd7a550 Add favicon to langref.html 2019-04-13 16:20:33 -04:00
Andrew Kelley
e309ad884a
fix outdated/incorrect docs for @truncate
closes #2234
2019-04-10 23:00:53 -04:00
Jay Weisskopf
98fa065de7 docs: Underline link when hovering over it
In addition to the pointer, this gives some visual feedback to the user
that the element is interactive. This is a very common style pattern
across the web.
2019-04-09 00:31:25 -04:00
Andrew Kelley
974977f12f
docgen: add a space between the header and the section symbol 2019-04-05 23:12:25 -04:00
Andrew Kelley
f6be6ace1f
docgen: allow urls to have numbers 2019-04-05 17:33:58 -04:00
Andrew Kelley
a5b47bc2c2
docs: update @typeInfo definition and clarify field order 2019-04-05 12:38:15 -04:00
Jay Weisskopf
3cce56af99 docs: Use section symbol §, not paragraph symbol ¶
A header may cover more than one paragraph, so a section symbol is more appropriate. 

https://en.wikipedia.org/wiki/Section_sign
2019-04-05 11:09:38 -04:00
Andrew Kelley
7dd1e0fc2b
docs: add Variables section
closes #1927
2019-04-04 12:26:47 -04:00
Andrew Kelley
90b6eab05a
docs: complete the documentation for extern struct
closes #1522
2019-04-04 01:23:41 -04:00
Andrew Kelley
b60f2d0c9f
langref: rework the theming and layout
* Instead of the only color scheme being dark, the language reference
   now has a light theme by default, and respects the user's light/dark
   preference via prefers-color-scheme media query. Most browsers don't
   support this yet, so we just have to wait patiently for the future to
   arrive. closes #2172.

 * Instead of a side bar index, the index is inline with the rest of the
   content. This is simpler and more friendly to all user agents, and means
   we don't need the media query for mobile devices. It also makes
   back-references work, so now headers link to the table of contents
   and the table of contents links to headers.
2019-04-03 17:39:07 -04:00
Andrew Kelley
5aee17e888
regression fixes and fix packed struct abi size 2019-04-02 18:31:19 -04:00
MateuszOkulus
62af701804 Remove binary and octal float literals from documentation.
Part of #2093
2019-03-31 10:49:55 -04:00
Andrew Kelley
5eaead6a56
implement allowzero pointer attribute
closes #1953

only needed for freestanding targets.

also adds safety for `@intToPtr` when the address is zero.
2019-03-25 12:55:45 -04:00
Andrew Kelley
64dddd7afe
add compile error for ignoring error
closes #772
2019-03-23 19:33:00 -04:00
Andrew Kelley
4d50bc3f8d
add peer type resolution for *const T and ?*T
closes #1298
2019-03-23 18:48:12 -04:00
Andrew Kelley
89953ec83d
character literals: allow unicode escapes
also make the documentation for character literals more clear.
closes #2089

see #2097
2019-03-23 17:35:21 -04:00
Andrew Kelley
55cb9ef138
docs: clarify NaN, inf, -inf
closes #2089
2019-03-23 15:25:38 -04:00
Matt Stancliff
1ca78e39e4 Fix typos around pointer usage 2019-03-22 14:10:17 -04:00
Jimmi Holst Christensen
23af502d04 Updated langref to newest grammar 2019-03-22 09:01:30 +01:00
Andrew Kelley
246304125a
add documentation for zig test
closes #1518
2019-03-20 23:50:22 -04:00
Andrew Kelley
15c316b0d8
add docs for assembly and fix global assembly parsing
Previously, global assembly was parsed expecting it to have
the template syntax. However global assembly has no inputs,
outputs, or clobbers, and thus does not have template syntax.
This is now fixed.

This commit also adds a compile error for using volatile
on global assembly, since it is meaningless.

closes #1515
2019-03-20 19:00:23 -04:00
Andrew Kelley
3c36929603
zig targets prints the available libcs 2019-03-19 15:04:29 -04:00
Andrew Kelley
567175f833
add documentation for Memory
closes #1904
2019-03-18 21:40:24 -04:00
Andrew Kelley
080dd27157
breaking: fix @typeInfo handling of global error set type
`builtin.TypeInfo.ErrorSet` is now `?[]Error`
instead of `struct{errors:[]Error}`.

closes #1936
2019-03-14 11:57:56 -04:00
Andrew Kelley
85d0f0d45b
fix @setRuntimeSafety not able to override release modes 2019-03-13 14:46:53 -04:00
Andrew Kelley
0588fed15f
add documentation for pub
closes #1727
2019-03-13 13:05:23 -04:00
Andrew Kelley
4e40bd8633
add documentation for @"" syntax
closes #1614
2019-03-13 12:01:32 -04:00
Andrew Kelley
1a94dec50e
docs: finish initial documentation for implicit casts
closes #1514
2019-03-11 19:34:58 -04:00
Andrew Kelley
3ff0e8bd96
Revert "docgen: --cache off for tests"
This reverts commit 0a8a7a57e7.

This workaround is no longer necessary.
2019-03-11 10:35:42 -04:00
Andrew Kelley
918dbd4551
std.zig: this is no longer a keyword 2019-03-10 15:55:54 -04:00
Andrew Kelley
0a8a7a57e7
docgen: --cache off for tests 2019-03-09 11:29:15 -05:00
Andrew Kelley
94e52dba85
fix docgen and fix unnecessarily adding .root suffix to objects 2019-03-09 01:00:45 -05:00
Andrew Kelley
91955dee58
breaking changes to zig build API and improved caching
* in Zig build scripts, getOutputPath() is no longer a valid function
   to call, unless setOutputDir() was used, or within a custom make()
   function. Instead there is more convenient API to use which takes
   advantage of the caching system. Search this commit diff for
   `exe.run()` for an example.
 * Zig build by default enables caching. All build artifacts will go
   into zig-cache. If you want to access build artifacts in a convenient
   location, it is recommended to add an `install` step. Otherwise
   you can use the `run()` API mentioned above to execute programs
   directly from their location in the cache. Closes #330.
   `addSystemCommand` is available for programs not built with Zig
   build.
 * Please note that Zig does no cache evicting yet. You may have to
   manually delete zig-cache directories periodically to keep disk
   usage down. It's planned for this to be a simple Least Recently
   Used eviction system eventually.
 * `--output`, `--output-lib`, and `--output-h` are removed. Instead,
   use `--output-dir` which defaults to the current working directory.
   Or take advantage of `--cache on`, which will print the main output
   path to stdout, and the other artifacts will be in the same directory
   with predictable file names. `--disable-gen-h` is available when
   one wants to prevent .h file generation.
 * `@cImport` is always independently cached now. Closes #2015.
   It always writes the generated Zig code to disk which makes debug
   info and compile errors better. No more "TODO: remember C source
   location to display here"
 * Fix .d file parsing. (Fixes the MacOS CI failure)
 * Zig no longer creates "temporary files" other than inside a
   zig-cache directory.

This breaks the CLI API that Godbolt uses. The suggested new invocation
can be found in this commit diff, in the changes to `test/cli.zig`.
2019-03-08 23:23:11 -05:00