+/*
+ * Ranges
+ *
+ * Used to implement any/all ranges, which are inclusive only.
+ * This any / all are range specifiers which change the semantics of
+ * how the range expression is dealt with. Because of the nature of ranges
+ * the whole expression it's used in needs to be rewrote. A table of how
+ * the rewrite works is provided below:
+ *
+ * (a == any b .. c) -> (a >= b && a <= c)
+ * (a == all b .. c) -> error (makes no sense)
+ * (a != any b .. c) -> error (makes no sense)
+ * (a != all b .. c) -> (a < b || a > c)
+ * (a <= any b .. c) -> (a <= c)
+ * (a <= all b .. c) -> (a <= b)
+ * (a >= any b .. c) -> (a >= b)
+ * (a >= all b .. c) -> (a >= c)
+ * (a < any b .. c) -> (a < c)
+ * (a < all b .. c) -> (a < b)
+ * (a > any b .. c) -> (a > b)
+ * (a > all b .. c) -> (a > c)
+ * (a <=> any b .. c) -> error (why would you even try)
+ * (a <=> all b .. c) -> error (why would you even try)
+ */
+struct ast_range_s {
+ ast_expression expression;
+ ast_expression *lower;
+ ast_expression *upper;
+};
+
+ast_range* ast_range_new(lex_ctx_t ctx, ast_expression *lower, ast_expression *upper);