Actually show errors
This commit is contained in:
parent
77317650f5
commit
7c130a0d40
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user