let parse_rnext s = if not (Re.execp rnext_re s) then error "invalid RNEXT" s sexp_of_string else match s with | "*" -> Ok None | "=" -> Ok (Some `Equal_to_RNAME) | _ -> Ok (Some (`Value s))