2017-05-08 00:07:35 +08:00
|
|
|
/*
|
|
|
|
* 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 {
|
2017-06-27 02:41:47 +08:00
|
|
|
BigInt first;
|
|
|
|
BigInt last;
|
2017-05-08 00:07:35 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct RangeWithSrc {
|
|
|
|
Range range;
|
|
|
|
AstNode *source_node;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RangeSet {
|
|
|
|
ZigList<RangeWithSrc> src_range_list;
|
|
|
|
};
|
|
|
|
|
2017-06-27 02:41:47 +08:00
|
|
|
AstNode *rangeset_add_range(RangeSet *rs, BigInt *first, BigInt *last, AstNode *source_node);
|
|
|
|
bool rangeset_spans(RangeSet *rs, BigInt *first, BigInt *last);
|
2017-05-08 00:07:35 +08:00
|
|
|
|
|
|
|
#endif
|