-parse_types(empty, "none") -> none;
-parse_types(empty, "string") -> string;
-parse_types(empty, "list") -> list;
-parse_types(empty, "set") -> set.
-
-
-% I'm used when redis returns multiple results
-stateful_parser(empty, "nil") ->
- nil;
-stateful_parser(error, "-ERR " ++ Error) ->
- {error, Error};
-stateful_parser(empty, "-" ++ _ErrorLength) ->
- error;
-stateful_parser(empty, NumberOfElements) ->
- {hold, list_to_integer(NumberOfElements)};
-stateful_parser(read, ElementSize) ->
- {read, list_to_integer(ElementSize)}.
-
-% I'm used when redis returns just one result
-single_stateful_parser(empty, "nil") ->
- nil;
-single_stateful_parser(error, "-ERR " ++ Error) ->
- {error, Error};
-single_stateful_parser(empty, "-" ++ _ErrorLength) ->
- error;
-single_stateful_parser(empty, ElementSize) ->
- {read, list_to_integer(ElementSize)}.