Commit Graph

2812 Commits (78ba3b84850c1e1494797f76d147bc8c87f749e1)

Author SHA1 Message Date
Andrew Kelley 67f11190d1 musl-friendly dynamic linking 2018-03-31 16:34:55 -04:00
Jimmi Holst Christensen aabf7cf57e std.zig.parser now parses null and bool literals 2018-03-31 22:10:49 +02:00
Jimmi Holst Christensen 975dc5a390 std.zig.parser now parses char literals 2018-03-31 21:28:40 +02:00
Jimmi Holst Christensen 4d8f9e2295 std.zig.parser now parses multi line strings 2018-03-31 21:04:54 +02:00
Raul Leal eb6ff796c1 Fix undeclared identifier error in readUntilDelimiterBuffer and incorrect number of parameters in readUntilDelimiterAlloc (#877) 2018-03-31 12:21:19 -04:00
Andrew Kelley 51a6ff18d4
Merge pull request #872 from zig-lang/runtime-libc
find libc and zig std lib at runtime
2018-03-31 12:13:30 -04:00
Jimmi Holst Christensen 4793c3397e std.zig.parser now handles lib name for extern var and fn 2018-03-31 17:46:29 +02:00
Andrew Kelley 8f962a957a fix regressions on windows 2018-03-31 11:26:02 -04:00
Jimmi Holst Christensen cda3509353 Added test cases to cover all of zigs syntax 2018-03-31 15:39:51 +02:00
Jimmi Holst Christensen 26e56f2fab Each test now have it's own test name 2018-03-31 14:18:09 +02:00
Jimmi Holst Christensen 596f4b6002 Fixed review commented code 2018-03-31 14:00:49 +02:00
Marc Tiehuis 7d66908f29 docs: fix unclosed code tag 2018-03-31 23:17:02 +13:00
Andrew Kelley c3724ec506 implement os_self_exe_path in the c++ compiler for darwin
ported from the zig std lib

this fixes looking for zig std lib at runtime on darwin
2018-03-31 02:12:44 -04:00
Jimmi Holst Christensen 5118caf5ab Added a lot of test cases 2018-03-31 00:53:00 +02:00
Andrew Kelley 5d5feb11de appveyor and travis ci: stop passing unused configure args 2018-03-30 17:26:01 -04:00
Andrew Kelley b01c50d6fa find libc and zig std lib at runtime
this removes the following configure options:
 * ZIG_LIBC_LIB_DIR
 * ZIG_LIBC_STATIC_LIB_DIR
 * ZIG_LIBC_INCLUDE_DIR
 * ZIG_DYNAMIC_LINKER
 * ZIG_EACH_LIB_RPATH
 * zig's reliance on CMAKE_INSTALL_PREFIX

these options are still available as command line options, however,
the default will attempt to execute the system's C compiler to
collect system defaults for these values.

closes #870
2018-03-30 17:10:54 -04:00
Jimmi Holst Christensen 24071c6803 std.zig.parser parses all prefix operators 2018-03-30 21:45:42 +02:00
Jimmi Holst Christensen 1dfa927a67 std.zig.parser now treats call expr as a suffix operator 2018-03-30 20:47:09 +02:00
Andrew Kelley f586acabdc add ZIG_STATIC cmake option
it's not compatible with glibc but it works with musl
2018-03-30 13:20:13 -04:00
Jimmi Holst Christensen edca173997 std.zig.parser now parses call expr 2018-03-29 23:40:46 +02:00
Jimmi Holst Christensen 8ada030971 Fixed self hosted compiler compiler error from prev commit 2018-03-29 22:37:54 +02:00
Jimmi Holst Christensen 530f795769 std.zig.parser now supports all infix operators 2018-03-29 22:31:17 +02:00
Andrew Kelley b80398b355
Merge pull request #867 from zig-lang/rand-overhaul
Rewrite Rand functions
2018-03-29 14:14:35 -04:00
Andrew Kelley ccadcbc715 fix examples and rename std.rand.Rand to std.rand.Random 2018-03-29 12:33:29 -04:00
Marc Tiehuis 0fd0f6fd1f Rewrite Rand functions
We now use a generic Rand structure which abstracts the core functions
from the backing engine.

The old Mersenne Twister engine is removed and replaced instead with
three alternatives:

 - Pcg32
 - Xoroshiro128+
 - Isaac64

These should provide sufficient coverage for most purposes, including a
CSPRNG using Isaac64. Consumers of the library that do not care about
the actual engine implementation should use DefaultPrng and DefaultCsprng.
2018-03-30 01:50:58 +13:00
Jimmi Holst Christensen 9df2a6a502 std.zig.parser can now parse top level test declarations 2018-03-29 13:43:17 +02:00
hellerve 7e951e5043 st/os: address @andrewrk concerns 2018-03-29 10:23:44 +02:00
Andrew Kelley 032fccf615 fix compile time array concatenation for slices
closes #866
2018-03-28 23:25:12 -04:00
Andrew Kelley 5627347bab
Merge pull request #865 from bnoordhuis/zig-build-stage2
skeleton stage 2 support for 'zig build'
2018-03-28 21:02:09 -04:00
Jimmi Holst Christensen 72ce146293 Fixed looking for windows sdk when targeting linux 2018-03-29 00:53:06 +02:00
Ben Noordhuis b60b01ce97 skeleton stage 2 support for 'zig build'
Initial port of the 'zig build' logic from the stage 1 compiler to the
stage 2 compiler sans code generation and BUILD_INFO support.
2018-03-28 18:30:41 +02:00
Ben Noordhuis db70b909a0 non-zero exit when build.zig cannot be created
Make the stage 1 compiler exit with a non-zero status code
when `zig build --init` cannot create a new build.zig file.
2018-03-28 18:30:41 +02:00
Andrew Kelley f5b43ada46 std/os: getting dir entries works on OS X 2018-03-28 12:06:48 +02:00
Andrew Kelley 5b00dee0c2 std.math.cast handles signed integers 2018-03-27 15:20:07 -04:00
Andrew Kelley 6cb99fdac3 fix crash when compile error in analyzing @panic call 2018-03-27 15:07:45 -04:00
Andrew Kelley 0b7b3190fd fix bitrotted code in unexpected error tracing 2018-03-27 10:44:13 -04:00
Andrew Kelley c0a69a5075
Merge pull request #860 from jayschwa/patch-1
doc: fix typo and tighten wording in error sections
2018-03-25 23:31:12 -04: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 aa2995ee39 fix invalid codegen for error return traces across suspend points
See #821

Now the code works correctly, but error return traces are missing
the frames from coroutines.
2018-03-24 22:07:12 -04:00
Andrew Kelley a43c7af3d1 add comptime test for the type of suspend promise 2018-03-24 19:31:00 -04:00
Andrew Kelley 897e783763 add promise->T syntax parsing
closes #857
2018-03-24 19:25:53 -04:00
Andrew Kelley 18af2f9a27 fix async fns with inferred error sets
closes #856
2018-03-24 18:28:32 -04:00
Andrew Kelley b1c07c0ea9 move error ret tracing codegen to zig ir
progress towards #821
2018-03-24 18:28:32 -04:00
Andrew Kelley 2cff31937f std.os.linux exposes syscall functions and syscall numbers 2018-03-24 15:57:36 -04:00
Marc Tiehuis 7350181a4a Fix os.File.mode function 2018-03-23 22:41:08 +13:00
Marc Tiehuis 3d1732ef6c Fix OpqaueType usage in exported c functions
We prefer `struct typename`. If a typedef is required, this must be done
manually after generation.
2018-03-23 20:27:11 +13:00
Andrew Kelley 7a99d63c76 ability to use async function pointers
closes #817
2018-03-22 16:56:03 -04:00
Marc Tiehuis 53588f4f12 Add missing pub specifier to atan2 2018-03-22 19:18:51 +13: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
Andrew Kelley 66fec3a3d7
Merge pull request #851 from zig-lang/zen_stdlib
Zen specific hacks
2018-03-20 16:16:08 -04:00