docs: document location
This commit is contained in:
@@ -6,15 +6,30 @@
|
|||||||
|
|
||||||
namespace furc {
|
namespace furc {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief A location in file.
|
||||||
|
*/
|
||||||
struct location {
|
struct location {
|
||||||
std::string_view filename;
|
std::string_view filename; /**< File's name */
|
||||||
std::size_t line = 0;
|
std::size_t line = 0; /**< Line */
|
||||||
std::size_t column = 0;
|
std::size_t column = 0; /**< Column */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Compare two locations for equality.
|
||||||
|
*
|
||||||
|
* @param rhs Location to compare against.
|
||||||
|
* @return true if the locations are equal.
|
||||||
|
*/
|
||||||
bool operator==(const location& rhs) const {
|
bool operator==(const location& rhs) const {
|
||||||
return filename == rhs.filename && line == rhs.line && column == rhs.column;
|
return filename == rhs.filename && line == rhs.line && column == rhs.column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Compare two locations for inequality.
|
||||||
|
*
|
||||||
|
* @param rhs Location to compare against.
|
||||||
|
* @return true if the locations are not equal.
|
||||||
|
*/
|
||||||
bool operator!=(const location& rhs) const { return !this->operator==(rhs); }
|
bool operator!=(const location& rhs) const { return !this->operator==(rhs); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user