Commit Graph

74 Commits

Author SHA1 Message Date
Andrew Kelley
8ea8cff491
slightly simpler implementation 2019-07-19 17:54:06 -04:00
Benjamin Feng
111d3792e0
Docgen invalid for && 2019-07-19 17:11:58 -04:00
hryx
28b59a0be7
Remove reference to Keyword_anyerror in docgen 2019-07-06 18:19:04 -07: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
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
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
2f040a23c8
clean up references to os 2019-05-26 18:32:44 -04:00
Shritesh Bhattarai
56a905c7d1 docgen: add lib codeblock type and use it for wasm32-freestanding 2019-05-16 14:58:10 -04: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
6e4f69a54a
docgen: add exe_build_err tag 2019-05-01 15:34:36 -04:00
Shritesh Bhattarai
efc5122fb6 docgen: properly close tags for skipped execs 2019-04-26 19:33:33 -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
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
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
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
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
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
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
ade10387a5
breaking changes to the way targets work in zig
* CLI: `-target [name]` instead of `--target-*` args.
   This matches clang's API.
 * `builtin.Environ` renamed to `builtin.Abi`
   - likewise `builtin.environ` renamed to `builtin.abi`
 * stop hiding the concept of sub-arch. closes #1526
 * `zig targets` only shows available targets. closes #438
 * include all targets in readme, even those that don't
   print with `zig targets` but note they are Tier 4
 * refactor target.cpp and make the naming conventions
   more consistent
 * introduce the concept of a "default C ABI" for a given
   OS/Arch combo. As a rule of thumb, if the system compiler
   is clang or gcc then the default C ABI is the gnu ABI.
2019-02-26 15:58:10 -05:00
Andrew Kelley
6769183a9d
fix implicit cast error unions with non-optional to optional pointer
and update self hosted compiler for C pointers

See #1059
2019-02-14 15:48:28 -05:00
Andrew Kelley
a8a63feba7
docgen: update for threadlocal keyword 2019-02-09 00:28:12 -05:00
Andrew Kelley
d6f2af378a
fix docs
broken by c2db077574
2019-02-08 19:38:16 -05:00
Andrew Kelley
c2db077574
std.debug.assert: remove special case for test builds
Previously, std.debug.assert would `@panic` in test builds,
if the assertion failed. Now, it's always `unreachable`.

This makes release mode test builds more accurately test
the actual code that will be run.

However this requires tests to call `std.testing.expect`
rather than `std.debug.assert` to make sure output is correct.

Here is the explanation of when to use either one, copied from
the assert doc comments:

Inside a test block, it is best to use the `std.testing` module
rather than assert, because assert may not detect a test failure
in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert
is the correct function to use.

closes #1304
2019-02-08 18:23:38 -05:00
Andrew Kelley
36bade5c56
fixups, and modify std.mem.join and std.os.path.resolve API
* zig fmt
 * std.mem.join takes a slice of slices instead of var args
 * std.mem.join takes a separator slice rather than byte,
   and always inserts it. Previously it would not insert the separator
   if there already was one, violating the documented behavior.
 * std.mem.join calculates exactly the correct amount to allocate
   and has no call to allocator.shrink()
 * bring back joinWindows and joinPosix and the corresponding tests.
   it is intended to be able to call these functions from any OS.
 * rename std.os.path.resolveSlice to resolve (now resolve takes
   a slice of slices instead of var args)
2019-02-07 00:42:41 -05:00
kristopher tate
2b78a90424
std.os.path: remove dependance on std.mem.join;
std/os/child_process.zig: windows

test/cli.zig: godbolt;

doc/docgen.zig
2018-11-30 03:52:27 +09:00
Andrew Kelley
704374e512
rename section keyword to linksection
add zig fmt support for this syntax

