From 905c9ce9a5a866f71bfbf3c0472d9f0f71292058 Mon Sep 17 00:00:00 2001 From: Sofia Date: Sun, 10 May 2026 19:59:25 +0300 Subject: [PATCH] Clean up --- src/codegen.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index 51aeff1..400eace 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -141,17 +141,14 @@ namespace AST { auto lhs = this->m_lhs->codegen(builder, binop->lhs_lvalue ? lvalued : scope, allocator); auto rhs = this->m_rhs->codegen(builder, scope, allocator); - try { - if (binop) { - return codegen::StackValue{ - binop->codegen(builder, lhs.value, rhs.value), - binop->result - }; - } - throw CompileError("invalid binop", this->m_meta); + if (binop) { + return codegen::StackValue{ + binop->codegen(builder, lhs.value, rhs.value), + binop->result + }; } - catch (std::runtime_error& error) { - throw CompileError(error.what(), this->m_meta); + else { + throw CompileError("invalid binop", this->m_meta); } }