Commit Graph

48 Commits (10fb1f2730cb2d1760233622e232b35d21d651ea)

Author SHA1 Message Date
Andrew Kelley e4fd3fd52b workaround for llvm-config missing xml2 2018-03-10 14:48:41 -05:00
Andrew Kelley a2bd9f8912 std lib: modify allocator idiom
Before we accepted a nullable allocator for some stuff like
opening files. Now we require an allocator.

Use the mem.FixedBufferAllocator pattern if a bound on the amount
to allocate is known.

This also establishes the pattern that usually an allocator is the
first argument to a function (possibly after "self").

fix docs for std.cstr.addNullByte

self hosted compiler:
 * only build docs when explicitly asked to
 * clean up main
 * stub out zig fmt
2018-02-09 18:27:50 -05:00
Andrew Kelley 1fb308ceee self hosted compiler: move tokenization and parsing to std lib 2018-02-09 13:08:02 -05:00
Andrew Kelley 5f518dbeb9 *WIP* error sets converting std lib 2018-01-31 22:48:40 -05: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 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 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 32ea6f54e5 *WIP* proof of concept error return traces 2018-01-12 02:12:11 -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 79d50d9933 appveyor: enable verbose link for self hosted compiler 2018-01-04 23:43:46 -05:00
Andrew Kelley 7f0b12a481 appveyor: skip building self hosted compiler for now 2018-01-04 23:30:03 -05:00
Andrew Kelley 1b120d1e49 update windows build to llvm 5.0.1
llvm-config.exe does not handle diaguids.lib for us so we have to
duplicate the work.
2018-01-04 22:46:26 -05:00
Andrew Kelley d008e209e7 self-hosted compiler works on macos 2018-01-04 15:30:22 -05:00
Andrew Kelley 0cd63b28f3 fix self-hosted build on windows 2018-01-03 22:38:13 -05:00
Andrew Kelley 477e3f64fc self-hosted build: use llvm-config from stage1 2018-01-03 21:32:50 -05:00
Andrew Kelley 5a800db48c build: std files and c header files are only specified once
In the CMakeLists.txt file. And then we communicate the list
to the zig build.
2018-01-03 19:39:04 -05:00
Andrew Kelley a45db7e853 add building the self hosted compiler to the main test suite 2018-01-03 18:25:17 -05:00
Andrew Kelley 36ff26609b fix self hosted compiler on windows 2018-01-03 04:55:49 -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 6fece14cfb self-hosted: build against zig_llvm and embedded LLD
Now the self-hosted compiler re-uses the same C++ code for interfacing
with LLVM as the C++ code.
It also links against the same LLD library files.
2017-12-26 19:44:08 -05:00
Andrew Kelley 4183c6f1a5 move std/debug.zig to a subdirectory
self hosted compiler parser tests do some fuzz testing
2017-12-23 22:15:48 -05:00
Andrew Kelley 79c2ceb2d5 build: findLLVM correctly handles system libraries 2017-12-23 22:14:35 -05:00
Andrew Kelley e0a1466bd8 build: add --search-prefix option 2017-12-23 22:14:35 -05:00
Andrew Kelley 39c7bd24e4 port most of main.cpp to self hosted compiler 2017-12-23 00:57:56 -05:00
Andrew Kelley 24c2703dfa self-hosted: look for llvm-config in homebrew 2017-12-12 17:25:57 -05:00
Andrew Kelley 2b9302107f self-hosted: cleanup build looking for llvm-config 2017-12-12 16:03:20 -05:00
Andrew Kelley cd5fd653d7 self-hosted: move code to std.os.ChildProcess.exec 2017-12-12 14:35:53 -05:00
Andrew Kelley 23058d8b43 self-hosted: link with LLVM 2017-12-11 23:34:59 -05:00
Andrew Kelley f210f17d30 add self-hosted parsing and rendering to main tests 2017-12-10 21:26:52 -05:00
Andrew Kelley 5a25505668 rename "parsec" to "translate-c" 2017-11-24 14:56:05 -05:00
Andrew Kelley 4543413491 std.io: introduce buffered I/O and change API
I started working on #465 and made some corresponding std.io
API changes.

New structs:
 * std.io.FileInStream
 * std.io.FileOutStream
 * std.io.BufferedOutStream
 * std.io.BufferedInStream

Removed:
 * std.io.File.in_stream
 * std.io.File.out_stream

Now instead of &file.out_stream or &file.in_stream to get access to
the stream API for a file, you get it like this:

var file_in_stream = io.FileInStream.init(&file);
const in_stream = &file_in_stream.stream;

var file_out_stream = io.FileOutStream.init(&file);
const out_stream = &file_out_stream.stream;

This is evidence that we might not need any OOP features -
See #130.
2017-11-07 03:22:27 -05:00
Andrew Kelley 92751d5e24 self hosted zig: print usage 2017-10-21 17:31:06 -04:00
Andrew Kelley 8d4668231a compiler-rt tests pass with and without libc 2017-10-03 01:15:07 -04:00
Andrew Kelley 7ee00730ac add option to run tests in LLDB and turn it on for macos travis 2017-09-17 14:43:51 -04:00
Andrew Kelley 2c9bdad346 rename parseh to parsec 2017-09-05 22:55:03 -04:00
Andrew Kelley ea9e1639ca include compiler-rt tests in main testing suite 2017-08-18 13:51:16 -04:00
Andrew Kelley 363d9038c9 zig build: organize build artifacts
closes #328
2017-04-30 18:56:24 -04:00
Andrew Kelley 8654bc1810 delete test_artifacts directory when tests complete
* add std.os.deleteTree
 * add std.os.deleteDir
 * add std.os.page_size
 * add std.os API for iterating over directories
 * refactor duplication in build.zig
 * update documentation on how to run tests
2017-04-20 02:26:36 -04:00
Andrew Kelley 1ff73a8e69 convert parseh tests to zig build system 2017-04-19 16:59:20 -04:00
Andrew Kelley d12f1f5b49 test framework supports name prefix and filter argument
rename self hosted tests to behavior tests
2017-04-19 15:38:12 -04:00
Andrew Kelley 9b7f438882 convert debug safety tests to zig build system 2017-04-19 14:41:59 -04:00
Andrew Kelley d1e01e43d3 convert assemble and link tests to zig build system 2017-04-19 14:00:12 -04:00
Andrew Kelley 35d60eb4e6 remove unused test code 2017-04-19 04:28:59 -04:00
Andrew Kelley d0a17b6937 convert std lib tests to zig build system 2017-04-19 04:12:22 -04:00
Andrew Kelley 10525b869d convert build examples tests to zig build system 2017-04-19 01:45:46 -04:00
Andrew Kelley 37b9a2e6a4 convert compare-output tests to use zig build system 2017-04-19 01:15:20 -04:00