mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use LineColumn type.
This commit is contained in:
@@ -119,4 +119,23 @@ SourceLocation parseSourceLocation(
|
||||
/// Stream output for Location (used e.g. in boost exceptions).
|
||||
std::ostream& operator<<(std::ostream& _out, SourceLocation const& _location);
|
||||
|
||||
|
||||
/**
|
||||
* Alternative, line-column-based representation for source locations.
|
||||
* Both line and column are zero-based.
|
||||
* If used as a range, the second location is considered exclusive.
|
||||
* Negative values are invalid.
|
||||
*/
|
||||
struct LineColumn
|
||||
{
|
||||
/// Line value, can be between zero and number of `\n` characters in the source file.
|
||||
int line = -1;
|
||||
/// Column value, can be between zero and number of characters in the line (inclusive).
|
||||
int column = -1;
|
||||
|
||||
LineColumn() = default;
|
||||
explicit LineColumn(int _line, int _column): line(_line), column(_column) {}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user