2024-02-22 21:29:25 +01:00
|
|
|
#include "elna/result.hpp"
|
|
|
|
|
|
|
|
namespace elna
|
|
|
|
{
|
2024-03-03 13:11:39 +01:00
|
|
|
namespace source
|
|
|
|
{
|
|
|
|
error::error(const char *message, const source::position position) noexcept
|
2024-02-22 21:29:25 +01:00
|
|
|
{
|
2024-02-25 15:16:19 +01:00
|
|
|
this->message = message;
|
|
|
|
this->position = position;
|
2024-02-22 21:29:25 +01:00
|
|
|
}
|
|
|
|
|
2024-03-03 13:11:39 +01:00
|
|
|
char const *error::what() const noexcept
|
2024-02-22 21:29:25 +01:00
|
|
|
{
|
2024-02-25 15:16:19 +01:00
|
|
|
return this->message;
|
2024-02-22 21:29:25 +01:00
|
|
|
}
|
|
|
|
|
2024-03-03 13:11:39 +01:00
|
|
|
std::size_t error::line() const noexcept
|
2024-02-22 21:29:25 +01:00
|
|
|
{
|
2024-02-25 15:16:19 +01:00
|
|
|
return this->position.line;
|
2024-02-22 21:29:25 +01:00
|
|
|
}
|
|
|
|
|
2024-03-03 13:11:39 +01:00
|
|
|
std::size_t error::column() const noexcept
|
2024-02-22 21:29:25 +01:00
|
|
|
{
|
2024-02-25 15:16:19 +01:00
|
|
|
return this->position.column;
|
2024-02-22 21:29:25 +01:00
|
|
|
}
|
2024-03-03 13:11:39 +01:00
|
|
|
}
|
2024-03-01 10:13:55 +01:00
|
|
|
|
|
|
|
Symbol::Symbol(const char *name)
|
|
|
|
{
|
|
|
|
this->name = name;
|
|
|
|
}
|
2024-02-22 21:29:25 +01:00
|
|
|
}
|