Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file source_code_position0.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205open!ImportmoduleInt=Int0moduleString=String0moduleT=structtypet=Caml.Lexing.position={pos_fname:string;pos_lnum:int;pos_bol:int;pos_cnum:int}[@@deriving_inlinecompare,hash,sexp]letcompare=(funa__001_b__002_->ifPpx_compare_lib.phys_equala__001_b__002_then0else(matchcompare_stringa__001_.pos_fnameb__002_.pos_fnamewith|0->(matchcompare_inta__001_.pos_lnumb__002_.pos_lnumwith|0->(matchcompare_inta__001_.pos_bolb__002_.pos_bolwith|0->compare_inta__001_.pos_cnumb__002_.pos_cnum|n->n)|n->n)|n->n):t->t->int);;let(hash_fold_t:Ppx_hash_lib.Std.Hash.state->t->Ppx_hash_lib.Std.Hash.state)=funhsvarg->lethsv=lethsv=lethsv=lethsv=hsvinhash_fold_stringhsvarg.pos_fnameinhash_fold_inthsvarg.pos_lnuminhash_fold_inthsvarg.pos_bolinhash_fold_inthsvarg.pos_cnum;;let(hash:t->Ppx_hash_lib.Std.Hash.hash_value)=letfuncarg=Ppx_hash_lib.Std.Hash.get_hash_value(lethsv=Ppx_hash_lib.Std.Hash.create()inhash_fold_thsvarg)infunx->funcx;;lett_of_sexp=(let_tp_loc="source_code_position0.ml.T.t"infunction|Ppx_sexp_conv_lib.Sexp.Listfield_sexpsassexp->letpos_fname_field=refPpx_sexp_conv_lib.Option.Noneandpos_lnum_field=refPpx_sexp_conv_lib.Option.Noneandpos_bol_field=refPpx_sexp_conv_lib.Option.Noneandpos_cnum_field=refPpx_sexp_conv_lib.Option.Noneandduplicates=ref[]andextra=ref[]inletreciter=function|Ppx_sexp_conv_lib.Sexp.List(Ppx_sexp_conv_lib.Sexp.Atomfield_name::(([]|[_])as_field_sexps))::tail->let_field_sexp()=match_field_sexpswith|[x]->x|[]->Ppx_sexp_conv_lib.Conv_error.record_only_pairs_expected_tp_locsexp|_->assertfalsein(matchfield_namewith|"pos_fname"->(match!pos_fname_fieldwith|Ppx_sexp_conv_lib.Option.None->let_field_sexp=_field_sexp()inletfvalue=string_of_sexp_field_sexpinpos_fname_field:=Ppx_sexp_conv_lib.Option.Somefvalue|Ppx_sexp_conv_lib.Option.Some_->duplicates:=field_name::!duplicates)|"pos_lnum"->(match!pos_lnum_fieldwith|Ppx_sexp_conv_lib.Option.None->let_field_sexp=_field_sexp()inletfvalue=int_of_sexp_field_sexpinpos_lnum_field:=Ppx_sexp_conv_lib.Option.Somefvalue|Ppx_sexp_conv_lib.Option.Some_->duplicates:=field_name::!duplicates)|"pos_bol"->(match!pos_bol_fieldwith|Ppx_sexp_conv_lib.Option.None->let_field_sexp=_field_sexp()inletfvalue=int_of_sexp_field_sexpinpos_bol_field:=Ppx_sexp_conv_lib.Option.Somefvalue|Ppx_sexp_conv_lib.Option.Some_->duplicates:=field_name::!duplicates)|"pos_cnum"->(match!pos_cnum_fieldwith|Ppx_sexp_conv_lib.Option.None->let_field_sexp=_field_sexp()inletfvalue=int_of_sexp_field_sexpinpos_cnum_field:=Ppx_sexp_conv_lib.Option.Somefvalue|Ppx_sexp_conv_lib.Option.Some_->duplicates:=field_name::!duplicates)|_->if!Ppx_sexp_conv_lib.Conv.record_check_extra_fieldsthenextra:=field_name::!extraelse());itertail|((Ppx_sexp_conv_lib.Sexp.Atom_|Ppx_sexp_conv_lib.Sexp.List_)assexp)::_->Ppx_sexp_conv_lib.Conv_error.record_only_pairs_expected_tp_locsexp|[]->()initerfield_sexps;(match!duplicateswith|_::_->Ppx_sexp_conv_lib.Conv_error.record_duplicate_fields_tp_loc!duplicatessexp|[]->(match!extrawith|_::_->Ppx_sexp_conv_lib.Conv_error.record_extra_fields_tp_loc!extrasexp|[]->(match!pos_fname_field,!pos_lnum_field,!pos_bol_field,!pos_cnum_fieldwith|(Ppx_sexp_conv_lib.Option.Somepos_fname_value,Ppx_sexp_conv_lib.Option.Somepos_lnum_value,Ppx_sexp_conv_lib.Option.Somepos_bol_value,Ppx_sexp_conv_lib.Option.Somepos_cnum_value)->{pos_fname=pos_fname_value;pos_lnum=pos_lnum_value;pos_bol=pos_bol_value;pos_cnum=pos_cnum_value}|_->Ppx_sexp_conv_lib.Conv_error.record_undefined_elements_tp_locsexp[(Ppx_sexp_conv_lib.Conv.(=)!pos_fname_fieldPpx_sexp_conv_lib.Option.None,"pos_fname");(Ppx_sexp_conv_lib.Conv.(=)!pos_lnum_fieldPpx_sexp_conv_lib.Option.None,"pos_lnum");(Ppx_sexp_conv_lib.Conv.(=)!pos_bol_fieldPpx_sexp_conv_lib.Option.None,"pos_bol");(Ppx_sexp_conv_lib.Conv.(=)!pos_cnum_fieldPpx_sexp_conv_lib.Option.None,"pos_cnum")])))|Ppx_sexp_conv_lib.Sexp.Atom_assexp->Ppx_sexp_conv_lib.Conv_error.record_list_instead_atom_tp_locsexp:Ppx_sexp_conv_lib.Sexp.t->t);;letsexp_of_t=(function|{pos_fname=v_pos_fname;pos_lnum=v_pos_lnum;pos_bol=v_pos_bol;pos_cnum=v_pos_cnum}->letbnds=[]inletbnds=letarg=sexp_of_intv_pos_cnuminPpx_sexp_conv_lib.Sexp.List[Ppx_sexp_conv_lib.Sexp.Atom"pos_cnum";arg]::bndsinletbnds=letarg=sexp_of_intv_pos_bolinPpx_sexp_conv_lib.Sexp.List[Ppx_sexp_conv_lib.Sexp.Atom"pos_bol";arg]::bndsinletbnds=letarg=sexp_of_intv_pos_lnuminPpx_sexp_conv_lib.Sexp.List[Ppx_sexp_conv_lib.Sexp.Atom"pos_lnum";arg]::bndsinletbnds=letarg=sexp_of_stringv_pos_fnameinPpx_sexp_conv_lib.Sexp.List[Ppx_sexp_conv_lib.Sexp.Atom"pos_fname";arg]::bndsinPpx_sexp_conv_lib.Sexp.Listbnds:t->Ppx_sexp_conv_lib.Sexp.t);;[@@@end]endincludeTincludeComparator.Make(T)(* This is the same function as Ppx_here.lift_position_as_string. *)letmake_location_string~pos_fname~pos_lnum~pos_cnum~pos_bol=String.concat[pos_fname;":";Int.to_stringpos_lnum;":";Int.to_string(pos_cnum-pos_bol)];;letto_string{Caml.Lexing.pos_fname;pos_lnum;pos_cnum;pos_bol}=make_location_string~pos_fname~pos_lnum~pos_cnum~pos_bol;;letsexp_of_tt=Sexp.Atom(to_stringt)