mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
23 lines
413 B
C
23 lines
413 B
C
|
#pragma once
|
||
|
|
||
|
|
||
|
namespace dev {
|
||
|
namespace solidity {
|
||
|
|
||
|
// Representation of an interval of source positions.
|
||
|
struct Location {
|
||
|
Location(int b, int e) : beg_pos(b), end_pos(e) { }
|
||
|
Location() : beg_pos(0), end_pos(0) { }
|
||
|
|
||
|
bool IsValid() const {
|
||
|
return beg_pos >= 0 && end_pos >= beg_pos;
|
||
|
}
|
||
|
|
||
|
static Location invalid() { return Location(-1, -1); }
|
||
|
|
||
|
int beg_pos;
|
||
|
int end_pos;
|
||
|
};
|
||
|
|
||
|
} }
|