Commit Graph

418 Commits

Author SHA1 Message Date
Andrew Kelley 73e535e112 Merge pull request #3683 from Vexu/atomic-float
Support floats with some atomic operations
2019-12-30 19:19:05 -05:00
Andrew Kelley a05150e92d fix comparing comptime_int against undefined literal
closes #4004
2019-12-30 19:08:57 -05:00
LemonBoy c1ee846c22 Fix ptrCast of zero-sized type
Closes #2431
2019-12-30 17:43:58 -05:00
Vexu ab7fc33c83 add zig llvm wrapper for atomicrmw 2019-12-23 11:55:00 +02:00
Vexu 8bb1e04449 support some atomic operations with floats 2019-12-23 11:54:47 +02:00
Andrew Kelley 26f3c2d061 fix std.mem.addNullByte and implement sentinel slicing
see #3770
2019-12-20 18:28:56 -05:00
Andrew Kelley 9468d63819 allow comparison of any numeric types 2019-12-16 11:09:10 -05:00
Vexu 0f38410ea6 improve extern enum 2019-12-15 19:28:53 -05:00
LemonBoy 19ddbd9e9e Make sure the address is aligned for intToPtr ops
Closes #773
2019-12-15 14:41:05 -05:00
Vexu c759a77aa0 fix dot init parsing 2019-12-12 13:06:48 -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 8b2622cdd5 std.fmt.format: tuple parameter instead of var args 2019-12-08 22:53:51 -05:00
Andrew Kelley fe8d65556d add syntax for comptime struct fields 2019-12-08 12:26:20 -05:00
Andrew Kelley 656cc33f8d allow calling with a new stack to regress a bit
Calling with a new stack, with a runtime-known stack pointer (e.g.
not a global variable) is regressed with this branch. It is now a
compile-error, due to the Runtime Hint system not being smart enough
to mix a compile-time modifier field with a runtime stack field.
I'm OK with this regression because this feature is flawed (see #3268)
and may be deleted from the language.
2019-12-06 15:25:00 -05:00
Andrew Kelley 71b7f4b47f remove @newStackCall from zig 2019-12-06 14:52:09 -05:00
Andrew Kelley ef83358eb6 remove @noInlineCall from zig 2019-12-05 17:37:29 -05:00
Andrew Kelley 1f602fe8c5 implement @call
closes #3732
2019-12-05 17:07:15 -05:00
Andrew Kelley 6a046c1bcd activate start code when pub main exists
and rename LinkType->LinkMode, OutType->OutputMode
2019-12-03 12:50:42 -05:00
Vexu ffd21c586d fix tests 2019-12-03 12:50:42 -05:00
Vexu 20bcdab462 correct caching and add test for missing fn name 2019-12-03 12:50:41 -05:00
LemonBoy fd7c7be33c Pick up WinMain with proper CC 2019-12-03 12:49:08 -05:00
Andrew Kelley c32e50f505 fix regressions in compile error tests 2019-12-01 20:53:24 -05:00
Andrew Kelley b36c07a95a Merge remote-tracking branch 'origin/master' into remove-array-type-coercion 2019-12-01 09:56:01 -05:00
Andrew Kelley f980c29306 fix typo in error note for integer casting 2019-11-29 22:33:55 -05:00
Andrew Kelley 8ecd6c4d8c add compiler note for bad int coercion
closes #3724
2019-11-26 19:50:52 -05:00
Vexu 379d547603 add missing cast to generic function call result 2019-11-26 14:32:37 -05:00
Vexu 0e405c5fc5 add missing cast to call result type 2019-11-26 14:32:34 -05:00
Andrew Kelley 4261fa3c49 move logic to the appropriate layers; add new compile error 2019-11-25 18:46:17 -05:00
Andrew Kelley 34b1ebefaa Merge remote-tracking branch 'origin/master' into null-terminated-pointers 2019-11-24 20:28:46 -05:00
Andrew Kelley b9f88c3552 fix compile errors for array sentinels mismatching 2019-11-24 20:25:14 -05:00
Andrew Kelley 217a5090ff fix compile error regressions 2019-11-24 18:10:31 -05:00
Andrew Kelley c96d565166 add compile error for incompatible pointer sentinels 2019-11-24 17:02:56 -05:00
Andrew Kelley 4c7b52503b all tests passing 2019-11-24 02:14:21 -05:00
Vexu 4d9318cee0 fix missing implicit cast in return instruction 2019-11-21 23:21:51 -05:00
Timon Kruiper 94299d16d1 Stage1: Add compile error for an empty switch on a integer 2019-11-22 04:00:47 +00:00
Andrew Kelley fd6020c4e2 update tests, better error messages, update self-hosted tokenizer 2019-11-21 20:43:41 -05:00
Andrew Kelley 47f06be369 string literals are now null terminated
this also deletes C string literals from the language, and then makes
the std lib changes and compiler changes necessary to get the behavior
tests and std lib tests passing again.
2019-11-21 20:43:41 -05:00
Andrew Kelley 1aa978f32e implement null terminated pointers 2019-11-21 20:43:41 -05:00
Andrew Kelley 0c33ebb38e add regression test case. closes #2980 2019-11-18 19:59:03 -05:00
Andrew Kelley 21aed86a4a add regression test case
closes #3097
2019-11-18 17:31:35 -05:00
LemonBoy 924dd674e2 Catch invalid type from peer resolution
Fixes #3703
2019-11-17 22:25:14 +00:00
Vexu b83ce08a3b add compile error for @atomicRmw on enum not being an .Xchg 2019-11-13 18:48:31 +00:00
Andrew Kelley 8bae70454d Merge pull request #3675 from Vexu/atomic-store
Add @atomicStore builtin
2019-11-13 03:06:55 +00:00
Andrew Kelley 37318bf151 fn parameters participate in result location semantics
See #3665
2019-11-12 18:55:17 -05:00
Vexu 41914321b4 fix comptime atomicStore and add tests 2019-11-13 01:32:16 +02:00
Andrew Kelley a33b9aec72 add test for missing const in slice with nested array type 2019-11-11 18:01:27 -05:00
Andrew Kelley 5b27943498 implement anon struct literal syntax
This implements stage1 parser support for anonymous struct literal
syntax (see #685), as well as semantic analysis support for anonymous
struct literals and anonymous list literals (see #208). The semantic
analysis works when there is a type coercion in the result location;
inferring the struct type based on the values in the literal is not
implemented yet. Also remaining to do is zig fmt support for this new
syntax and documentation updates.
2019-11-11 13:11:58 -05:00
Andrew Kelley 3cf5c2c62b fix regressed tests and update docs to use "type coercion" 2019-11-08 15:57:25 -05:00
Andrew Kelley aa0daea541 update more of the std lib to use @as 2019-11-08 15:57:25 -05:00