Commit Graph

19 Commits (717ac85a5acb5e6ae063c4d0eb3b8f1bd260776a)

Author SHA1 Message Date
Andrew Kelley ea58f4a5a9 run zig fmt on the codebase 2018-05-30 16:09:11 -04:00
Andrew Kelley 0c16cd2d0e run zig fmt on the codebase
See #1003
2018-05-29 04:23:38 -04:00
Andrew Kelley a35b366eb6 [breaking] delete ptr deref prefix op
start using zig-fmt-pointer-reform branch build of zig fmt
to fix code to use the new syntax

all of test/cases/* are processed, but there are more left
to be done - all the std lib used by the behavior tests
2018-04-30 20:35:54 -04: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 d917815d81 explicitly return from blocks
instead of last statement being expression value

closes #629
2017-12-22 00:50:30 -05:00
Andrew Kelley 643ab90ace add maximum value for @setAlignStack 2017-10-23 22:33:00 -04:00
Andrew Kelley 3c6eff465d fix tests on linux and macos 2017-10-03 01:14:29 -04:00
Andrew Kelley f1bd02e6f4 add @setAlignStack builtin 2017-10-03 00:29:27 -04:00
Andrew Kelley 052b4ae941 align syntax: align(4) instead of align 4
closes #37
2017-08-30 04:54:33 -04:00
Andrew Kelley 010b725bde add alignment field to pointer type 2017-08-30 02:41:27 -04:00
Andrew Kelley 5482f9f9e8 when getting an element pointer, use the best alignment
type we can figure out is safe to use

See #37
2017-08-30 02:25:41 -04:00
Andrew Kelley 56cc62a9c7 @ptrCast preserves larger alignment if applicable
See #37
2017-08-30 01:12:47 -04:00
Andrew Kelley fa9006f8d1 generic functions can access comptime args in align value
See #37
2017-08-30 00:46:38 -04:00
Andrew Kelley b35dad88b4 add tests for function alignment handling
See #37
2017-08-30 00:06:14 -04:00
Andrew Kelley 2d57622355 add test for @alignCast on a slice
See #37
2017-08-29 23:39:54 -04:00
Andrew Kelley 898d65baa9 more alignment improvements
* add alignment capability for fn protos
 * add @alignCast
 * fix some ast rendering code
 * fix some ir rendering code
 * add error for pointer cast increasing alignment
 * update allocators in std to correctly align

See #37
2017-08-29 23:33:25 -04:00
Andrew Kelley 816689a3b1 ptrCast gives compile error for increasing alignment
See #37
2017-08-29 16:52:31 -04:00
Andrew Kelley be94299666 prevent implicitly increasing pointer alignment
See #37
2017-08-29 15:19:15 -04:00
Andrew Kelley 1116d82197 fix bitfield pointer syntax
See #37
2017-08-29 08:35:51 -04:00