From d5eec296a075d6c422747023b51a77af1e072805 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Thu, 21 Aug 2025 17:06:06 +0200 Subject: [PATCH] Some cleanup. --- src/compiler/sema_expr.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/compiler/sema_expr.c b/src/compiler/sema_expr.c index e58c6eb11..ce8ac3a3f 100644 --- a/src/compiler/sema_expr.c +++ b/src/compiler/sema_expr.c @@ -1461,13 +1461,9 @@ static inline bool sema_call_check_invalid_body_arguments(SemaContext *context, { if (callee->macro) { - SEMA_ERROR(body_arguments[0], "This macro does not support arguments."); + RETURN_SEMA_ERROR(body_arguments[0], "This macro does not support arguments."); } - else - { - SEMA_ERROR(body_arguments[0], "Only macro calls may have body arguments for a trailing block."); - } - return false; + RETURN_SEMA_ERROR(body_arguments[0], "Only macro calls may have body arguments for a trailing block."); } // 2. If there is a body then... @@ -1476,14 +1472,12 @@ static inline bool sema_call_check_invalid_body_arguments(SemaContext *context, // 2a. If not a macro then this is an error. if (!callee->macro) { - SEMA_ERROR(call, "Only macro calls may take a trailing block."); - return false; + RETURN_SEMA_ERROR(call, "Only macro calls may take a trailing block."); } // 2b. If we don't have a block parameter, then this is an error as well if (!callee->block_parameter) { - SEMA_ERROR(call, "This macro does not support trailing statements, please remove it."); - return false; + RETURN_SEMA_ERROR(call, "This macro does not support trailing statements, please remove it."); } // 2c. This is a macro and it has a block parameter. Everything is fine! @@ -1494,8 +1488,7 @@ static inline bool sema_call_check_invalid_body_arguments(SemaContext *context, if (callee->block_parameter) { ASSERT_SPAN(call, callee->macro); - SEMA_ERROR(call, "Expected call to have a trailing statement, did you forget to add it?"); - return false; + RETURN_SEMA_ERROR(call, "Expected call to have a trailing statement, did you forget to add it?"); } // 4. No "body" and no block parameter, this is fine.