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
Andrew Kelley
119ed128c0
implement comptime struct fields
2019-12-08 12:26:20 -05:00
LemonBoy
19c1b5a33a
Fix for @Type not picking up the sentinel value
...
The code converted the whole TypeInfo payload into an optional type
instead of using the "sentinel" field value.
Fixes #3828
2019-12-08 10:28:29 -05:00
Andrew Kelley
edebe0586b
remove compile error for peer result comptime_int and null
...
closes #2763
2019-12-07 13:03:43 -05:00
Andrew Kelley
ecb77af534
add regression test for fixed bug
...
closes #3742
2019-12-06 17:20:27 -05:00
Andrew Kelley
525b1e8fb4
Merge pull request #3856 from ziglang/builtin-call
...
introduce `@call` and remove other builtin calls
2019-12-06 15:49:47 -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
343987cd05
remove @inlineCall
from zig
2019-12-06 14:12:01 -05:00
Andrew Kelley
b1895da9b8
add behavioral test case for previous commit
2019-12-06 12:27:56 -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
621c08e692
exported main must be pub
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
6d8550a7df
fix crash assigning optional struct with anon literal
...
closes #3827
2019-12-02 01:09:06 -05:00
Andrew Kelley
c32e50f505
fix regressions in compile error tests
2019-12-01 20:53:24 -05:00
Andrew Kelley
080316cd4f
fix assigning to an unwrapped optional field in an inline loop
2019-12-01 18:55:35 -05:00
Andrew Kelley
8524404f71
this test isn't passing in master branch either
2019-12-01 16:39:30 -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
951dc451d6
Merge pull request #3808 from LemonBoy/i386-for-ya
...
linux-i386 support
2019-11-30 22:00:00 -05:00
LemonBoy
cdeafe777a
Eat shit and die mips
2019-11-30 21:36:16 +01:00
Andrew Kelley
413f9a5cfc
move std.fs.Dir.cwd
to std.fs.cwd
...
update to non-deprecated std.fs APIs throughout the codebase
Related: #3811
2019-11-30 15:35:27 -05:00
LemonBoy
d0c6728d59
Eat shit and die glibc
2019-11-30 18:55:22 +01:00
LemonBoy
e1e06e6766
linux-i386 support
2019-11-30 16:13:33 +01:00
Andrew Kelley
85e1e3b95f
Merge pull request #3284 from Sahnvour/export_variables
...
Improved support for exporting variables
2019-11-30 00:25:52 -05:00
Andrew Kelley
b220be7a33
more test regression fixes
2019-11-29 23:04:19 -05:00
Andrew Kelley
f980c29306
fix typo in error note for integer casting
2019-11-29 22:33:55 -05:00
Andrew Kelley
815b4cfd9d
fix return result loc as peer result loc in inferred error set function
2019-11-29 18:21:21 -05:00
Andrew Kelley
bcdb3a9006
more progress
2019-11-28 00:02:53 -05:00
Andrew Kelley
bf3ac66150
remove type coercion from array values to references
...
* Implements #3768 . This is a sweeping breaking change that requires
many (trivial) edits to Zig source code. Array values no longer
coerced to slices; however one may use `&` to obtain a reference to
an array value, which may then be coerced to a slice.
* Adds `IrInstruction::dump`, for debugging purposes. It's useful to
call to inspect the instruction when debugging Zig IR.
* Fixes bugs with result location semantics. See the new behavior test
cases, and compile error test cases.
* Fixes bugs with `@typeInfo` not properly resolving const values.
* Behavior tests are passing but std lib tests are not yet. There
is more work to do before merging this branch.
2019-11-27 03:37:50 -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
cb38bd0a14
rename std.heap.direct_allocator to std.heap.page_allocator
...
std.heap.direct_allocator is still available for now but it is marked
deprecated.
2019-11-25 17:25:06 -05:00
Andrew Kelley
15d415e10b
make std.mem.toSlice use null terminated pointers
...
and fix the fallout
2019-11-24 21:21:05 -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
ce96323ba1
update cli test
2019-11-24 19:24:52 -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
4018034708
add test cases for arbitrary pointer sentinels
2019-11-24 16:52:32 -05:00
Andrew Kelley
09ec720dab
fix comptime @ptrCast
of pointers to arrays
2019-11-24 16:25:26 -05:00
Sahnvour
696567d9d7
export: check variable type
...
also fixed existing occurrences
2019-11-24 21:33:58 +01:00
Sahnvour
912c1c24c3
simple test for exporting variables in static libs
2019-11-24 21:33:58 +01:00
Sahnvour
104b6f1629
refactored gen_h_file to improve maintainability and output
...
- extracted functions
- factorised extern "C" into a block containing all function prototypes instead of writing macros all over the place
- using intermediate buffers instead of writing directly to the output file
2019-11-24 21:33:58 +01:00
Andrew Kelley
f7574f44c1
add test for struct with var field
2019-11-24 15:20:15 -05:00
Andrew Kelley
44b1dc6db8
add type coercion: [:x]T to [*:x]T
2019-11-24 15:17:55 -05:00
Andrew Kelley
4c7b52503b
all tests passing
2019-11-24 02:14:21 -05:00
Andrew Kelley
f25182f46d
structs can have fields with type var
...
behavior tests passing now
2019-11-23 17:51:37 -05:00
Vexu
b9ef36094c
re-enable stage2 tests
2019-11-23 22:57:34 +02:00
Andrew Kelley
7597735bad
update the stage1 implementation to the new proposal
...
See #3731
2019-11-23 04:45:35 -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
21f344b3b9
add null terminated pointers and arrays to self-hosted
...
as well as `@typeInfo` and `@Type`
2019-11-21 20:43:41 -05:00
Andrew Kelley
1aa978f32e
implement null terminated pointers
2019-11-21 20:43:41 -05:00
daurnimator
ed956b5812
translate-c: add support for MacroQualified definitions
2019-11-19 01:05:17 +00:00
Andrew Kelley
0c33ebb38e
add regression test case. closes #2980
2019-11-18 19:59:03 -05:00
Andrew Kelley
9eed0d3603
add regression test case. closes #2889
2019-11-18 19:54:37 -05:00
Andrew Kelley
828abe046f
add regression test case. closes #3007
2019-11-18 19:51:49 -05:00
Andrew Kelley
21aed86a4a
add regression test case
...
closes #3097
2019-11-18 17:31:35 -05:00
daurnimator
4e28d7a5f7
fix bug on empty error union
2019-11-17 22:29:49 +00:00
LemonBoy
924dd674e2
Catch invalid type from peer resolution
...
Fixes #3703
2019-11-17 22:25:14 +00:00
Vexu
6cddf9d723
properly parse anon literal in array
2019-11-17 22:24:21 +00:00
Andrew Kelley
8c4784f9c1
remove no longer correct comment
2019-11-14 12:38:30 -05:00
LemonBoy
a11da37734
Update discriminant value also for zero-sized unions
...
Fixes #3681
2019-11-14 17:07:20 +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
0237e7a701
std.io.getStdOut and related fns no longer can error
...
Thanks to the Windows Process Environment Block, it is possible to
obtain handles to the standard input, output, and error streams without
possibility of failure.
2019-11-13 04:01:40 +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
32b37e695a
fix anonymous struct literal assigned to variable
...
closes #3667
2019-11-12 21:57:25 -05: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
Vexu
f0c94d95dd
use @atomicStore in std lib
2019-11-13 00:52:15 +02:00
Vexu
110ef2e528
add @atomicStore builtin
2019-11-13 00:25:44 +02:00
Vexu
7e5b234b8b
support atomic operations with enums
2019-11-12 17:13:33 +02:00
Andrew Kelley
b9482fc32d
implement fully anonymous list literals
2019-11-11 19:00:39 -05: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
ca2a788a24
fully anonymous struct literals
2019-11-11 17:50:41 -05:00
Andrew Kelley
1bca8e693d
fix anon literal used with return result loc
2019-11-11 13:18:16 -05:00
Andrew Kelley
725b6ee634
add behavior test case for anonymous list literal syntax
2019-11-11 13:12:21 -05:00
Andrew Kelley
b4ad3e71af
add behavior test case for anon union literal
2019-11-11 13:12:21 -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
ae0a219d1f
stop accepting deprecated use
keyword
...
closes #2591
2019-11-11 13:02:39 -05:00
LemonBoy
d18b5f8b53
Fix initialization of union references
...
Fixes #3532
2019-11-09 12:20:34 -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
Andrew Kelley
a2acc27872
behavior tests passing
2019-11-08 15:57:25 -05:00