docs: document token error
This commit is contained in:
@@ -175,7 +175,7 @@ using integer_token = std::uint64_t; /**< Integer token. */
|
|||||||
* @brief Token.
|
* @brief Token.
|
||||||
*/
|
*/
|
||||||
struct token {
|
struct token {
|
||||||
location location;
|
location location; /**< Token location. */
|
||||||
token_t type = token_t::None; /**< Token type. */
|
token_t type = token_t::None; /**< Token type. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -342,10 +342,22 @@ struct token_error {
|
|||||||
token_error_t type; /**< Error type. */
|
token_error_t type; /**< Error type. */
|
||||||
std::string message; /**< Error message. */
|
std::string message; /**< Error message. */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Compares two token errors for equality.
|
||||||
|
*
|
||||||
|
* @param rhs Error to compare against.
|
||||||
|
* @return true if the errors are equal.
|
||||||
|
*/
|
||||||
bool operator==(const token_error& rhs) const {
|
bool operator==(const token_error& rhs) const {
|
||||||
return location == rhs.location && type == rhs.type && message == rhs.message;
|
return location == rhs.location && type == rhs.type && message == rhs.message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Compares two token errors for inequality.
|
||||||
|
*
|
||||||
|
* @param rhs Error to compare against.
|
||||||
|
* @return true if the errors are not equal.
|
||||||
|
*/
|
||||||
bool operator!=(const token_error& rhs) const { return !this->operator==(rhs); }
|
bool operator!=(const token_error& rhs) const { return !this->operator==(rhs); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user