Commit Graph

14 Commits (8be606ec80b347e2c7af157854cd6fcd5d512026)

Author SHA1 Message Date
Andrew Kelley d917815d81 explicitly return from blocks
instead of last statement being expression value

closes #629
2017-12-22 00:50:30 -05:00
Andrew Kelley c42c91ee7c fix segfault with array of generic functions
closes #377
2017-05-26 14:39:18 -04:00
Andrew Kelley e3c524c1d4 rename `@ptrcast` to `@ptrCast` to follow convention 2017-04-21 10:39:13 -04:00
Andrew Kelley f8e63c4584 change `@bitcast` to `@ptrcast`
See #290
2017-03-31 06:18:20 -04:00
Andrew Kelley 3ca027ca82 first pass at zig build system
* `zig build --export [obj|lib|exe]` changed to `zig build_obj`,
   `zig build_lib` and `zig build_exe` respectively.
 * `--name` parameter is optional when it can be inferred from the
   root source filename. closes #207
 * `zig build` now looks for `build.zig` which interacts with
   `std.build.Builder` to describe the targets, and then the zig
   build system prints TODO: build these targets. See #204
 * add `@bitcast` which is mainly used for pointer reinterpret
   casting and make explicit casting not do pointer reinterpretation.
   Closes #290
 * fix debug info for byval parameters
 * sort command line help options
 * `std.debug.panic` supports format string printing
 * add `std.mem.IncrementingAllocator`
 * fix const ptr to a variable with data changing at runtime.
   closes #289
2017-03-31 05:55:41 -04:00
Andrew Kelley af536ac343 introduce new test syntax
* remove setFnTest builtin
 * add test "name" { ... } syntax
 * remove --check-unused argument. functions are always lazy now.
2017-03-16 16:02:35 -04:00
Andrew Kelley 6dba1f1c8e slice and array re-work plus some misc. changes
* `@truncate` builtin allows casting to the same size integer.
   It also performs two's complement casting between signed and
   unsigned integers.
 * The idiomatic way to convert between bytes and numbers is now
   `mem.readInt` and `mem.writeInt` instead of an unsafe cast.
   It works at compile time, is safer, and looks cleaner.
 * Implicitly casting an array to a slice is allowed only if the
   slice is const.
 * Constant pointer values know if their memory is from a compile-
   time constant value or a compile-time variable.
 * Cast from [N]u8 to []T no longer allowed, but [N]u8 to []const T
   still allowed.
 * Fix inability to pass a mutable pointer to comptime variable at
   compile-time to a function and have the function modify the
   memory pointed to by the pointer.
 * Add the `comptime T: type` parameter back to mem.eql. Prevents
   accidentally creating instantiations for arrays.
2017-02-12 17:35:51 -05:00
Andrew Kelley 32d8686da8 various fixes
* comptime expression is a block expression as it should be
 * fix var args when number of args passed is 0
 * implement const value equality for structs
 * fix indent when rendering container decl AST
 * IR: prevent duplicate generation of code when it is partially
   compile-time evaluated
 * implement compile time struct field pointer evaluation
 * fix compile time evaluation of slicing
2017-01-23 23:30:20 -05:00
Andrew Kelley e5b1758010 remove staticEval builtin in favor of comptime expression 2017-01-22 23:21:00 -05:00
Andrew Kelley 47cf8520ad use comptime instead of inline for var and params
See #221
2017-01-22 19:51:37 -05:00
Andrew Kelley 3b5e26b7f7 self hosted tests import std library 2017-01-05 03:57:48 -05:00
Andrew Kelley 94f977a6c1 IR: pass genericFnWithImplicitCast test 2016-12-28 01:35:13 -05:00
Andrew Kelley aee7ad3de2 IR: port all passing tests over 2016-12-26 03:44:59 -05:00
Andrew Kelley 6c9ec3688e IR testing: rename cases3 dir to cases 2016-12-26 02:49:30 -05:00