Commit Graph

1351 Commits (866c841dd8770bcc12af0aaf946c80819f5e0092)

Author SHA1 Message Date
Josh Wolfe ac7971122d fix check-statement-is-void. add tests
see #291
2017-04-23 21:50:34 -07:00
Josh Wolfe c6605cba83 blocks check that their statements are void
closes #291

This changes the error message "return value ignored" to "expression value is ignored".
This is because this error also applies to {1;}, which has no function calls.

Also fix ignored expression values in std and test.
This caught a bug in debug.readAllocBytes where an early Eof error would have been missed.
See #219.
2017-04-23 21:15:15 -07:00
Andrew Kelley 6de33ded81 make undefined as a constant value lazy
closes #268
2017-04-23 14:34:40 -04:00
Josh Wolfe 2ed47070ef refactor ir_gen_block to make different return paths more clear 2017-04-23 09:04:15 -07:00
Josh Wolfe 14dfbd6ad3 remove redundant unreachable code error 2017-04-23 08:36:21 -07:00
Josh Wolfe 8299fe19c0 add test_artifacts to .gitignore, so you can commit while tests are running 2017-04-23 08:36:21 -07:00
Andrew Kelley f9fa768dca zig build system: installFile and installClibrary
See #332
2017-04-23 11:09:26 -04:00
Andrew Kelley 0f633167c5 fix crash when unwrapping error with no error decls
closes #339
2017-04-23 03:14:22 -04:00
Andrew Kelley ad9040443c new compile errors for setGlobalAlign and setGlobalSection builtins
if you try to use them on an external variable or function
then you get a compile error, since the alignment/section
is set externally in this case.

closes #244
2017-04-22 12:54:00 -04:00
Andrew Kelley aafb0b9082 slicing now returns correct const-ness
also remove the ability to override constness when slicing

closes #334
2017-04-22 12:19:20 -04:00
Andrew Kelley 1a0081b763 add peer type resolution for T and ?T
See #334
2017-04-22 11:45:04 -04:00
Andrew Kelley e0b635e825 std.os.ChildProcess: fix closing wrong file descriptors 2017-04-22 11:36:42 -04:00
Andrew Kelley 0cce115476 update syntax for try and nullable unwrapping
closes #285
2017-04-21 16:46:33 -04:00
Andrew Kelley d5346d7a80 remove `?return` and `?defer`
closes #309
2017-04-21 15:08:03 -04:00
Andrew Kelley bee1ae68ef std: fix PATH resolution when spawning child 2017-04-21 13:27:11 -04:00
Andrew Kelley 3a137c6ff0 add Travis CI integration 2017-04-21 13:27:11 -04:00
Andrew Kelley e3c524c1d4 rename `@ptrcast` to `@ptrCast` to follow convention 2017-04-21 10:39:13 -04:00
Andrew Kelley ecb71d1dd3 add example which exercises addObject in the zig build system
closes #329
2017-04-21 02:26:48 -04:00
Andrew Kelley fb492d19eb zig build system supports building a library
See #329

Supporting work:
 * move std.cstr.Buffer0 to std.buffer.Buffer
 * add build.zig to example/shared_library/ and add an automated test
   for it
 * add std.list.List.resizeDown
 * improve std.os.makePath
   - no longer recursive
   - takes into account . and ..
 * add std.os.path.isAbsolute
 * add std.os.path.resolve
 * reimplement std.os.path.dirname
   - no longer requires an allocator
   - handles edge cases correctly
2017-04-21 01:56:12 -04:00
Andrew Kelley 599215cee4 add compile error tests for offsetOf builtin 2017-04-20 10:57:41 -04:00
Andrew Kelley 68f75a3130 Merge pull request #338 from raulgrell/master
Add `@offsetOf` builtin function
2017-04-20 10:45:23 -04:00
Raul Leal 5234016561 Add @offsetOf builtin function 2017-04-20 11:53:00 +00:00
Andrew Kelley 037a9d937d Merge branch 'self-hosted-tests'
Now instead of:

```
./run_tests
```

Do this:

```
./zig build --build-file ../build.zig test
```

For more options, see:

```
./zig build --build-file ../build.zig --help
```
2017-04-20 02:31:28 -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 666435195f update zig build help text when no build.zig found 2017-04-19 04:36:48 -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
Andrew Kelley 237dfdbdc6 error when building exe with no entry point
closes #30
2017-04-18 14:04:48 -04:00
Andrew Kelley 6f0f8a92ec bail out of analysis on first error during comptime eval
prevents an error during comptime eval from printing a
large number of compile errors
2017-04-18 04:02:36 -04:00
Andrew Kelley 9021bb7969 std.rand API follows idiomatic convention for init 2017-04-18 02:47:10 -04:00
Andrew Kelley a791417552 add `@fieldParentPtr` builtin function
closes #320
2017-04-18 02:28:05 -04:00
Andrew Kelley 407916cd2f rename `@intType` to `@IntType` to follow convention
closes #327
2017-04-18 00:05:09 -04:00
Andrew Kelley def4fbc9ab Merge branch 'raulgrell-master' 2017-04-17 20:15:39 -04:00
Andrew Kelley c7852bd596 minor clean ups from previous commit 2017-04-17 20:15:19 -04:00
Raul Leal 3266585606 Implicit cast from T to %?T
closes #171
2017-04-17 19:55:56 -04:00
Andrew Kelley 2e0b114fdc add compile error for intToPtr with a 0-bit ptr
See #323
2017-04-17 19:28:33 -04:00
Andrew Kelley 216e14891e zig build system creates symlinks atomically
* add std.base64
 * add std.os.rename
 * add std.os.atomicSymLink
2017-04-17 19:08:41 -04:00
Andrew Kelley 401eed8153 build examples in ./run_tests
closes #325
2017-04-17 06:58:36 -04:00
Andrew Kelley 05b3082121 zig build system: progress toward install and uninstall
also:
 * add std.os.path.join
 * add std.os.deleteFile
2017-04-17 06:47:20 -04:00
Andrew Kelley e4ec2d10c6 zig build system: implement custom command step 2017-04-17 06:47:20 -04:00
Andrew Kelley 47336abae3 improvements to zig build system and unwrap error safety
* zig build system: create standard dynamic library sym links
 * unwrapping an error results in a panic message that contains
   the error name
 * rename error.SysResources to error.SystemResources
 * add std.os.symLink
 * add std.os.deleteFile
2017-04-17 06:47:20 -04:00
Andrew Kelley d16ce67106 zig build system: ability to link against dynamic library step 2017-04-17 06:47:20 -04:00
Josh Wolfe 3a8490f7e9 add tests for implicit semicolon. closes #297 2017-04-14 16:29:42 -07:00
Josh Wolfe 3e93796e24 comptime ({}) should not get an implicit semicolon
closes #292.
2017-04-14 16:09:01 -07:00