Commit Graph

10 Commits

Author SHA1 Message Date
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
cf39819478 add new kind of test: generating .h files. and more
* docgen supports obj_err code kind for demonstrating
   errors without explicit test cases
 * add documentation for `extern enum`. See #367
 * remove coldcc keyword and add @setIsCold. See #661
 * add compile errors for non-extern struct, enum, unions
   in function signatures
 * add .h file generation for extern struct, enum, unions
2018-01-22 22:24:07 -05:00
Andrew Kelley
632d143bff replace a %% b with a catch b
See #632

better fits the convention of using keywords for control flow
2018-01-07 17:28:20 -05:00
Andrew Kelley
a45db7e853 add building the self hosted compiler to the main test suite 2018-01-03 18:25:17 -05:00
Josh Wolfe
192a039173 move utf8 parsing to std
source files no longer need to end with a newline
2017-12-26 23:17:33 -07:00
Josh Wolfe
d6a74ed463 [self-hosted] source must be valid utf8. see #663 2017-12-23 21:47:13 -07:00
Josh Wolfe
0082989f22 [self-hosted] tokenizer error for ascii control codes 2017-12-23 18:35:45 -07:00
Josh Wolfe
45ab752f9a source files must end with newline 2017-12-23 17:47:48 -07:00
Josh Wolfe
ab44939941 roughly parsing infix operators 2017-12-17 11:16:55 -07:00
Andrew Kelley
d8d379faf1 self-hosted: refactor into multiple files
add return expression
add number literal
2017-12-11 16:18:06 -05:00