Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let parse_prefs sep str =
- let string_index_from i =
- try Some (String.index_from str i sep)
- with Not_found -> None in
- let rec aux i n x =
- match string_index_from i with
- |Some m->let m=StringMap.add (String.sub str i (m-i)) n x in aux (succ m) (succ n) m
- |None -> let m = StringMap.add (String.sub str i (String.length str-i)) n x
- in aux 0 1 StringMap.empty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement