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
68add5d828
clean up behavior test names
2017-05-23 21:38:31 -04:00
Andrew Kelley
818a0a2629
switch expression - add compile errors
...
* for duplicate integer value
* for missing integer values
* for missing else prong
see #43
2017-05-07 12:07:35 -04:00
Andrew Kelley
644ea2dde9
remove test and try expressions in favor of if expressions
...
See #357
2017-05-03 17:23:11 -04:00
Andrew Kelley
9f92042da9
allow undefined to be resolved with other types
...
closes #295
2017-05-01 22:37:34 -04:00
Andrew Kelley
0cce115476
update syntax for try and nullable unwrapping
...
closes #285
2017-04-21 16:46:33 -04:00
Andrew Kelley
451ce09067
new unreachable syntax
...
* `noreturn` is the primitive type.
* `unreachable` is a control flow keyword.
* `@unreachable()` builtin function is deleted.
closes #214
2017-03-26 04:58:48 -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
9eb29e81f9
rename CBuf to Buffer0 and some minor std API changes
2017-02-28 03:07:11 -05:00
Andrew Kelley
7749ffd797
try expression can omit variable assignments
2017-02-05 18:58:58 -05:00
Andrew Kelley
c0b37e8514
add try expression
...
See #83
2017-02-02 17:09:27 -05:00