From 7c130a0d40f165663bc018fd517295776b2cb45e Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 3 Aug 2022 14:47:51 +0000 Subject: [PATCH] Actually show errors --- src/Result.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Result.h b/src/Result.h index 5aa8c1e..2c3aea6 100644 --- a/src/Result.h +++ b/src/Result.h @@ -1,5 +1,6 @@ #pragma once #include "Token.h" +#include "Error.h" // Kinda copying Rust here, but it's a great idea. @@ -9,7 +10,7 @@ class Result public: Result() = default; bool is_error() const { return m_is_error; } - void ethrow() { std::exit(1); } + void ethrow() { Error::throw_error(m_token->loc,m_token->line(),m_error); } std::shared_ptr get() { return m_result;