
(* For now, there's no need for multiple ranges,
   eventually maybe this can be expr list *)
type t = expr
        
and expr = {
    min : int option;
    max : int option;
}

(*
let rec parse_ranges = parser
    | [< first = parse_range; rest  = parse_range_tail >] 
        -> first :: rest
*)        
let parse_range = parser
    | [< 'Int n; 'Kwd "-"; 'Int n >]
    | [< min = parse_num; 'Kwd "-"; max = parse_num >] ->
          
and parse_range_tail = parser
    | [< 'Kwd ","; parse_range
             [< >]


    | [< 'Int n >] ->
    | [< 'Float >] ->
    | [< 'Kwd "," >] ->
    | [< 'Kwd "-" >] ->

         and

let of_string atom_of_string str =
    let token_stream = Genlex.make_lexer ["-"; ","] (Stream.of_string str) in

    

exprlist = 
	| expr, exprlist
	| expr

expr := 
	| value - value
	| - value
	| value -

more concisely, it is a regular language of
(value? - value?,)* (value? - value?)

Here are some examples:

0.25-0.75
0-3, 5-10
-10
0.25-,

To make my life easier, they are all parsed as floats or whatever you want, but
obviously consecutive successes can only ever be an integer, unless you
have a corrupt ~/.memo
