god::token_error#

Note

Declared in <god/token.hpp>

class token_error#

Error type specialized for reporting about a specific token.

Members

std::string message = "undocumented token error"#

The message displayed to describe the error.

const god::token &token#

A constant reference of the offending token.

int return_code = 1#

The code to exit with.

Constructors

inline token_error(const std::string &msg, const god::token &t)#

Main Constructor with a message and constant token reference.

inline token_error(const god::token &t)#

Alternative constructor receiving only a constant token reference.

Methods

std::string context() const noexcept#

Get a visual of the offending token.

Returns:

A thorough string representation

void quit() const noexcept#

Exit with the error’s return_code.

void die() const noexcept#

Report the issue (with context) and exit.