Andrew Kelley
85422d7aea
Merge pull request #1136 from alexnask/typeinfo_improvements
...
@typeInfo now uses optional types instead of @typeOf(undefined)
2018-06-19 11:46:32 -04:00
Alexandros Naskos
811539f8ee
Added missing ?type in docs.
2018-06-19 17:49:48 +03:00
Alexandros Naskos
1392313236
@typeInfo now uses optional types instead of @typeOf(undefined)
2018-06-19 17:45:19 +03:00
Andrew Kelley
a3ddd0826b
remove enum to/from int casting syntax; add @enumToInt
/@intToEnum
...
see #1061
2018-06-19 03:50:38 -04:00
Andrew Kelley
626b73e8be
remove error to/from int casting syntax; add @errorToInt
/@intToError
...
See #1061
2018-06-18 18:48:29 -04:00
Andrew Kelley
1aafbae5be
remove []u8 casting syntax. add @bytesToSlice
and @sliceToBytes
...
See #1061
2018-06-18 17:25:29 -04:00
Andrew Kelley
5d705fc6e3
remove error set casting syntax. add @errSetCast
...
See #1061
2018-06-18 15:01:42 -04:00
Andrew Kelley
48985a7e68
langref: add docs for void
...
see #367
2018-06-18 12:02:30 -04:00
Andrew Kelley
4210f1f6a0
remove bool to int syntax. add @boolToInt
...
add missing docs
See #1061
2018-06-18 03:07:16 -04:00
Andrew Kelley
7912061226
remove integer and float casting syntax
...
* add `@intCast`
* add `@floatCast`
* add `@floatToInt`
* add `@intToFloat`
See #1061
2018-06-17 02:57:07 -04:00
Andrew Kelley
751518787a
Merge pull request #1109 from ziglang/pass-by-non-copying-value
...
allow passing by non-copying value
2018-06-16 21:13:10 -04:00
Andrew Kelley
eae9634ac9
langref: be clear that float types are always IEEE 754
2018-06-16 19:53:52 -04:00
Andrew Kelley
59b3dc8907
allow passing by non-copying value
...
closes #733
2018-06-16 19:36:33 -04:00
Andrew Kelley
f0697c28f8
langref: docs for error return traces
...
See #367
2018-06-14 18:12:31 -04:00
Andrew Kelley
41e6c664d8
langref: add merge error sets operator to operator table
2018-06-13 11:09:41 -04:00
Andrew Kelley
86adc1ef39
add docs and missing test case for merging error sets
...
See #367
2018-06-12 19:38:59 -04:00
Andrew Kelley
0a18d53c3d
langref: add orelse keyword to syntax highlighting
2018-06-11 17:38:24 -04:00
Andrew Kelley
5252566137
langref: add coroutines documentation
...
See #367
2018-06-11 17:34:45 -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
ec1b6f6673
breaking syntax change: ??x to x.? ( #1095 )
...
See #1023
This also renames Nullable/Maybe to Optional
2018-06-09 23:42:14 -04:00
Andrew Kelley
b65203f573
remove @canImplicitCast builtin
...
nobody will miss it
2018-06-07 19:50:25 -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
Jimmi HC
a8146ade2a
Renamed UndefinedLiteral to Undefined
2018-06-05 11:54:11 +02:00
Jimmi HC
236c680f6b
Removed NullLiteral to Null
2018-06-05 11:30:01 +02:00
Jimmi HC
02cb220faf
Renamed "(int/float literal)" to "comptime_int/float"
2018-06-05 11:14:43 +02:00
Andrew Kelley
e53b683bd3
Pointer Reform: proper slicing and indexing ( #1053 )
...
* enable slicing for single-item ptr to arrays
* disable slicing for other single-item pointers
* enable indexing for single-item ptr to arrays
* disable indexing for other single-item pointers
see #770
closes #386
2018-06-04 22:11:14 -04:00
Andrew Kelley
96164ce613
disallow single-item pointer indexing
...
add pointer arithmetic for unknown length pointer
2018-06-04 01:39:57 -04:00
Andrew Kelley
f06bce5dda
introduce [*] for unknown length pointers
...
See #770
Currently it does not have any different behavior than `*`
but it is now recommended to use `[*]` for unknown length
pointers to be future-proof.
Instead of [ * ] being separate tokens as the proposal
suggested, this commit implements `[*]` as a single token.
2018-06-02 04:04:23 -04:00
Andrew Kelley
081072d3b6
docs: add missing builtin to langref syntax coloring
2018-06-01 12:22:53 -04:00
Andrew Kelley
fcbb7426fa
use * for pointer type instead of &
...
See #770
To help automatically translate code, see the
zig-fmt-pointer-reform-2 branch.
This will convert all & into *. Due to the syntax
ambiguity (which is why we are making this change),
even address-of & will turn into *, so you'll have
to manually fix thes instances. You will be guaranteed
to get compile errors for them - expected 'type', found 'foo'
2018-05-31 17:28:07 -04:00
Andrew Kelley
43085417be
update github.com/zig-lang to github.com/ziglang
2018-05-24 21:27:44 -04:00
Andrew Kelley
fa5b0ef54f
doc fixups
2018-05-24 20:59:19 -04:00
braedonww@gmail.com
938d791b23
Added argtype and error inferring info
2018-05-24 20:20:07 -04:00
Andrew Kelley
c38b165db4
all tests passing with postfix deref syntax
2018-05-17 23:21:44 -04:00
Andrew Kelley
86a352c45b
Merge branch 'master' into pointer-reform
2018-05-13 13:38:03 -04:00
Andrew Kelley
a6ae45145f
add @newStackCall builtin function
...
See #1006
2018-05-12 17:35:15 -04:00
Andrew Kelley
6928badd85
Merge branch 'master' into pointer-reform
2018-05-09 23:43:07 -04:00
Alexandros Naskos
57940837e7
Added typeInfo to langref built_ins
2018-05-01 13:44:19 +03:00
Alexandros Naskos
7d239414f7
Fixed type info test, added documentation.
2018-05-01 13:42:20 +03:00
Andrew Kelley
76ab1d2b6c
support foo.* for ptr deref
...
See #770
2018-04-30 14:20:56 -04:00
Jimmi Holst Christensen
72bf9d90cc
Added builtin field to docs
2018-04-19 21:48:09 +02:00
Andrew Kelley
06909ceaab
support break in suspend blocks
...
* you can label suspend blocks
* labeled break supports suspend blocks
See #803
2018-04-18 22:21:54 -04:00
Andrew Kelley
f1f998e071
improve cmpxchg
...
* remove @cmpxchg, add @cmpxchgWeak and @cmpxchgStrong
- See explanations in the langref.
* add operand type as first parameter
* return type is ?T where T is the operand type
closes #461
2018-04-18 12:16:42 -04:00
Andrew Kelley
b9360640ce
add @atomicLoad builtin
...
See #174
2018-04-15 18:12:00 -04:00
Andrew Kelley
b5459eb987
add @sqrt built-in function
...
See #767
2018-04-15 13:26:58 -04:00
Andrew Kelley
292d0cbdad
add docs for union methods
2018-04-08 18:03:09 -04:00
Andrew Kelley
eae355d771
add docs for packed enum
2018-04-08 18:03:09 -04:00
Marc Tiehuis
7d66908f29
docs: fix unclosed code tag
2018-03-31 23:17:02 +13:00
Jay Weisskopf
3e836f5516
doc: fix typo and tighten wording in error sections
...
Changes:
- Removed superfluous "when possible"
- Fixed typo in "documentationt"
- Added missing comma
- Moved definition of error union type up to first sentence
2018-03-25 18:48:07 -04:00
Andrew Kelley
897e783763
add promise->T syntax parsing
...
closes #857
2018-03-24 19:25:53 -04:00
Andrew Kelley
7a99d63c76
ability to use async function pointers
...
closes #817
2018-03-22 16:56:03 -04:00
Andrew Kelley
f885a1ab61
change async function call syntax
...
* instead of `async(allocator) call()`, now it is
`async<allocator> call()`.
* Fixes syntax ambiguity when leaving off the allocator
* Fixes parse failure when call is a field access
This sets a precedent for using `<` to pass arguments
to a keyword. This will affect `enum`, `union`, and
`fn` (see #661 )
2018-03-21 19:56:41 -04:00
Tesla Ice Zhang
c4544df011
Remove unnecessary rule and re-fix an old bug
...
The "old bug" is cause my last pr. I'm fixing it now.
2018-03-20 03:00:11 +08:00
Tesla Ice Zhang
cc6ac77913
Fix some explicit errors
2018-03-17 23:17:07 +08:00
Andrew Kelley
50e25f6cec
add missing docs for setAlignStack builtin
2018-03-14 21:51:06 -04:00
Andrew Kelley
eff3530dfa
var is no longer a pseudo-type, it is syntax
...
closes #779
2018-03-06 18:31:31 -05:00
Andrew Kelley
de5c0c9f40
Merge remote-tracking branch 'origin/master' into async
2018-03-01 20:47:35 -05:00
Andrew Kelley
8429d4ceac
implement coroutine resume
2018-02-28 22:18:48 -05:00
Andrew Kelley
807a5e94e9
add atomicrmw builtin function
2018-02-28 21:19:51 -05:00
Andrew Kelley
c60496a297
parse await and suspend syntax
...
See #727
2018-02-26 00:04:11 -05:00
Andrew Kelley
8db7a1420f
update errors section of docs
...
closes #768
2018-02-23 20:43:47 -05:00
Andrew Kelley
236bbe1183
implement IR analysis for async function calls
...
See #727
2018-02-21 00:52:20 -05:00
Andrew Kelley
a06f3c74fd
parse async fn definitions
...
See #727
2018-02-20 00:31:52 -05:00
Andrew Kelley
3d58d7232a
parse async fn calls and cancel expressions
2018-02-20 00:05:38 -05:00
Andrew Kelley
ee982ae162
syntax: parse ?error!i32
as ?(error!i32)
2018-02-08 22:30:08 -05:00
Andrew Kelley
f9be970375
Merge remote-tracking branch 'origin/master' into error-sets
2018-02-08 20:45:26 -05:00
Andrew Kelley
76239f2089
error sets - update langref. all tests passing
2018-02-08 03:02:41 -05:00
Andrew Kelley
b8f59e14cd
*WIP* error sets - correctly resolve inferred error sets
2018-02-02 18:13:32 -05:00
Andrew Kelley
5f518dbeb9
*WIP* error sets converting std lib
2018-01-31 22:48:40 -05:00
Andrew Kelley
02b61224b2
add docs for memberType, memberCount, memberName
2018-01-31 20:56:53 -05:00
Andrew Kelley
e6d4028a84
docs: move source encoding section
2018-01-31 20:42:27 -05:00
Andrew Kelley
3a11757d57
add docs recommending to only have 1 cImport
2018-01-31 20:18:47 -05:00
Andrew Kelley
a795e4ce32
add some docs for reflection
2018-01-31 11:47:56 -05:00
Andrew Kelley
5161d70620
*WIP* error sets
2018-01-31 01:51:31 -05:00
Andrew Kelley
0995a81b8b
langref: remove page title header
2018-01-30 10:31:01 -05:00
Marc Tiehuis
5e9f87c3bd
Improve documentation styling for mobile devices
...
- No overscrolling on small screens
- Font-size is reduced for more content per screen
- Tables + Code blocks scroll within a block to avoid page-widenening
2018-01-30 17:33:38 +13:00
Andrew Kelley
3671582c15
syntax: functions require return type. remove ->
...
The purpose of this is:
* Only one way to do things
* Changing a function with void return type to return a possible
error becomes a 1 character change, subtly encouraging
people to use errors.
See #632
Here are some imperfect sed commands for performing this update:
remove arrow:
```
sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig")
```
add void:
```
sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig")
```
Some cleanup may be necessary, but this should do the bulk of the work.
2018-01-25 04:10:11 -05:00
Andrew Kelley
e5bc5873d7
rename "debug safety" to "runtime safety"
...
closes #437
2018-01-25 01:46:12 -05:00
Andrew Kelley
b71a56c9df
cleanups that I meant to put in the previous commit
2018-01-23 23:12:38 -05:00
Andrew Kelley
b3a6faf13e
replace %defer with errdefer
...
See #632
now we have 1 less sigil
2018-01-23 23:08:09 -05:00
Andrew Kelley
fa7072f3f2
docgen: verify internal links
2018-01-22 23:06:07 -05:00
Andrew Kelley
cf39819478
add new kind of test: generating .h files. and more
...
* docgen supports obj_err code kind for demonstrating
errors without explicit test cases
* add documentation for `extern enum`. See #367
* remove coldcc keyword and add @setIsCold. See #661
* add compile errors for non-extern struct, enum, unions
in function signatures
* add .h file generation for extern struct, enum, unions
2018-01-22 22:24:07 -05:00
Andrew Kelley
ddd04a7b46
fix docgen on windows
2018-01-19 22:17:31 -05:00
Andrew Kelley
2c25c8aeed
docs: remove references to %% prefix operator
...
also cleanup the table of contents
2018-01-19 03:47:27 -05:00
Andrew Kelley
ea623f2d39
all doc code examples are now tested
...
improve color scheme of docs
make docs depend on no external files
fix broken example code in docs
closes #465
2018-01-19 03:21:47 -05:00
Andrew Kelley
2e6125bc66
ziglang.org home page no longer in this repo
...
update docs examples which use build-exe to be tested
See #465
2018-01-17 03:24:49 -05:00
Andrew Kelley
1eda7e0fde
docgen: support executing exe code examples
...
See #465
2018-01-17 01:50:35 -05:00
Andrew Kelley
5aefabe045
docgen: validate See Also sections
...
See #465
2018-01-17 00:22:53 -05:00
Andrew Kelley
2774fe8a1b
docgen auto generates table of contents
...
See #465
2018-01-17 00:22:53 -05:00
Andrew Kelley
7b57454cc1
clean up error return tracing
...
* error return tracing is disabled in release-fast mode
* add @errorReturnTrace
* zig build API changes build return type from `void` to `%void`
* allow `void`, `noreturn`, and `u8` from main. closes #535
2018-01-15 00:01:02 -05:00
Andrew Kelley
3c094116aa
remove %% prefix operator
...
See #632
closes #545
closes #510
this makes #651 higher priority
2018-01-09 00:51:51 -05:00
Andrew Kelley
632d143bff
replace a %% b
with a catch b
...
See #632
better fits the convention of using keywords for control flow
2018-01-07 17:28:20 -05:00
Andrew Kelley
66717db735
replace %return
with try
...
See #632
better fits the convention of using keywords for control flow
2018-01-07 16:53:13 -05:00
Andrew Kelley
32ba0dcea9
update hello world docs
2018-01-07 01:59:23 -05:00
Andrew Kelley
5c8600d790
add december in review to reading material; fix docs
2018-01-03 21:11:58 -05:00
Andrew Kelley
6281a511e1
add noInlineCall to docs
2018-01-03 03:27:48 -05:00
Andrew Kelley
d9d61ed563
doc fixes
2018-01-03 02:51:45 -05:00
Josh Wolfe
192a039173
move utf8 parsing to std
...
source files no longer need to end with a newline
2017-12-26 23:17:33 -07:00
Andrew Kelley
86397a532e
docs: fix typo
2017-12-24 02:52:30 -05:00
Josh Wolfe
f0a1753607
add source encoding rules to the docs. see #663
2017-12-23 22:23:06 -07:00