1927 Commits

Author SHA1 Message Date
Andrew Kelley
8d73703d52
fix safety for sentinel-slicing floats 2019-12-20 18:28:59 -05:00
Andrew Kelley
8918cb06fc
sentinel slicing improvements
* add runtime safety for slicing pointers, arrays, and slices.
 * slicing without a sentinel value results in non-sentineled slice
 * improved `std.debug.panic` handling of panic-during-panic
2019-12-20 18:28:59 -05:00
Andrew Kelley
26f3c2d061
fix std.mem.addNullByte and implement sentinel slicing
see #3770
2019-12-20 18:28:56 -05:00
LemonBoy
51cbd96820 Fix sentinel value of opaque pointers in typeInfo
Fixes #3888
2019-12-20 15:48:34 -05:00
LemonBoy
f077c3c4cc Fix comptime evaluation of runtime array access
Fix #3951
2019-12-20 15:47:43 -05:00
LemonBoy
d8499f7abe Make sure the fields array is always non-null
Fixes #3497
2019-12-17 15:45:22 -05:00
Andrew Kelley
496f271d17
Merge branch 'shawnl-lessThan'
* always allow integer comparison operations no matter the
   bit width, signedness, or comptime-ness of operands.
   closes #2133
 * implement comparisons for vectors, which returns vector of
   bools.

closes #3001
2019-12-16 11:39:13 -05:00
Andrew Kelley
1cad0acc7e
add behavior test for vector comparison 2019-12-16 11:22:28 -05:00
Andrew Kelley
9468d63819
allow comparison of any numeric types 2019-12-16 11:09:10 -05:00
Andrew Kelley
0f09ff4923
Merge pull request #3916 from Vexu/translate-c-2
Translate-c-2 macros
2019-12-16 10:55:32 -05:00
Vexu
04dc0bd0e4
translate-c-2 variable aliasing 2019-12-16 12:45:00 +02:00
Vexu
a37caaa528
translate-c-2 parameter name aliasing 2019-12-16 10:39:31 +02:00
Vexu
620bf695e8
organize tests 2019-12-16 07:43:18 +02:00
Vexu
0f38410ea6
improve extern enum 2019-12-15 19:28:53 -05:00
Vexu
ab60c8e28f
c tokenizer escape sequences 2019-12-16 00:55:50 +02:00
Vexu
9f0e83a571
translate-c-2 macro functions 2019-12-15 23:46:35 +02:00
LemonBoy
59de23dfa0 Don't assume TLS storage has a fixed address
Fixes #3433
2019-12-15 16:23:42 -05:00
LemonBoy
19ddbd9e9e Make sure the address is aligned for intToPtr ops
Closes #773
2019-12-15 14:41:05 -05:00
Vexu
ed2a19dcec
translate-c-2 macro cast 2019-12-15 21:32:30 +02:00
Vexu
57170f9eb6
translate-c-2 macro inline fn 2019-12-15 19:28:34 +02:00
Vexu
75218d4765
translate-c-2 macros 2019-12-15 14:44:11 +02:00
Vexu
e57e3602e7
translate-c-2 implement enums 2019-12-14 23:24:47 +02:00
Vexu
1f84586836
translate-c-2 avoid collisions with zig keywords 2019-12-14 17:00:10 +02:00
Vexu
4dae70e702
translate-c-2 container aliases 2019-12-14 13:40:33 +02:00
Vexu
a4ac6d15c4
translate-c-2 array initializer expr 2019-12-14 10:49:25 +02:00
Vexu
e4ca1f441b
translate-c-2 record type 2019-12-14 02:00:01 +02:00
Andrew Kelley
21a85d4fb6
Merge pull request #3896 from Vexu/translate-c-2
Translate-c self-hosted var decl and remove translate mode
2019-12-13 15:48:10 -05:00
Vexu
45abfa9e71
revert removal of translate mode in stage 1 2019-12-13 19:06:32 +02:00
Vexu
41a67126a5
translate-c-2 typedef 2019-12-13 17:40:37 +02:00
Vexu
eb057ef41c
translate-c-2 dont eval init expr 2019-12-13 15:07:10 +02:00
Andrew Kelley
e54c49be9b
uncomment a now-passing behavior test 2019-12-12 19:45:33 -05:00
Andrew Kelley
1e4bae6692
update stack traces tests 2019-12-12 19:43:04 -05:00
Vexu
0795f17db2
translate-c-2 incompleteArray 2019-12-12 21:39:04 +02:00
Vexu
c759a77aa0 fix dot init parsing 2019-12-12 13:06:48 -05:00
Vexu
3bca025091
update tests 2019-12-12 18:18:43 +02:00
Merlyn Morgan-Graham
12171dba92 Add function parameters to self-hosted translate-C 2019-12-10 23:52:40 -08:00
Andrew Kelley
80882bda59
load dynamic library test: update API usage code 2019-12-10 12:48:10 -05:00
Andrew Kelley
fd6b7b160d
improve dynamic library API 2019-12-10 12:28:28 -05:00
emekoi
29fd727b79
fixed windows dynamic library loading and added loading for darwin 2019-12-10 11:41:54 -05:00
Robin Voetter
4b4fbe3887
Replace @typeOf with @TypeOf in all zig source
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
2019-12-10 11:09:41 -05:00
Andrew Kelley
a3f6a58c77
remove var args from the language
closes #208
2019-12-09 15:27:27 -05:00
Andrew Kelley
f205d23e65
implement async function call with @call
this removes the last usage of var args in zig std lib
2019-12-09 15:27:26 -05:00
Andrew Kelley
69b587c1d3
add regression cases for now-passing tests
closes #2749
2019-12-09 15:23:51 -05:00
Andrew Kelley
5d82744f1c
ability to give comptime and non-comptime types to same parameter 2019-12-09 13:30:53 -05:00
Andrew Kelley
d571fad20e
update tests to new format API 2019-12-09 00:05:21 -05:00
Andrew Kelley
8b2622cdd5
std.fmt.format: tuple parameter instead of var args 2019-12-08 22:53:51 -05:00
Andrew Kelley
5874cb04bd
implement tuple concatenation 2019-12-08 22:44:41 -05:00
LemonBoy
d5e788072d
Make array types (quasi-)lazy
Fixes #3843
2019-12-08 17:29:59 -05:00
Andrew Kelley
1cb19d1a46
fix anon struct literal field initialized with fn call 2019-12-08 17:28:34 -05:00
Andrew Kelley
fe8d65556d
add syntax for comptime struct fields 2019-12-08 12:26:20 -05:00