mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
liblangutil: Adds a convenience helper method SourceLocation::contains(int _pos).
This commit is contained in:
parent
86a7e19879
commit
35a81073b8
@ -59,6 +59,13 @@ struct SourceLocation
|
|||||||
return start <= _other.start && _other.end <= end;
|
return start <= _other.start && _other.end <= end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool containsOffset(int _pos) const
|
||||||
|
{
|
||||||
|
if (!hasText() || _pos < 0)
|
||||||
|
return false;
|
||||||
|
return start <= _pos && _pos < end;
|
||||||
|
}
|
||||||
|
|
||||||
bool intersects(SourceLocation const& _other) const
|
bool intersects(SourceLocation const& _other) const
|
||||||
{
|
{
|
||||||
if (!hasText() || !_other.hasText() || !equalSources(_other))
|
if (!hasText() || !_other.hasText() || !equalSources(_other))
|
||||||
|
Loading…
Reference in New Issue
Block a user