Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file opamCompat.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111(**************************************************************************)(* *)(* Copyright 2018 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=lowercaseend#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#endifmodule Uchar=#ifOCAML_VERSION>=(4,3,0)Uchar#elsestructtypet=intletof_inti=iexternalto_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#endif