Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file source_code_position0.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179open!ImportmoduleInt=Int0moduleString=String0moduleT=structtypet=Caml.Lexing.position={pos_fname:string;pos_lnum:int;pos_bol:int;pos_cnum:int;}[@@deriving_inlinecompare,hash,sexp]letcompare:t->t->int=funa__001_->funb__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)let(hash_fold_t:Ppx_hash_lib.Std.Hash.state->t->Ppx_hash_lib.Std.Hash.state)=funhsv->funarg->lethsv=lethsv=lethsv=lethsv=hsvinhash_fold_stringhsvarg.pos_fnameinhash_fold_inthsvarg.pos_lnuminhash_fold_inthsvarg.pos_bolinhash_fold_inthsvarg.pos_cnumlet(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->funcxlett_of_sexp:Ppx_sexp_conv_lib.Sexp.t->t=let_tp_loc="src/source_code_position0.ml.T.t"infunction|Ppx_sexp_conv_lib.Sexp.Listfield_sexpsassexp->letpos_fname_field=refNoneandpos_lnum_field=refNoneandpos_bol_field=refNoneandpos_cnum_field=refNoneandduplicates=ref[]andextra=ref[]inletreciter=function|(Ppx_sexp_conv_lib.Sexp.List((Ppx_sexp_conv_lib.Sexp.Atomfield_name)::_field_sexp::[]))::tail->((matchfield_namewith|"pos_fname"->(match!pos_fname_fieldwith|None->letfvalue=string_of_sexp_field_sexpinpos_fname_field:=(Somefvalue)|Some_->duplicates:=(field_name::(!duplicates)))|"pos_lnum"->(match!pos_lnum_fieldwith|None->letfvalue=int_of_sexp_field_sexpinpos_lnum_field:=(Somefvalue)|Some_->duplicates:=(field_name::(!duplicates)))|"pos_bol"->(match!pos_bol_fieldwith|None->letfvalue=int_of_sexp_field_sexpinpos_bol_field:=(Somefvalue)|Some_->duplicates:=(field_name::(!duplicates)))|"pos_cnum"->(match!pos_cnum_fieldwith|None->letfvalue=int_of_sexp_field_sexpinpos_cnum_field:=(Somefvalue)|Some_->duplicates:=(field_name::(!duplicates)))|_->if!Ppx_sexp_conv_lib.Conv.record_check_extra_fieldsthenextra:=(field_name::(!extra))else());itertail)|(Ppx_sexp_conv_lib.Sexp.List((Ppx_sexp_conv_lib.Sexp.Atomfield_name)::[]))::tail->((let_=field_nameinif!Ppx_sexp_conv_lib.Conv.record_check_extra_fieldsthenextra:=(field_name::(!extra))else());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|[]->()in(iterfield_sexps;(match!duplicateswith|_::_->Ppx_sexp_conv_lib.Conv_error.record_duplicate_fields_tp_loc(!duplicates)sexp|[]->(match!extrawith|_::_->Ppx_sexp_conv_lib.Conv_error.record_extra_fields_tp_loc(!extra)sexp|[]->(match((!pos_fname_field),(!pos_lnum_field),(!pos_bol_field),(!pos_cnum_field))with|(Somepos_fname_value,Somepos_lnum_value,Somepos_bol_value,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_field)None),"pos_fname");((Ppx_sexp_conv_lib.Conv.(=)(!pos_lnum_field)None),"pos_lnum");((Ppx_sexp_conv_lib.Conv.(=)(!pos_bol_field)None),"pos_bol");((Ppx_sexp_conv_lib.Conv.(=)(!pos_cnum_field)None),"pos_cnum")]))))|Ppx_sexp_conv_lib.Sexp.Atom_assexp->Ppx_sexp_conv_lib.Conv_error.record_list_instead_atom_tp_locsexpletsexp_of_t:t->Ppx_sexp_conv_lib.Sexp.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_cnumin(Ppx_sexp_conv_lib.Sexp.List[Ppx_sexp_conv_lib.Sexp.Atom"pos_cnum";arg])::bndsinletbnds=letarg=sexp_of_intv_pos_bolin(Ppx_sexp_conv_lib.Sexp.List[Ppx_sexp_conv_lib.Sexp.Atom"pos_bol";arg])::bndsinletbnds=letarg=sexp_of_intv_pos_lnumin(Ppx_sexp_conv_lib.Sexp.List[Ppx_sexp_conv_lib.Sexp.Atom"pos_lnum";arg])::bndsinletbnds=letarg=sexp_of_stringv_pos_fnamein(Ppx_sexp_conv_lib.Sexp.List[Ppx_sexp_conv_lib.Sexp.Atom"pos_fname";arg])::bndsinPpx_sexp_conv_lib.Sexp.Listbnds[@@@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_bolletsexp_of_tt=Sexp.Atom(to_stringt)