123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960open!ImportmoduletypeS=sigtype'arestypechunk_to_convtypeparsed_sexpvalparse_string:string->(chunk_to_conv->'a)->('ares,Conv_error.t)resultvalparse_string_exn:string->(chunk_to_conv->'a)->'aresvalconv:parsed_sexp*Positions.t->(chunk_to_conv->'a)->('ares,Of_sexp_error.t)resultvalconv_exn:parsed_sexp*Positions.t->(chunk_to_conv->'a)->'ares(** Convenience function for merging parsing and conversion errors.
For instance if you have a [load] function as follow:
{[
val load : string -> (Sexp.t list * Positions.t, Parse_error.t) result
]}
then you can create a [load_conv] function as follow:
{[
let load_conv : string -> (Sexp.t -> 'a) -> ('a list, Conv_error.t) result
= fun filename f -> conv_combine (load filename) f
]}
*)valconv_combine:(parsed_sexp*Positions.t,Parse_error.t)result->(chunk_to_conv->'a)->('ares,Conv_error.t)resultendmoduletypeMode=sigtypeparsed_sexptype'arestypechunk_to_convvalapply_f:parsed_sexp->f:(chunk_to_conv->'r)->'rresvalfind:Positions.t->parsed_sexp->sub:Sexp.t->Positions.rangeoptionendmoduletypeConv=sigmoduletypeMode=ModemoduletypeS=SmoduleMake(Mode:Mode)(Sexp_parser:Parser.Swithtypeparsed_value=Mode.parsed_sexp)(Positions_parser:Parser.Swithtypeparsed_value=Positions.t):Swithtypeparsed_sexp:=Mode.parsed_sexpwithtypechunk_to_conv:=Mode.chunk_to_convwithtype'ares:='aMode.resend