Actually show errors

This commit is contained in:
apio 2022-08-03 14:47:51 +00:00
parent 77317650f5
commit 7c130a0d40

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include "Token.h" #include "Token.h"
#include "Error.h"
// Kinda copying Rust here, but it's a great idea. // Kinda copying Rust here, but it's a great idea.
@ -9,7 +10,7 @@ class Result
public: public:
Result() = default; Result() = default;
bool is_error() const { return m_is_error; } 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<T> get() std::shared_ptr<T> get()
{ {
return m_result; return m_result;