aboutsummaryrefslogtreecommitdiffstats
path: root/BaseTypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTypes.h')
-rw-r--r--BaseTypes.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/BaseTypes.h b/BaseTypes.h
index 0cc7f853..2e92b07e 100644
--- a/BaseTypes.h
+++ b/BaseTypes.h
@@ -4,19 +4,16 @@
namespace dev {
namespace solidity {
-// Representation of an interval of source positions.
+/// Representation of an interval of source positions.
+/// The interval includes start and excludes end.
struct Location {
- Location(int b, int e) : beg_pos(b), end_pos(e) { }
- Location() : beg_pos(0), end_pos(0) { }
+ Location(int _start, int _end) : start(_start), end(_end) { }
+ Location() : start(-1), end(-1) { }
- bool IsValid() const {
- return beg_pos >= 0 && end_pos >= beg_pos;
- }
+ bool IsValid() const { return start >= 0 && end >= start; }
- static Location invalid() { return Location(-1, -1); }
-
- int beg_pos;
- int end_pos;
+ int start;
+ int end;
};
} }