Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file opamCompat.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152(**************************************************************************)(* *)(* Copyright 2018-2020 OCamlPro *)(* *)(* All rights reserved. This file is distributed under the terms of the *)(* GNU Lesser General Public License version 2.1, with the special *)(* exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)moduleString=#ifOCAML_VERSION>=(4,3,0)String#elsestructincludeStringletlowercase_ascii=lowercaseletuppercase_ascii=uppercaseletcapitalize_ascii=capitalizeend#endifmoduleChar=#ifOCAML_VERSION>=(4,3,0)Char#elsestructincludeCharletlowercase_ascii=lowercaseletuppercase_ascii=uppercaseend#endifmoduleEither=#ifOCAML_VERSION>=(4,12,0)Either#elsestructtype ('a,'b)t=|Leftof'a|Rightof'bend#endifmodulePrintexc=#ifOCAML_VERSION >=(4,5,0)Printexc#elsestructincludePrintexcletraise_with_backtrace e_bt=raiseeend#endifmoduleUnix=#ifOCAML_VERSION>=(4,6,0)Unix#elsestructincludeUnixletmap_file=Bigarray.Genarray.map_fileend#endifmoduleUchar=#ifOCAML_VERSION>=(4,3,0)Uchar#elsestructtypet=intletof_inti=iexternal to_int:t->int="%identity"end#endifmoduleBuffer=#ifOCAML_VERSION>=(4,6,0)Buffer#elsestructincludeBufferletadd_utf_8_ucharbu=matchUchar.to_intuwith|uwhenu<0->assertfalse|uwhenu<=0x007F->add_charb(Char.unsafe_chru)|uwhenu<=0x07FF->add_charb(Char.unsafe_chr(0xC0lor(ulsr6)));add_charb(Char.unsafe_chr(0x80lor(uland0x3F)))|uwhenu<=0xFFFF->add_charb(Char.unsafe_chr(0xE0lor(ulsr12)));add_charb(Char.unsafe_chr(0x80lor((ulsr6)land0x3F)));add_charb(Char.unsafe_chr(0x80lor(uland0x3F)))|uwhenu<=0x10FFFF->add_charb(Char.unsafe_chr(0xF0lor(ulsr18)));add_charb(Char.unsafe_chr(0x80lor((ulsr12)land0x3F)));add_charb(Char.unsafe_chr(0x80lor((ulsr6)land0x3F)));add_charb(Char.unsafe_chr(0x80lor(uland0x3F)))|_->assertfalseend#endifmoduleFilename=#ifOCAML_VERSION>=(4,4,0)Filename#elsestructincludeFilenameletextensionfn=matchFilename.chop_extensionfnwith|base->letl=String.lengthbaseinString.subfnl(String.lengthfn-l)|exceptionInvalid_argument_->""end#endifmoduleResult=#ifOCAML_VERSION>=(4,8,0)Result#elsestructtype('a,'e)t#ifOCAML_VERSION>=(4,3,0)=('a,'e)result#endif=Okof'a|Errorof'eend#endif#ifOCAML_VERSION<(4,7,0)moduleStdlib=Pervasives#endifmoduleLazy=#ifOCAML_VERSION>=(4,13,0)Lazy#elsestructincludeLazyletmapfx=lazy(f(forcex))end#endif