Commit Graph

15 Commits

Author SHA1 Message Date
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
a665872e88 add compile error for ignoring return value
also introduce the _ identifier which you can assign to
to discard a return value

closes #219
2017-02-24 15:01:19 -05:00
Andrew Kelley
786677f80c fix regression with bit fields that align properly 2017-02-22 00:58:31 -05:00
Andrew Kelley
d794549985 bitfields support for array of non-store-aligned packed structs 2017-02-22 00:49:10 -05:00
Andrew Kelley
cf5108f222 correct size of types for packed structs
with byte aligned but non-power-of-2 fields such as 24
2017-02-21 14:22:23 -05:00
Andrew Kelley
244362fed7 ability to write to bit fields
See #261
2017-02-16 18:42:52 -05:00
Andrew Kelley
b6e7a0dadd support arithmetic for non byte aligned integer types
see #261
2017-02-16 17:08:55 -05:00
Andrew Kelley
fc5d47b9b9 reading from a bit field partially works
See #261

Still need to do:
 * reading a field that has bit offset 0 but still needs to
   shift and truncate
 * writing a field
2017-02-16 15:45:41 -05: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
71d335e5cc implement packed structs
closes #183
2017-02-03 11:39:24 -05:00
Andrew Kelley
e621ad014e pass cannot assign to constant test 2017-01-05 18:50:36 -05:00
Andrew Kelley
3b5e26b7f7 self hosted tests import std library 2017-01-05 03:57:48 -05:00
Andrew Kelley
25a5fc32fe IR: pass passSliceOfEmptyStructToFn test 2016-12-28 01:15:09 -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