From 496d23e93fea6911cb5e83cff744ed8bfee4eaa5 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Tue, 10 Jun 2025 01:54:45 +0200 Subject: [PATCH] Fix some @require comments. --- lib/std/io/stream.c3 | 2 +- lib/std/math/math.c3 | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/std/io/stream.c3 b/lib/std/io/stream.c3 index b0116f3a0..39e73d067 100644 --- a/lib/std/io/stream.c3 +++ b/lib/std/io/stream.c3 @@ -49,7 +49,7 @@ macro bool @is_outstream(#expr) <* @param [&out] ref - @require @is_instream(stream) + @require @is_instream(stream) : "Expected a stream" *> macro usz? read_any(stream, any ref) { diff --git a/lib/std/math/math.c3 b/lib/std/math/math.c3 index aba6d64c8..0a10cd9ab 100644 --- a/lib/std/math/math.c3 +++ b/lib/std/math/math.c3 @@ -1197,31 +1197,31 @@ macro ushort[<*>] ushort[<*>].muldiv(self, mul, div) => mul_div_helper(self, mul <* @require @is_same_vector_or_scalar(self, mul) : `mul must be a vector of the same type as self, or be an integer scalar` - @require @is_same_vector_or_scalar(self, div) `div must be a vector of the same type as self, or be an integer scalar` + @require @is_same_vector_or_scalar(self, div) : `div must be a vector of the same type as self, or be an integer scalar` *> macro int[<*>] int[<*>].muldiv(self, mul, div) => mul_div_helper(self, mul, div); <* - @require @is_same_vector_or_scalar(self, mul) `mul must be a vector of the same type as self, or be an integer scalar` - @require @is_same_vector_or_scalar(self, div) `div must be a vector of the same type as self, or be an integer scalar` + @require @is_same_vector_or_scalar(self, mul) : `mul must be a vector of the same type as self, or be an integer scalar` + @require @is_same_vector_or_scalar(self, div) : `div must be a vector of the same type as self, or be an integer scalar` *> macro uint[<*>] uint[<*>].muldiv(self, mul, div) => mul_div_helper(self, mul, div); <* - @require @is_same_vector_or_scalar(self, mul) `mul must be a vector of the same type as self, or be an integer scalar` - @require @is_same_vector_or_scalar(self, div) `div must be a vector of the same type as self, or be an integer scalar` + @require @is_same_vector_or_scalar(self, mul) : `mul must be a vector of the same type as self, or be an integer scalar` + @require @is_same_vector_or_scalar(self, div) : `div must be a vector of the same type as self, or be an integer scalar` *> macro long[<*>] long[<*>].muldiv(self, mul, div) => mul_div_helper(self, mul, div); <* - @require @is_same_vector_or_scalar(self, mul) `mul must be a vector of the same type as self, or be an integer scalar` - @require @is_same_vector_or_scalar(self, div) `div must be a vector of the same type as self, or be an integer scalar` + @require @is_same_vector_or_scalar(self, mul) : `mul must be a vector of the same type as self, or be an integer scalar` + @require @is_same_vector_or_scalar(self, div) : `div must be a vector of the same type as self, or be an integer scalar` *> macro ulong[<*>] ulong[<*>].muldiv(self, mul, div) => mul_div_helper(self, mul, div); <* -@require types::is_int($typeof(a)) `The input must be an integer` -@require types::is_int($typeof(b)) `The input must be an integer` + @require types::is_int($typeof(a)) : `The input must be an integer` + @require types::is_int($typeof(b)) : `The input must be an integer` *> macro _gcd(a, b) @private { @@ -1242,9 +1242,9 @@ macro _gcd(a, b) @private } <* -Calculate the least common multiple for the provided arguments. + Calculate the least common multiple for the provided arguments. -@require $vacount >= 2 `At least two arguments are required.` + @require $vacount >= 2 : "At least two arguments are required." *> macro lcm(...) { @@ -1260,9 +1260,9 @@ macro lcm(...) } <* -Calculate the greatest common divisor for the provided arguments. + Calculate the greatest common divisor for the provided arguments. -@require $vacount >= 2 `At least two arguments are required.` + @require $vacount >= 2 : "At least two arguments are required." *> macro gcd(...) {