123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141letlookup_value=#ifOCAML_VERSION>=(4,10,0)Env.find_value_by_name#elseEnv.lookup_value#endifletget_descx=#ifOCAML_VERSION>=(4,14,0)Types.get_descx#elsex.Types.desc#endiflettoploop_get_directivename=#ifOCAML_VERSION>=(4,13,0)Toploop.get_directivename#elsetrySome(Hashtbl.findToploop.directive_tablename)withNot_found->None#endifletlookup_modulenameenv=#ifOCAML_VERSION>=(4,10,0)letpath,md=Env.find_module_by_namenameenvin#elseletpath=Env.lookup_modulenameenv~load:trueinletmd=Env.find_modulepathenvin#endif(path,md.md_type)letlookup_label=#ifOCAML_VERSION>=(4,10,0)Env.find_label_by_name#elseEnv.lookup_label#endifletlookup_modtype=#ifOCAML_VERSION>=(4,10,0)Env.find_modtype_by_name#elseEnv.lookup_modtype#endifletlookup_constructor=#ifOCAML_VERSION>=(4,10,0)Env.find_constructor_by_name#elseEnv.lookup_constructor#endifletlookup_class=#ifOCAML_VERSION>=(4,10,0)Env.find_class_by_name#elseEnv.lookup_class#endifletlongident_parsestr=#ifOCAML_VERSION>=(4,11,0)letlexbuf=Lexing.from_stringstrinParse.longidentlexbuf#elseLongident.parsestr#endiflettoploop_all_directive_names()=#ifOCAML_VERSION>=(4,13,0)Toploop.all_directive_names()#elseHashtbl.fold(fundir_acc->dir::acc)Toploop.directive_table[]#endif#ifOCAML_VERSION>=(4,10,0)letlookup_typelongidentenv=Env.find_type_by_namelongidentenv#elseletlookup_typelongidentenv=letpath=Env.lookup_typelongidentenvin(path,Env.find_typepathenv)#endifletset_load_pathpath=#ifOCAML_VERSION>=(5,0,0)Load_path.initpath~auto_include:Load_path.no_auto_include#elseLoad_path.initpath#endiflettoploop_use_silentlyfmtname=#ifOCAML_VERSION>=(4,14,0)Toploop.use_silentlyfmt(Filename)#elseToploop.use_silentlyfmtname#endifmodulePersistent_signature=#ifOCAML_VERSION>=(4,09,0)Persistent_env.Persistent_signature#elseEnv.Persistent_signature#endiflettoploop_set_paths()=#ifOCAML_VERSION>=(5,0,0)Toploop.set_paths~auto_include:Load_path.no_auto_include()#elseToploop.set_paths()#endiflettoploop_load_fileppffn=#ifOCAML_VERSION>=(4,13,0)Toploop.load_fileppffn#elseTopdirs.load_fileppffn#endifletiter_structureexpr=#ifOCAML_VERSION>=(4,09,0)letnextiteratore=Tast_iterator.default_iterator.expriteratoreinletexpriterator=expr(nextiterator)inletiter={Tast_iterator.default_iteratorwithexpr}initer.structureiter#elseletmoduleSearch=TypedtreeIter.MakeIterator(structincludeTypedtreeIter.DefaultIteratorArgumentletenter_expression=exprignoreend)inSearch.iter_structure#endif(** Returns whether the given path is persistent. *)letrecis_persistent_path=function|Path.Pidentid->Ident.persistentid|Path.Pdot(p,_)->is_persistent_pathp|Path.Papply(_,p)->is_persistent_pathp#ifOCAML_VERSION>=(5,1,0)|Path.Pextra_ty(p,_)->is_persistent_pathp#endif