From: Brendan Hansen Date: Tue, 12 Jan 2021 22:23:08 +0000 (-0600) Subject: updated CHANGELOG; minor bug fixes X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=da76298ce6fe6d5264a791907ad35679eff636f6;p=onyx.git updated CHANGELOG; minor bug fixes --- diff --git a/CHANGELOG b/CHANGELOG index c549e76d..5c831d99 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,12 +4,17 @@ Additions: * Compilation on Windows. All you should need is `cl.exe` in the current environment, and then simply run `build.bat`. I haven't thoroughly tested this, but I believe it will work on many systems. ARM / PowerPC may not work correctly. +* procedures can be polymorphic on an array size. +* structures can be polymorphic on any compile-time known value. +* basics of operator overloading using `#operator +`. +* multiple return values and multiple assignment / declarations. * #solidify directive for explicitly specifying type variables in polymorphic procs. * properly different kinds of allocators in core/alloc/. * `null_proc` in builtin.onyx type matches against all procedure types, allowing for a 'null' procedure. -* '-VV' for very verbose printing. Easier to nail down compiler issues because it stops +* '-VV' and '-VVV' for very verbose printing. Easier to nail down compiler issues because it stops printing in the entity where the problem is. +* `io.Stream` API with `io.Reader` and `io.Writer`. * `map.empty` * `string.compare` * `array.copy` @@ -19,6 +24,7 @@ Additions: Removals: * struct literals can no longer specify values for members brought in through a `use`. +* Makefile; just use ./build.sh or ./build.bat Changes: * `::` declarations in a procedure are treated differently now. They used to represent a constant @@ -43,6 +49,8 @@ Bug fixes: * struct member defaults were processed too early in the pipeline, causing errors. * assignment of array type with array literal optimization. * probably many more since everything is compiled with warnings now. +* deferred statements are correctly executed with break, continue and fallthrough. +* `0..10` was not parsed correctly. Release v0.0.5 diff --git a/bin/onyx b/bin/onyx index edc69205..c76a8405 100755 Binary files a/bin/onyx and b/bin/onyx differ diff --git a/core/io/stream.onyx b/core/io/stream.onyx index 2a43d372..d6abe0c8 100644 --- a/core/io/stream.onyx +++ b/core/io/stream.onyx @@ -117,10 +117,7 @@ stream_size :: proc (use s: ^Stream) -> i32 { } stream_peek_byte :: proc (use s: ^Stream) -> (Error, u8) { - out : u8; - err : io.Error; - - err, out = stream_read_byte(s); + err, out := stream_read_byte(s); if err != Error.None do return err, 0; err = stream_unread_byte(s); diff --git a/include/bh.h b/include/bh.h index 417672cf..5b708de9 100644 --- a/include/bh.h +++ b/include/bh.h @@ -184,7 +184,7 @@ u8* double_to_ieee754(f64 f, b32 reverse); #define fori(var, lo, hi) for (i64 var = (lo); var < (hi); var++) #define forir(var, hi, lo) for (i64 var = (hi); var >= (lo); var--) -#define forll(T, var, start, step) for (T* var = (start); var != NULL; var = var->step) +#define forll(T, var, start, step) for (T* var = (start); var != NULL; var = (T *) var->step) #if defined(BH_DEBUG) && !defined(_BH_WINDOWS) #define DEBUG_HERE __asm("int $3") diff --git a/onyx.exe b/onyx.exe index 9f716f7f..003fe740 100644 Binary files a/onyx.exe and b/onyx.exe differ diff --git a/src/onyxchecker.c b/src/onyxchecker.c index 324be12b..233917b7 100644 --- a/src/onyxchecker.c +++ b/src/onyxchecker.c @@ -93,7 +93,7 @@ CheckStatus check_return(AstReturn* retnode) { CHECK(expression, &retnode->expr); if (!type_check_or_auto_cast(&retnode->expr, semstate.expected_return_type)) { - onyx_report_error(retnode->expr->token->pos, + onyx_report_error(retnode->token->pos, "Expected to return a value of type '%s', returning value of type '%s'.", type_get_name(semstate.expected_return_type), type_get_name(retnode->expr->type));