aboutsummaryrefslogtreecommitdiff
path: root/src/range_set.hpp
blob: 9164a8b5c0a50fbc22feb602771ce84ad7071cf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright (c) 2017 Andrew Kelley
 *
 * This file is part of zig, which is MIT licensed.
 * See http://opensource.org/licenses/MIT
 */

#ifndef ZIG_RANGE_SET_HPP
#define ZIG_RANGE_SET_HPP

#include "all_types.hpp"

struct Range {
    BigInt first;
    BigInt last;
};

struct RangeWithSrc {
    Range range;
    AstNode *source_node;
};

struct RangeSet {
    ZigList<RangeWithSrc> src_range_list;
};

AstNode *rangeset_add_range(RangeSet *rs, BigInt *first, BigInt *last, AstNode *source_node);
bool rangeset_spans(RangeSet *rs, BigInt *first, BigInt *last);

#endif