text stringlengths 12 786k |
|---|
type ( ' p , ' b , ' c , ' e , ' f ) padprec_fmt_ebb = Padprec_fmt_EBB : ( ' x , ' y ) padding * ( ' y , ' p -> ' a ) precision * ( ' a , ' b , ' c , ' d , ' e , ' f ) fmt -> ( ' p , ' b , ' c , ' e , ' f ) padprec_fmt_ebb |
type ( ' b , ' c , ' e , ' f ) fmt_ebb = Fmt_EBB : ( ' a , ' b , ' c , ' d , ' e , ' f ) fmt -> ( ' b , ' c , ' e , ' f ) fmt_ebb |
type ( ' a , ' b , ' c , ' d , ' e , ' f ) fmt_fmtty_ebb = Fmt_fmtty_EBB : ( ' a , ' b , ' c , ' d , ' y , ' x ) fmt * ( ' x , ' b , ' c , ' y , ' e , ' f ) fmtty -> ( ' a , ' b , ' c , ' d , ' e , ' f ) fmt_fmtt... |
type ( ' a , ' b , ' c , ' d , ' e , ' f ) fmtty_fmt_ebb = Fmtty_fmt_EBB : ( ' a , ' b , ' c , ' d , ' y , ' x ) fmtty * ( ' x , ' b , ' c , ' y , ' e , ' f ) fmt_fmtty_ebb -> ( ' a , ' b , ' c , ' d , ' e , ' f ) ... |
type fmtty_ebb = Fmtty_EBB : ( ' a , ' b , ' c , ' d , ' e , ' f ) fmtty -> fmtty_ebb |
type padding_ebb = Padding_EBB : ( ' a , ' b ) padding -> padding_ebb |
type precision_ebb = Precision_EBB : ( ' a , ' b ) precision -> precision_ebb |
let default_float_precision fconv = match snd fconv with | Float_f | Float_e | Float_E | Float_g | Float_G | Float_h | Float_H | Float_CF -> - 6 | Float_F -> 12 = " caml_format_float " = " caml_format_int " = " caml_int32_format " = " caml_nativeint_format " = " caml_int64_format "... |
type buffer = { mutable ind : int ; mutable bytes : bytes ; } |
let buffer_create init_size = { ind = 0 ; bytes = Bytes . create init_size } |
let buffer_check_size buf overhead = let len = Bytes . length buf . bytes in let min_len = buf . ind + overhead in if min_len > len then ( let new_len = max ( len * 2 ) min_len in let new_str = Bytes . create new_len in Bytes . blit buf . bytes 0 new_str 0 len ; buf . bytes <- new_str ... |
let buffer_add_char buf c = buffer_check_size buf 1 ; Bytes . set buf . bytes buf . ind c ; buf . ind <- buf . ind + 1 |
let buffer_add_string buf s = let str_len = String . length s in buffer_check_size buf str_len ; String . blit s 0 buf . bytes buf . ind str_len ; buf . ind <- buf . ind + str_len |
let buffer_contents buf = Bytes . sub_string buf . bytes 0 buf . ind |
let char_of_iconv iconv = match iconv with | Int_d | Int_pd | Int_sd | Int_Cd -> ' d ' | Int_i | Int_pi | Int_si | Int_Ci -> ' i ' | Int_x | Int_Cx -> ' x ' | Int_X | Int_CX -> ' X ' | Int_o | Int_Co -> ' o ' | Int_u | Int_Cu -> ' u ' |
let char_of_fconv ( ? cF ' = F ' ) fconv = match snd fconv with | Float_f -> ' f ' | Float_e -> ' e ' | Float_E -> ' E ' | Float_g -> ' g ' | Float_G -> ' G ' | Float_F -> cF | Float_h -> ' h ' | Float_H -> ' H ' | Float_CF -> ' F ' |
let char_of_counter counter = match counter with | Line_counter -> ' l ' | Char_counter -> ' n ' | Token_counter -> ' N ' |
let bprint_char_set buf char_set = let rec print_start set = let is_alone c = let before , after = Char . ( chr ( code c - 1 ) , chr ( code c + 1 ) ) in is_in_char_set set c && not ( is_in_char_set set before && is_in_char_set set after ) in if is_alone ' ] ' then buffer_add_char b... |
let bprint_padty buf padty = match padty with | Left -> buffer_add_char buf ' ' - | Right -> ( ) | Zeros -> buffer_add_char buf ' 0 ' |
let bprint_ignored_flag buf ign_flag = if ign_flag then buffer_add_char buf ' _ ' |
let bprint_pad_opt buf pad_opt = match pad_opt with | None -> ( ) | Some width -> buffer_add_string buf ( Int . to_string width ) |
let bprint_padding : type a b . buffer -> ( a , b ) padding -> unit = | No_padding -> ( ) | Lit_padding ( padty , n ) -> bprint_padty buf padty ; buffer_add_string buf ( Int . to_string n ) ; | Arg_padding padty -> bprint_padty buf padty ; buffer_add_char buf ' ' * |
let bprint_precision : type a b . buffer -> ( a , b ) precision -> unit = fun buf prec -> match prec with | No_precision -> ( ) | Lit_precision n -> buffer_add_char buf ' . ' ; buffer_add_string buf ( Int . to_string n ) ; | Arg_precision -> buffer_add_string buf " . " * |
let bprint_iconv_flag buf iconv = match iconv with | Int_pd | Int_pi -> buffer_add_char buf ' ' + | Int_sd | Int_si -> buffer_add_char buf ' ' | Int_Cx | Int_CX | Int_Co | Int_Cd | Int_Ci | Int_Cu -> buffer_add_char buf ' ' # | Int_d | Int_i | Int_x | Int_X | Int_o | Int_u -> ( ) |
let bprint_int_fmt buf ign_flag iconv pad prec = buffer_add_char buf ' ' ; % bprint_ignored_flag buf ign_flag ; bprint_iconv_flag buf iconv ; bprint_padding buf pad ; bprint_precision buf prec ; buffer_add_char buf ( char_of_iconv iconv ) |
let bprint_altint_fmt buf ign_flag iconv pad prec c = buffer_add_char buf ' ' ; % bprint_ignored_flag buf ign_flag ; bprint_iconv_flag buf iconv ; bprint_padding buf pad ; bprint_precision buf prec ; buffer_add_char buf c ; buffer_add_char buf ( char_of_iconv iconv ) |
let bprint_fconv_flag buf fconv = begin match fst fconv with | Float_flag_p -> buffer_add_char buf ' ' + | Float_flag_s -> buffer_add_char buf ' ' | Float_flag_ -> ( ) end ; match snd fconv with | Float_CF -> buffer_add_char buf ' ' # | Float_f | Float_e | Float_E | Float_g | Float_G ... |
let bprint_float_fmt buf ign_flag fconv pad prec = buffer_add_char buf ' ' ; % bprint_ignored_flag buf ign_flag ; bprint_fconv_flag buf fconv ; bprint_padding buf pad ; bprint_precision buf prec ; buffer_add_char buf ( char_of_fconv fconv ) |
let string_of_formatting_lit formatting_lit = match formatting_lit with | Close_box -> " ] " @ | Close_tag -> " } " @ | Break ( str , _ , _ ) -> str | FFlush -> " " @? | Force_newline -> " @\ n " | Flush_newline -> " . " @ | Magic_size ( str , _ ) -> str |... |
let bprint_char_literal buf chr = match chr with | ' ' % -> buffer_add_string buf " " %% | _ -> buffer_add_char buf chr |
let bprint_string_literal buf str = for i = 0 to String . length str - 1 do bprint_char_literal buf str . [ i ] done |
let rec bprint_fmtty : type a b c d e f g h i j k l . buffer -> ( a , b , c , d , e , f , g , h , i , j , k , l ) fmtty_rel -> unit = | Char_ty rest -> buffer_add_string buf " % c " ; bprint_fmtty buf rest ; | String_ty rest -> buffer_add_string buf " % s " ; bprint_f... |
let rec int_of_custom_arity : type a b c . ( a , b , c ) custom_arity -> int = function | Custom_zero -> 0 | Custom_succ x -> 1 + int_of_custom_arity x |
let bprint_fmt buf fmt = let rec fmtiter : type a b c d e f . ( a , b , c , d , e , f ) fmt -> bool -> unit = fun fmt ign_flag -> match fmt with | String ( pad , rest ) -> buffer_add_char buf ' ' ; % bprint_ignored_flag buf ign_flag ; bprint_padding buf pad ; buffer_add_char buf... |
let string_of_fmt fmt = let buf = buffer_create 16 in bprint_fmt buf fmt ; buffer_contents buf |
type ( _ , _ ) eq = Refl : ( ' a , ' a ) eq |
let rec symm : type a1 b1 c1 d1 e1 f1 a2 b2 c2 d2 e2 f2 . ( a1 , b1 , c1 , d1 , e1 , f1 , a2 , b2 , c2 , d2 , e2 , f2 ) fmtty_rel a1 , b1 , c1 , d1 , e1 , f1 ) fmtty_rel | Char_ty rest -> Char_ty ( symm rest ) | Int_ty rest -> Int_ty ( symm rest ) | Int32_ty rest -... |
let rec fmtty_rel_det : type a1 b c d1 e1 f1 a2 d2 e2 f2 . ( a1 , b , c , d1 , e1 , f1 , a2 , b , c , d2 , e2 , f2 ) fmtty_rel -> ( ( f1 , f2 ) eq -> ( a1 , a2 ) eq ) * ( ( a1 , a2 ) eq -> ( f1 , f2 ) eq ) * ( ( e1 , e2 ) eq -> ( d1 , d2 ) ... |
let rec fmtty_of_formatting_gen : type a b c d e f . ( a , b , c , d , e , f ) formatting_gen -> ( a , b , c , d , e , f ) fmtty = | Open_tag ( Format ( fmt , _ ) ) -> fmtty_of_fmt fmt | Open_box ( Format ( fmt , _ ) ) -> fmtty_of_fmt fmt ( a , b , c , ... |
let type_padding : type a b c d e f x y . ( x , y ) padding -> ( a , b , c , d , e , f ) fmtty -> ( a , b , c , d , e , f ) padding_fmtty_ebb = | No_padding , _ -> Padding_fmtty_EBB ( No_padding , fmtty ) | Lit_padding ( padty , w ) , _ -> Padding_fmtty_EBB ... |
let type_padprec : type a b c d e f x y z . ( x , y ) padding -> ( y , z ) precision -> ( a , b , c , d , e , f ) fmtty -> ( a , b , c , d , e , f ) padprec_fmtty_ebb = | No_precision , Padding_fmtty_EBB ( pad , rest ) -> Padprec_fmtty_EBB ( pad , No_precisio... |
let rec type_format : type a1 b1 c1 d1 e1 f1 a2 b2 c2 d2 e2 f2 . ( a1 , b1 , c1 , d1 , e1 , f1 ) fmt -> ( a2 , b2 , c2 , d2 , e2 , f2 ) fmtty -> ( a2 , b2 , c2 , d2 , e2 , f2 ) fmt | Fmt_fmtty_EBB ( fmt ' , End_of_fmtty ) -> fmt ' | _ -> raise Type_mismatch ... |
let recast : type a1 b1 c1 d1 e1 f1 a2 b2 c2 d2 e2 f2 . ( a1 , b1 , c1 , d1 , e1 , f1 ) fmt -> ( a1 , b1 , c1 , d1 , e1 , f1 , a2 , b2 , c2 , d2 , e2 , f2 ) fmtty_rel -> ( a2 , b2 , c2 , d2 , e2 , f2 ) fmt type_format fmt ( erase_rel ( symm fmtty ) ) |
let fix_padding padty width str = let len = String . length str in let width , padty = abs width , if width < 0 then Left else padty in if width <= len then str else let res = Bytes . make width ( if padty = Zeros then ' 0 ' else ' ' ) in begin match padty with | Left -> String . blit s... |
let fix_int_precision prec str = let prec = abs prec in let len = String . length str in match str . [ 0 ] with | ( ' ' + | ' ' - | ' ' ) as c when prec + 1 > len -> let res = Bytes . make ( prec + 1 ) ' 0 ' in Bytes . set res 0 c ; String . blit str 1 res ( ... |
let string_to_caml_string str = let str = String . escaped str in let l = String . length str in let res = Bytes . make ( l + 2 ) ' " ' \ in String . unsafe_blit str 0 res 1 l ; Bytes . unsafe_to_string res |
let format_of_iconv = function | Int_d | Int_Cd -> " % d " | Int_pd -> " %+ d " | Int_sd -> " % d " | Int_i | Int_Ci -> " % i " | Int_pi -> " %+ i " | Int_si -> " % i " | Int_x -> " % x " | Int_Cx -> " %# x " | Int_X -> " % X " | Int_CX -> " %# X " ... |
let format_of_iconvL = function | Int_d | Int_Cd -> " % Ld " | Int_pd -> " %+ Ld " | Int_sd -> " % Ld " | Int_i | Int_Ci -> " % Li " | Int_pi -> " %+ Li " | Int_si -> " % Li " | Int_x -> " % Lx " | Int_Cx -> " %# Lx " | Int_X -> " % LX " | Int_CX -> " ... |
let format_of_iconvl = function | Int_d | Int_Cd -> " % ld " | Int_pd -> " %+ ld " | Int_sd -> " % ld " | Int_i | Int_Ci -> " % li " | Int_pi -> " %+ li " | Int_si -> " % li " | Int_x -> " % lx " | Int_Cx -> " %# lx " | Int_X -> " % lX " | Int_CX -> " ... |
let format_of_iconvn = function | Int_d | Int_Cd -> " % nd " | Int_pd -> " %+ nd " | Int_sd -> " % nd " | Int_i | Int_Ci -> " % ni " | Int_pi -> " %+ ni " | Int_si -> " % ni " | Int_x -> " % nx " | Int_Cx -> " %# nx " | Int_X -> " % nX " | Int_CX -> " ... |
let format_of_fconv fconv prec = let prec = abs prec in let symb = char_of_fconv ~ cF ' : g ' fconv in let buf = buffer_create 16 in buffer_add_char buf ' ' ; % bprint_fconv_flag buf fconv ; buffer_add_char buf ' . ' ; buffer_add_string buf ( Int . to_string prec ) ; buffer_add_char ... |
let transform_int_alt iconv s = match iconv with | Int_Cd | Int_Ci | Int_Cu -> let digits = let n = ref 0 in for i = 0 to String . length s - 1 do match String . unsafe_get s i with | ' 0 ' . . ' 9 ' -> incr n | _ -> ( ) done ; ! n in let buf = Bytes . create ( String . ... |
let convert_int iconv n = transform_int_alt iconv ( format_int ( format_of_iconv iconv ) n ) |
let convert_int32 iconv n = transform_int_alt iconv ( format_int32 ( format_of_iconvl iconv ) n ) |
let convert_nativeint iconv n = transform_int_alt iconv ( format_nativeint ( format_of_iconvn iconv ) n ) |
let convert_int64 iconv n = transform_int_alt iconv ( format_int64 ( format_of_iconvL iconv ) n ) |
let convert_float fconv prec x = let hex ( ) = let sign = match fst fconv with | Float_flag_p -> ' ' + | Float_flag_s -> ' ' | _ -> ' ' - in hexstring_of_float x prec sign in let add_dot_if_needed str = let len = String . length str in let rec is_valid i = if i = len then false else ma... |
let format_caml_char c = let str = Char . escaped c in let l = String . length str in let res = Bytes . make ( l + 2 ) ' ' ' \ in String . unsafe_blit str 0 res 1 l ; Bytes . unsafe_to_string res |
let string_of_fmtty fmtty = let buf = buffer_create 16 in bprint_fmtty buf fmtty ; buffer_contents buf |
let rec make_printf : type a b c d e f . ( ( b , c ) acc -> f ) -> ( b , c ) acc -> ( a , b , c , d , e , f ) fmt -> a = | Char rest -> fun c -> let new_acc = Acc_data_char ( acc , c ) in make_printf k new_acc rest | Caml_char rest -> fun c -> let new_acc = Acc_data_s... |
let const x _ = x |
let rec make_iprintf : type a b c d e f state . ( state -> f ) -> state -> ( a , b , c , d , e , f ) fmt -> a = fun k o fmt -> match fmt with | Char rest -> const ( make_iprintf k o rest ) | Caml_char rest -> const ( make_iprintf k o rest ) | String ( No_padding , rest ) -... |
let rec output_acc o acc = match acc with | Acc_formatting_lit ( p , fmting_lit ) -> let s = string_of_formatting_lit fmting_lit in output_acc o p ; output_string o s ; | Acc_formatting_gen ( p , Acc_open_tag acc ' ) -> output_acc o p ; output_string o " { " ; @ output_acc o acc ' ;... |
let rec bufput_acc b acc = match acc with | Acc_formatting_lit ( p , fmting_lit ) -> let s = string_of_formatting_lit fmting_lit in bufput_acc b p ; Buffer . add_string b s ; | Acc_formatting_gen ( p , Acc_open_tag acc ' ) -> bufput_acc b p ; Buffer . add_string b " { " ; @ bufput... |
let rec strput_acc b acc = match acc with | Acc_formatting_lit ( p , fmting_lit ) -> let s = string_of_formatting_lit fmting_lit in strput_acc b p ; Buffer . add_string b s ; | Acc_formatting_gen ( p , Acc_open_tag acc ' ) -> strput_acc b p ; Buffer . add_string b " { " ; @ strput... |
let failwith_message ( Format ( fmt , _ ) ) = let buf = Buffer . create 256 in let k acc = strput_acc buf acc ; failwith ( Buffer . contents buf ) in make_printf k End_of_acc fmt |
let open_box_of_string str = if str = " " then ( 0 , Pp_box ) else let len = String . length str in let invalid_box ( ) = failwith_message " invalid box description % S " str in let rec parse_spaces i = if i = len then i else match str . [ i ] with | ' ' | ' \ t ' -> parse_... |
let make_padding_fmt_ebb : type x y . ( x , y ) padding -> ( _ , _ , _ , _ , _ , _ ) fmt -> ( _ , _ , _ , _ , _ ) padding_fmt_ebb = | No_padding -> Padding_fmt_EBB ( No_padding , fmt ) | Lit_padding ( s , w ) -> Padding_fmt_EBB ( Lit_padding ( s , w... |
let make_precision_fmt_ebb : type x y . ( x , y ) precision -> ( _ , _ , _ , _ , _ , _ ) fmt -> ( _ , _ , _ , _ , _ ) precision_fmt_ebb = | No_precision -> Precision_fmt_EBB ( No_precision , fmt ) | Lit_precision p -> Precision_fmt_EBB ( Lit_precision p , f... |
let make_padprec_fmt_ebb : type x y z t . ( x , y ) padding -> ( z , t ) precision -> ( _ , _ , _ , _ , _ , _ ) fmt -> ( _ , _ , _ , _ , _ ) padprec_fmt_ebb = let Precision_fmt_EBB ( prec , fmt ' ) = make_precision_fmt_ebb prec fmt in match pad with | No... |
let fmt_ebb_of_string ? legacy_behavior str = let legacy_behavior = match legacy_behavior with | Some flag -> flag | None -> true in let invalid_format_message str_ind msg = failwith_message " invalid format % S : at character number % d , % s " str str_ind msg in let unexpected_end_of_format end_ind ... |
let format_of_string_fmtty str fmtty = let Fmt_EBB fmt = fmt_ebb_of_string str in try Format ( type_format fmt fmtty , str ) with Type_mismatch -> failwith_message " bad input : format type mismatch between % S and % S " str ( string_of_fmtty fmtty ) |
let format_of_string_format str ( Format ( fmt ' , str ' ) ) = let Fmt_EBB fmt = fmt_ebb_of_string str in try Format ( type_format fmt ( fmtty_of_fmt fmt ' ) , str ) with Type_mismatch -> failwith_message " bad input : format type mismatch between % S and % S " str str ' |
module Stdlib = struct external register_named_value : string -> ' a -> unit = " caml_register_named_value " let ( ) = register_named_value " Pervasives . array_bound_error " ( Invalid_argument " index out of bounds " ) external raise : exn -> ' a = " % raise " external raise_not... |
let create_char_set ( ) = Bytes . make 32 ' \ 000 ' |
let add_in_char_set char_set c = let ind = int_of_char c in let str_ind = ind lsr 3 and mask = 1 lsl ( ind land 0b111 ) in Bytes . set char_set str_ind ( char_of_int ( int_of_char ( Bytes . get char_set str_ind ) lor mask ) ) |
let freeze_char_set char_set = Bytes . to_string char_set |
let rev_char_set char_set = let char_set ' = create_char_set ( ) in for i = 0 to 31 do Bytes . set char_set ' i ( char_of_int ( int_of_char ( String . get char_set i ) lxor 0xFF ) ) done ; Bytes . unsafe_to_string char_set ' |
let is_in_char_set char_set c = let ind = int_of_char c in let str_ind = ind lsr 3 and mask = 1 lsl ( ind land 0b111 ) in int_of_char ( String . get char_set str_ind ) land mask <> 0 |
type ( ' a , ' b , ' c , ' d , ' e , ' f ) param_format_ebb = | Param_format_EBB : ( ' x -> ' a , ' b , ' c , ' d , ' e , ' f ) fmt -> ( ' a , ' b , ' c , ' d , ' e , ' f ) param_format_ebb |
let pad_of_pad_opt pad_opt = match pad_opt with | None -> No_padding | Some width -> Lit_padding ( Right , width ) |
let prec_of_prec_opt prec_opt = match prec_opt with None -> No_precision | Some ndec -> Lit_precision ndec |
let param_format_of_ignored_format : type a b c d e f x y . ( a , b , c , d , y , x ) ignored -> ( x , b , c , y , e , f ) fmt -> ( a , b , c , d , e , f ) param_format_ebb = fun ign fmt -> match ign with | Ignored_char -> Param_format_EBB ( Char fmt ) | Ignored_c... |
type ( ' b , ' c ) acc_formatting_gen = | Acc_open_tag of ( ' b , ' c ) acc | Acc_open_box of ( ' b , ' c ) acc | Acc_formatting_lit of ( ' b , ' c ) acc * formatting_lit | Acc_formatting_gen of ( ' b , ' c ) acc * ( ' b , ' c ) acc_formatting_gen | Ac... |
type ( ' a , ' b ) heter_list = | Cons : ' c * ( ' a , ' b ) heter_list -> ( ' c -> ' a , ' b ) heter_list | Nil : ( ' b , ' b ) heter_list |
type ( ' a , ' b , ' c , ' d , ' e , ' f ) padding_fmtty_ebb = | Padding_fmtty_EBB : ( ' x , ' y ) padding * ( ' y , ' b , ' c , ' d , ' e , ' f ) fmtty -> ( ' x , ' b , ' c , ' d , ' e , ' f ) padding_fmtty_ebb |
type ( ' a , ' b , ' c , ' d , ' e , ' f ) padprec_fmtty_ebb = | Padprec_fmtty_EBB : ( ' x , ' y ) padding * ( ' y , ' z ) precision * ( ' z , ' b , ' c , ' d , ' e , ' f ) fmtty -> ( ' x , ' b , ' c , ' d , ' e , ' f ... |
type ( ' a , ' b , ' c , ' e , ' f ) padding_fmt_ebb = | Padding_fmt_EBB : ( _ , ' x -> ' a ) padding * ( ' a , ' b , ' c , ' d , ' e , ' f ) fmt -> ( ' x , ' b , ' c , ' e , ' f ) padding_fmt_ebb |
type ( ' a , ' b , ' c , ' e , ' f ) precision_fmt_ebb = | Precision_fmt_EBB : ( _ , ' x -> ' a ) precision * ( ' a , ' b , ' c , ' d , ' e , ' f ) fmt -> ( ' x , ' b , ' c , ' e , ' f ) precision_fmt_ebb |
type ( ' p , ' b , ' c , ' e , ' f ) padprec_fmt_ebb = | Padprec_fmt_EBB : ( ' x , ' y ) padding * ( ' y , ' p -> ' a ) precision * ( ' a , ' b , ' c , ' d , ' e , ' f ) fmt -> ( ' p , ' b , ' c , ' e , ' f ) padprec_fmt_... |
type ( ' b , ' c , ' e , ' f ) fmt_ebb = | Fmt_EBB : ( ' a , ' b , ' c , ' d , ' e , ' f ) fmt -> ( ' b , ' c , ' e , ' f ) fmt_ebb |
type ( ' a , ' b , ' c , ' d , ' e , ' f ) fmt_fmtty_ebb = | Fmt_fmtty_EBB : ( ' a , ' b , ' c , ' d , ' y , ' x ) fmt * ( ' x , ' b , ' c , ' y , ' e , ' f ) fmtty -> ( ' a , ' b , ' c , ' d , ' e , ' f ) fmt_f... |
type ( ' a , ' b , ' c , ' d , ' e , ' f ) fmtty_fmt_ebb = | Fmtty_fmt_EBB : ( ' a , ' b , ' c , ' d , ' y , ' x ) fmtty * ( ' x , ' b , ' c , ' y , ' e , ' f ) fmt_fmtty_ebb -> ( ' a , ' b , ' c , ' d , ' e , ' f... |
type fmtty_ebb = Fmtty_EBB : ( ' a , ' b , ' c , ' d , ' e , ' f ) fmtty -> fmtty_ebb |
type padding_ebb = Padding_EBB : ( ' a , ' b ) padding -> padding_ebb |
type precision_ebb = Precision_EBB : ( ' a , ' b ) precision -> precision_ebb |
let default_float_precision fconv = match snd fconv with | Float_f | Float_e | Float_E | Float_g | Float_G | Float_h | Float_H -> - 6 | Float_F -> 12 = " caml_nativeint_format " = " caml_hexstring_of_float " |
type buffer = { mutable ind : int ; mutable bytes : bytes } |
let buffer_create init_size = { ind = 0 ; bytes = Bytes . create init_size } |
let buffer_check_size buf overhead = let len = Bytes . length buf . bytes in let min_len = buf . ind + overhead in if min_len > len then ( let new_len = max ( len * 2 ) min_len in let new_str = Bytes . create new_len in Bytes . blit buf . bytes 0 new_str 0 len ; buf . bytes <- new_str ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.