Represents a runtime error in the GSC interpreter.
More...
#include <runtimeError.hpp>
Represents a runtime error in the GSC interpreter.
- Note
- This class extends std::runtime_error to provide additional context about the error, including the token that caused it and a message describing the error.
Definition at line 14 of file runtimeError.hpp.
◆ RuntimeError()
RuntimeError::RuntimeError |
( |
std::shared_ptr< Token > |
token, |
|
|
std::string_view |
message |
|
) |
| |
|
inline |
Constructs a RuntimeError with a token and a message.
- Parameters
-
token | A shared pointer to the Token that caused the error. |
message | A string view containing the error message. |
Definition at line 24 of file runtimeError.hpp.
25 : std::runtime_error(message.data()),
token(
token) {}
std::shared_ptr< Token > token
◆ getMessage()
std::string RuntimeError::getMessage |
( |
| ) |
const |
|
inline |
◆ getToken()
std::shared_ptr< Token > RuntimeError::getToken |
( |
| ) |
const |
|
inline |
◆ token
std::shared_ptr<Token> RuntimeError::token |
|
private |
The documentation for this class was generated from the following file: