aboutsummaryrefslogtreecommitdiffstats
path: root/BaseTypes.h
blob: 0cc7f85341169a84a192900e1339f85cb6782ff3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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;
};

} }