1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556typet=(*IF_NOT_AT_LEAST 504 Ocaml_common.Longident.t = *)|Lidentofstring|Ldotoft*string|Lapplyoft*tletrecflataccu=function|Lidents-> s::accu|Ldot(lid,s)->flat(s::accu)lid|Lapply(_,_)->Misc.fatal_error"Longident.flat"letflattenlid=flat[]lidletrecsplit_at_dotsspos=tryletdot=String.index_fromspos'.'inString.subspos (dot-pos)::split_at_dotss(dot+1)withNot_found->[String.subspos(String.lengths-pos)]letunflattenl=match lwith|[]->None|hd::tl->Some(List.fold_left(funps->Ldot(p,s))(Lidenthd)tl)letparses=matchunflatten (split_at_dots s0)with|None->Lident""(* should not happen, but don't put assert false
so as not to crash the toplevel (see Genprintval) *)|Somev->vletrecto_504_pluslid=letloc=Location.none inmatchlidwith|Lidents->Longident_504.Lidents|Ldot(lid,s)->Longident_504.Ldot({txt=to_504_pluslid;loc},{txt=s;loc})|Lapply (lid,lid2)->Longident_504.Lapply({txt=to_504_pluslid;loc},{txt=to_504_pluslid2;loc})letrecfrom_504_pluslid=matchlidwith|Longident_504.Lident s->Lidents|Longident_504.Ldot(lid,s)->Ldot(from_504_pluslid.txt,s.txt)|Longident_504.Lapply(lid,lid2)->Lapply(from_504_pluslid.txt,from_504_pluslid2.txt)letto_compilerlid=(*IF_NOT_AT_LEAST504 lid *)(*IF_AT_LEAST 504 to_504_plus lid *)letfrom_compilerlid=(*IF_NOT_AT_LEAST504 lid *)(*IF_AT_LEAST 504 from_504_plus lid *)