closes #1152
2018-11-17 01:38:35 -05:00
Jimmi Holst Christensen
8139c5a516
New Zig formal grammar (#1685)
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-11-13 05:08:37 -08:00
emekoi
d7cec5b37c fixes #1667 2018-10-23 21:29:04 -04:00
Andrew Kelley
d5648d2640
remove implicit cast from T to *const T
closes #1465
2018-10-15 18:23:47 -04:00
Jimmi Holst Christensen
378d3e4403
Solve the return type ambiguity (#1628)
Changed container and initializer syntax
* <container> { ... } -> <container> . { ... }
* <exrp> { ... } -> <expr> . { ...}
2018-10-15 09:51:15 -04:00
Andrew Kelley
9d4eaf1e07
update std lib API for I/O
std.io.FileInStream -> std.os.File.InStream
std.io.FileInStream.init(file) -> file.inStream()
std.io.FileOutStream -> std.os.File.OutStream
std.io.FileOutStream.init(file) -> file.outStream()

remove a lot of error code possibilities from os functions

std.event.net.socketRead -> std.event.net.read
std.event.net.socketWrite -> std.event.net.write
add std.event.net.readv
add std.event.net.writev
add std.event.net.readvPosix
add std.event.net.writevPosix
add std.event.net.OutStream
add std.event.net.InStream

add std.event.io.InStream
add std.event.io.OutStream
2018-09-30 17:28:35 -04:00
Andrew Kelley
839492d0e8
fix not syntax highlighting builtin module 2018-09-25 12:03:09 -04:00
Andrew Kelley
6dd93ee5d9
fix regression from previous commit 2018-09-18 18:56:29 -04:00
Andrew Kelley
5e39328542
docs: more syntax highlighting 2018-09-14 10:35:03 -04:00
Andrew Kelley
0dbbc91bc9
docs: langref is now javascript-free 2018-09-12 17:27:10 -04:00
Andrew Kelley
15c67d2d50
fix docgen tests 2018-09-11 16:52:50 -04:00
Andrew Kelley
832caefc2a fix regressions 2018-09-02 18:35:32 -04:00
Andrew Kelley
ea1b21dbdb fix linux
* error.BadFd is not a valid error code. it would always be a bug to
   get this error code.
 * merge error.Io with existing error.InputOutput
 * merge error.PathNotFound with existing error.FileNotFound.
   Not all OS's support both.
 * add os.File.openReadC
 * add error.BadPathName for windows file operations with invalid
   characters
 * add os.toPosixPath to help stack allocate a null terminating byte
 * add some TODOs for other functions to investigate removing the
   allocator requirement
 * optimize some implementations to use the alternate functions when
   a null byte is already available
 * add a missing error.SkipZigTest
 * os.selfExePath uses a non-allocating API
 * os.selfExeDirPath uses a non-allocating API
 * os.path.real uses a non-allocating API
 * add os.path.realAlloc and os.path.realC
 * convert many windows syscalls to use the W versions (See #534)
2018-08-21 20:31:50 -04:00
Andrew Kelley
d40f3fac74 docgen: fix usage of std.HashMap 2018-08-10 00:03:16 -04:00
Andrew Kelley
05f1ea33d2 ZIG_DEBUG_COLOR=1 overrides tty detection for runtime stack traces 2018-07-09 12:12:37 -04:00
Andrew Kelley
13d3255e2a docgen: don't leave garbage .h files lying around
closes #1100
2018-06-12 15:21:14 -04:00
Andrew Kelley
3dd9af9948 implement std.os.Dir for windows
improve std.os.File.access so that it does not depend on shlwapi.dll

closes #1084
2018-06-12 01:57:09 -04:00
Andrew Kelley
77678b2cbc
breaking syntax change: orelse keyword instead of ?? (#1096)
use the `zig-fmt-optional-default` branch to have zig fmt
automatically do the changes.

closes #1023
2018-06-10 01:13:51 -04:00
Andrew Kelley
688ff2830d langref: automatic update of builtin.zig
now the docs can't get out of date for this

See #367
2018-06-07 19:10:45 -04:00