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;