diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-05-07 12:07:35 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-05-07 12:07:35 -0400 |
| commit | 818a0a26291cf456cfaa955401b1aa8219737d6c (patch) | |
| tree | 9eac0aacdcc41c718a18c98f3513beffaaeac2d3 /src/range_set.hpp | |
| parent | 29beb603b752928184f5f5e9f7479412de1e1951 (diff) | |
| download | zig-818a0a26291cf456cfaa955401b1aa8219737d6c.tar.gz zig-818a0a26291cf456cfaa955401b1aa8219737d6c.zip | |
switch expression - add compile errors
* for duplicate integer value
* for missing integer values
* for missing else prong
see #43
Diffstat (limited to 'src/range_set.hpp')
| -rw-r--r-- | src/range_set.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/range_set.hpp b/src/range_set.hpp new file mode 100644 index 0000000000..f3ae4a189f --- /dev/null +++ b/src/range_set.hpp @@ -0,0 +1,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 { + BigNum first; + BigNum last; +}; + +struct RangeWithSrc { + Range range; + AstNode *source_node; +}; + +struct RangeSet { + ZigList<RangeWithSrc> src_range_list; +}; + +AstNode *rangeset_add_range(RangeSet *rs, BigNum *first, BigNum *last, AstNode *source_node); +bool rangeset_spans(RangeSet *rs, BigNum *first, BigNum *last); + +#endif |
