1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798open!ImportmoduleInt=Int0moduleString=String0moduleT=structtypet=Caml.Lexing.position={pos_fname:string;pos_lnum:int;pos_bol:int;pos_cnum:int}[@@deriving_inlinecompare,hash,sexp_of]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;;letsexp_of_t=(fun{pos_fname=pos_fname__004_;pos_lnum=pos_lnum__006_;pos_bol=pos_bol__008_;pos_cnum=pos_cnum__010_}->letbnds__003_=[]inletbnds__003_=letarg__011_=sexp_of_intpos_cnum__010_inSexplib0.Sexp.List[Sexplib0.Sexp.Atom"pos_cnum";arg__011_]::bnds__003_inletbnds__003_=letarg__009_=sexp_of_intpos_bol__008_inSexplib0.Sexp.List[Sexplib0.Sexp.Atom"pos_bol";arg__009_]::bnds__003_inletbnds__003_=letarg__007_=sexp_of_intpos_lnum__006_inSexplib0.Sexp.List[Sexplib0.Sexp.Atom"pos_lnum";arg__007_]::bnds__003_inletbnds__003_=letarg__005_=sexp_of_stringpos_fname__004_inSexplib0.Sexp.List[Sexplib0.Sexp.Atom"pos_fname";arg__005_]::bnds__003_inSexplib0.Sexp.Listbnds__003_:t->Sexplib0.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)