text stringlengths 12 786k |
|---|
let ( ) = Printtyp . Naming_context . enable false |
let string_of_variance t ( co , cn ) = if ( t . Odoc_type . ty_kind = Odoc_type . Type_abstract || t . Odoc_type . ty_kind = Odoc_type . Type_open ) && t . Odoc_type . ty_manifest = None then match ( co , cn ) with ( true , false ) -> " " + | ( false , true ) ->... |
let rec is_arrow_type t = match t . Types . desc with Types . Tarrow _ -> true | Types . Tlink t2 | Types . Tsubst t2 -> is_arrow_type t2 | Types . Ttuple _ | Types . Tconstr _ | Types . Tvar _ | Types . Tunivar _ | Types . Tobject _ | Types . Tpoly _ | Types . Tfield _ | Ty... |
let raw_string_of_type_list sep type_list = let buf = Buffer . create 256 in let fmt = Format . formatter_of_buffer buf in let rec need_parent t = match t . Types . desc with Types . Tarrow _ | Types . Ttuple _ -> true | Types . Tlink t2 | Types . Tsubst t2 -> need_parent t2 | Types . Tco... |
let string_of_type_list ? par sep type_list = let par = match par with | Some b -> b | None -> match type_list with [ ] | [ _ ] -> false | _ -> true in Printf . sprintf " % s % s % s " ( if par then " ( " else " " ) ( raw_string_of_type_list sep ( List . map ( fun t ... |
let string_of_type_param_list t = let par = match t . Odoc_type . ty_parameters with [ ] | [ _ ] -> false | _ -> true in Printf . sprintf " % s % s % s " ( if par then " ( " else " " ) ( raw_string_of_type_list " , " ( List . map ( fun ( typ , co , cn ) ... |
let string_of_type_extension_param_list te = let par = match te . Odoc_extension . te_type_parameters with [ ] | [ _ ] -> false | _ -> true in Printf . sprintf " % s % s % s " ( if par then " ( " else " " ) ( raw_string_of_type_list " , " ( List . map ( fun typ ... |
let string_of_class_type_param_list l = let par = match l with [ ] | [ _ ] -> false | _ -> true in Printf . sprintf " % s % s % s " ( if par then " [ " else " " ) ( raw_string_of_type_list " , " ( List . map ( fun typ -> ( " " , typ ) ) l ) ) ( if ... |
let string_of_class_params c = let b = Buffer . create 256 in let rec iter = function Types . Cty_arrow ( label , t , ctype ) -> let parent = is_arrow_type t in Printf . bprintf b " % s % s % s % s -> " ( match label with Asttypes . Nolabel -> " " | s -> Printtyp . string_of_la... |
let bool_of_private = function | Asttypes . Private -> true | _ -> false |
let field_doc_str = function | None -> " " | Some t -> Printf . sprintf " " ( Odoc_misc . string_of_info t ) |
let string_of_record l = let module M = Odoc_type in let module P = Printf in P . sprintf " { \ n % s \ n } " ( String . concat " \ n " ( List . map ( fun field -> P . sprintf " % s % s : % s ; % s " ( if field . M . rf_mutable then " mutable " else " " ) fie... |
let string_of_type t = let module M = Odoc_type in let module P = Printf in let priv = bool_of_private t . M . ty_private in let parameters_str = String . concat " " ( List . map ( fun ( p , co , cn ) -> ( string_of_variance t ( co , cn ) ) ^ ( Odoc_print . string_of_type_ex... |
let string_of_type_extension te = let module M = Odoc_extension in let module T = Odoc_type in " type " ( ^ String . concat " " ( List . map ( fun p -> ( Odoc_print . string_of_type_expr p ) " ^ " ) te . M . te_type_parameters ) ) ^ te . M . te_type_name " ^ += " (... |
let string_of_exception e = let module T = Odoc_type in let module M = Odoc_exception in " exception " ( ^ Name . simple e . M . ex_name ) ^ ( match e . M . ex_args , e . M . ex_ret with T . Cstr_tuple [ ] , None -> " " | T . Cstr_tuple l , None -> " of " ^ ( Str... |
let string_of_value v = let module M = Odoc_value in " val " ( ^ Name . simple v . M . val_name ) " ^ : " ^ ( Odoc_print . string_of_type_expr v . M . val_type ) " ^\ n " ^ ( match v . M . val_info with None -> " " | Some i -> Odoc_misc . string_of_info i ) |
let string_of_attribute a = let module M = Odoc_value in " val " ^ ( if a . M . att_virtual then " virtual " else " " ) ^ ( if a . M . att_mutable then Odoc_messages . mutab " ^ " else " " ) ^ ( Name . simple a . M . att_value . M . val_name ) " ^ : " ^ (... |
let string_of_method m = let module M = Odoc_value in " method " ^ ( if m . M . met_private then Odoc_messages . privat " ^ " else " " ) ^ ( Name . simple m . M . met_value . M . val_name ) " ^ : " ^ ( Odoc_print . string_of_type_expr m . M . met_value . M . v... |
module Generator ( G : Odoc_gen . Base ) = struct class string_gen = object ( self ) inherit Odoc_info . Scan . scanner val mutable test_kinds = [ ] val mutable fmt = Format . str_formatter method must_display_types = List . mem Types_display test_kinds method set_test_kinds_from_module m =... |
let _ = Odoc_args . extend_base_generator ( module Generator : Odoc_gen . Base_functor ) ; ; |
let esc_8bits = ref false |
let info_section = ref " OCaml " |
let info_entry = ref [ ] |
let puts_nl chan s = output_string chan s ; output_char chan ' \ n ' |
let puts chan s = output_string chan s |
let nl chan = output_char chan ' \ n ' |
let is = function | None -> false | Some _ -> true |
let pad_to n s = let len = String . length s in if len < n then s ^ String . make ( n - len ) ' ' else s |
let indent nb_sp s = let c = ref 0 in let len = pred ( String . length s ) in for i = 0 to len do if s . [ i ] = ' \ n ' then incr c done ; let s ' = Bytes . make ( succ len + ( succ ! c ) * nb_sp ) ' ' in c := nb_sp ; for i = 0 to len do Bytes . set s ' ! c s . ... |
type subparts = [ | ` Module of Odoc_info . Module . t_module | ` Module_type of Odoc_info . Module . t_module_type | ` Class of Odoc_info . Class . t_class | ` Class_type of Odoc_info . Class . t_class_type ] |
type menu_data = [ | subparts | ` Blank | ` Comment of string | ` Texi of string | ` Index of string |
let nothing = Verbatim " " |
let module_subparts = let rec iter acc = function | [ ] -> List . rev acc | Element_module { m_kind = Module_alias _ } :: n -> iter acc n | Element_module_type { mt_kind = Some ( Module_type_alias _ ) } :: n -> iter acc n | Element_module m :: n -> iter ( ` Module m :: acc ) n ... |
type indices = [ | ` Type | ` Extension | ` Exception | ` Value | ` Class_att | ` Method | ` Class | ` Class_type | ` Module | ` Module_type ] |
let indices = function | ` Type -> " ty " | ` Extension -> " xt " | ` Exception -> " ex " | ` Value -> " va " | ` Class_att -> " ca " | ` Method -> " me " | ` Class -> " cl " | ` Class_type -> " ct " | ` Module -> " mo " | ` Module_type -> " ... |
let indices_names = [ " Types " , " ty " ; " Extensions " , " xt " ; " Exceptions " , " ex " ; " Values " , " va " ; " Class attributes " , " ca " ; " Methods " , " me " ; " Classes " , " cl " ; " Class types " , " ct " ; ... |
module Texi = struct let subst_strings = [ ( Str . regexp " " , @ " " ) @@ ; ( Str . regexp " { " , " { " ) @ ; ( Str . regexp " } " , " } " ) @ ; ( Str . regexp " . . . " , \\\\\\ " @ dots { } " ) ; ] @ ( if ! esc... |
let titles_and_headings = ref [ 0 , ( " @ chapter " , " @ majorheading " ) ; 1 , ( " @ chapter " , " @ majorheading " ) ; 2 , ( " @ section " , " @ heading " ) ; 3 , ( " @ subsection " , " @ subheading " ) ; 4 , ( " @ subsubs... |
let fallback_title = " @ unnumberedsubsubsec " |
let fallback_heading = " @ subsubheading " object ( self ) method escape = Texi . escape method label ? no_ ( : _ : bool option ) ( _ : string ) : string = failwith " gni " method texi_of_text t = String . concat " " ( List . map self # texi_of_text_element t ) method texi... |
module Generator = struct object ( self ) inherit text inherit Odoc_to_text . to_text as to_text val maxdepth = 4 val bullet = Verbatim " @ bullet { } " val minus = Verbatim " @ minus { } " val linebreak = Verbatim " @*\ n " val mutable indices_to_build = [ ` Module ] val node_... |
module type Texi_generator = module type of Generator |
module Texter = struct let text_of_string s = let lexbuf = Lexing . from_string s in try Odoc_text_lexer . init ( ) ; Odoc_text_parser . main Odoc_text_lexer . main lexbuf with _ -> raise ( Text_syntax ( ! Odoc_text_lexer . line_number , ! Odoc_text_lexer . char_number , s ) ) let c... |
module Html = ( val ( match ! Odoc_args . current_generator with None -> ( module Odoc_html . Generator : Odoc_html . Html_generator ) | Some ( Odoc_gen . Html m ) -> m | _ -> failwith " A non - html generator is already set . Cannot install the Todo - list html generator " ) : O... |
module Generator = struct class scanner html = object ( self ) inherit Odoc_info . Scan . scanner val b = Buffer . create 256 method buffer = b method private gen_if_tag name target info_opt = match info_opt with None -> ( ) | Some i -> let l = List . fold_left ( fun acc ( t , text ) ... |
let _ = Odoc_args . set_generator ( Odoc_gen . Html ( module Generator : Odoc_html . Html_generator ) ) ; ; |
object ( self ) val mutable tag_functions = ( [ ] : ( string * ( Odoc_info . text -> Odoc_info . text ) ) list ) method text_of_author_list l = match l with [ ] -> [ ] | _ -> [ Bold [ Raw ( Odoc_messages . authors " ^: " ) ] ; Raw ( String . concat " , ... |
type private_flag = Asttypes . private_flag = Private | Public |
type record_field = { rf_name : string ; rf_mutable : bool ; rf_type : Types . type_expr ; mutable rf_text : Odoc_types . info option ; } |
type constructor_args = | Cstr_record of record_field list | Cstr_tuple of Types . type_expr list |
type variant_constructor = { vc_name : string ; vc_args : constructor_args ; vc_ret : Types . type_expr option ; mutable vc_text : Odoc_types . info option ; } |
type type_kind = Type_abstract | Type_variant of variant_constructor list | Type_record of record_field list | Type_open |
type object_field = { of_name : string ; of_type : Types . type_expr ; mutable of_text : Odoc_types . info option ; } |
type type_manifest = | Other of Types . type_expr | Object_type of object_field list |
type t_type = { ty_name : Name . t ; mutable ty_info : Odoc_types . info option ; ty_parameters : ( Types . type_expr * bool * bool ) list ; ty_kind : type_kind ; ty_private : private_flag ; ty_manifest : type_manifest option ; mutable ty_loc : Odoc_types . location ; mutable ty_co... |
type ref_kind = RK_module | RK_module_type | RK_class | RK_class_type | RK_value | RK_type | RK_extension | RK_exception | RK_attribute | RK_method | RK_section of text | RK_recfield | RK_const | Raw of string | Code of string | CodePre of string | Verbatim of string | Bold of text | Italic of text ... |
type see_ref = See_url of string | See_file of string | See_doc of string |
type see = see_ref * text |
type param = ( string * text ) |
type raised_exception = ( string * text ) |
type info = { i_desc : text option ; i_authors : string list ; i_version : string option ; i_sees : see list ; i_since : string option ; i_before : ( string * text ) list ; i_deprecated : text option ; i_params : param list ; i_raised_exceptions : raised_exception list ; i_return_valu... |
let dummy_info = { i_desc = None ; i_authors = [ ] ; i_version = None ; i_sees = [ ] ; i_since = None ; i_before = [ ] ; i_deprecated = None ; i_params = [ ] ; i_raised_exceptions = [ ] ; i_return_value = None ; i_custom = [ ] ; } |
type location = { loc_impl : Location . t option ; loc_inter : Location . t option ; } |
let dummy_loc = { loc_impl = None ; loc_inter = None } |
type merge_option = | Merge_description | Merge_author | Merge_version | Merge_see | Merge_since | Merge_before | Merge_deprecated | Merge_param | Merge_raised_exception | Merge_return_value | Merge_custom |
let all_merge_options = [ Merge_description ; Merge_author ; Merge_version ; Merge_see ; Merge_since ; Merge_before ; Merge_deprecated ; Merge_param ; Merge_raised_exception ; Merge_return_value ; Merge_custom ; ] |
type ' a dump = Dump of magic * ' a |
let make_dump a = Dump ( magic , a ) |
let open_dump = function Dump ( m , a ) -> if m = magic then a else raise ( Failure Odoc_messages . bad_magic_number ) |
type t_value = { val_name : Name . t ; mutable val_info : Odoc_types . info option ; val_type : Types . type_expr ; val_recursive : bool ; mutable val_parameters : Odoc_parameter . parameter list ; mutable val_code : string option ; mutable val_loc : Odoc_types . location ; } |
type t_attribute = { att_value : t_value ; att_mutable : bool ; att_virtual : bool ; } |
type t_method = { met_value : t_value ; met_private : bool ; met_virtual : bool ; } |
let value_parameter_text_by_name v name = match v . val_info with None -> None | Some i -> try let t = List . assoc name i . Odoc_types . i_params in Some t with Not_found -> None |
let update_value_parameters_text v = let f p = Odoc_parameter . update_parameter_text ( value_parameter_text_by_name v ) p in List . iter f v . val_parameters |
let parameter_list_from_arrows typ = let rec iter t = match t . Types . desc with Types . Tarrow ( ( l , _ , _ ) , t1 , t2 , _ ) -> ( l , t1 ) :: ( iter t2 ) | Types . Tlink texp | Types . Tsubst texp -> iter texp | Types . Tpoly ( texp , _ ) -> iter texp | Ty... |
let dummy_parameter_list typ = let normal_name = Odoc_misc . label_name in Printtyp . mark_loops typ ; let liste_param = parameter_list_from_arrows typ in let rec iter ( label , t ) = match t . Types . desc with | Types . Ttuple l -> let open Asttypes in if label = Nolabel then Odoc_parameter .... |
let is_function v = let rec f t = match t . Types . desc with Types . Tarrow _ -> true | Types . Tlink t -> f t | _ -> false in f v . val_type |
let i = ref 1 in let stop = ref False in while not stop . val && i . val < Array . length Sys . argv do { let s = Sys . argv . ( i . val ) in if s = " - I " && i . val + 1 < Array . length Sys . argv then do { Odyl_main . directory Sys . argv . ( i . val + 1 ) ;... |
let init_dirs knobs working_dir = if knobs . gen_all_tcs then cleanup_dir ( get_tc_dir working_dir ) else ( ) ; if knobs . gen_crash_tcs then cleanup_dir ( get_crash_dir working_dir ) else ( ) |
let fuzzing_env knobs confs st = vlogf verbose " Fuzzing state initialized \ n " ; let ( ) = init_dirs knobs st . working_dir in let ( ) = init_triage_script st . working_dir in st |
let reproducing_env knobs confs rseed st = vlogf verbose " Reproducing % Ld \ n " rseed ; cleanup_dir ( get_tc_dir st . working_dir ) ; st |
let init_env knobs confs = let cwd = init_fuzzing_env knobs . output_dir knobs . gui in let stats = Array . init ( List . length confs ) ( fun _ -> null_stat ( ) ) in let wnd = init_interface knobs in let st = init_fuzzing_state knobs confs stats cwd wnd in match knobs . reproduce_seed with... |
let destroy_env st confs exitcode = vlogf verbose " Finalizing the fuzzing state \ n " ; if use_db st . knobs then Dbinsert . push_result st confs else ( ) ; if st . knobs . gui then disable_x_redirection ( ) else ( ) ; destroy_fuzzing_state st ; exitcode |
let fuzz_main st confs testgen_alg scheduling = match testgen_alg with | RandomWithReplacement -> RandomFuzzer . launch st confs scheduling | SurfaceMutational -> SurfaceMutFuzzer . launch st confs scheduling | BallMutational -> BallMutFuzzer . launch st confs scheduling | ZzufMutational -> ZzufFuzzer . ... |
let reproduce_main st confs testgen_alg rseed confid = let conf = List . nth confs confid in match testgen_alg with | RandomWithReplacement -> RandomFuzzer . reproduce conf rseed st | SurfaceMutational -> SurfaceMutFuzzer . reproduce conf rseed st | BallMutational -> BallMutFuzzer . reproduce conf rseed... |
let real_main st confs testgen_alg scheduling = match st . knobs . reproduce_seed with | None -> fuzz_main st confs testgen_alg scheduling | Some ( rseed , confid ) -> reproduce_main st confs testgen_alg rseed confid |
let _ = let knobs , testgen_alg , scheduling , confs = opt_init ( ) in let st = init_env knobs confs in vlogf verbose " Environment initialization done \ n " ; try begin let st = real_main st confs testgen_alg scheduling in destroy_env st confs 0 end with e -> begin let e = Printexc . to_stri... |
type linkage = | LINKAGE_Private | LINKAGE_Internal | LINKAGE_Available_externally | LINKAGE_Linkonce | LINKAGE_Weak | LINKAGE_Common | LINKAGE_Appending | LINKAGE_Extern_weak | LINKAGE_Linkonce_odr | LINKAGE_Weak_odr | LINKAGE_External and dll_storage = | DLLSTORAGE_Dllimport | DLLSTORAGE_Dllexport | V... |
module Type = struct open Ollvm_ast type t = Ollvm_ast . typ let i1 = TYPE_I 1 let i32 = TYPE_I 32 let half = TYPE_Half let float = TYPE_Float let double = TYPE_Double let pointer t = TYPE_Pointer t let vector n t = TYPE_Vector ( n , t ) let label = TYPE_Label let void = TYPE_Void let array n t = ... |
module Value = struct type t = Type . t * Ollvm_ast . value let i1 n = ( Type . i1 , Ollvm_ast . VALUE_Integer n ) let i32 n = ( Type . i32 , Ollvm_ast . VALUE_Integer n ) let half f = ( Type . half , Ollvm_ast . VALUE_Float f ) let float f = ( Type . float , Ollvm_ast . ... |
module Instr = struct type t = Type . t * Ollvm_ast . instr let ident = Value . ident let call ( ( t , _ ) as fn ) args = ( t , Ollvm_ast . INSTR_Call ( ident fn , args ) ) let phi value_label = let t = List . hd value_label |> fst |> fst in let value_label = List . map ( ... |
module Block = struct type block = Ollvm_ast . ident * ( Ollvm_ast . instr list ) let declare fn args_typ = let ( t , id ) = Value . ident fn in let open Ollvm_ast in { dc_type = TYPE_Function ( t , args_typ ) ; dc_name = id ; dc_param_attrs = ( [ ] , List . map ( fun _ ... |
module Module = struct module Local = struct type t = { unnamed_counter : int ; named_counter : ( string * int ) list } let empty = { unnamed_counter = 0 ; named_counter = [ ] } let local env t name = let ( env , name ) = match name with | " " -> let i = env . unnamed_coun... |
type env = { c : Llvm . llcontext ; m : Llvm . llmodule ; b : Llvm . llbuilder ; mem : ( Ollvm . Ast . ident * Llvm . llvalue ) list ; labels : ( string * Llvm . llbasicblock ) list } |
let lookup env id = List . assoc id env . mem |
let lookup_fn env ( id : Ollvm . Ast . ident ) : Llvm . llvalue = match id with | ID_Local _ -> assert false | ID_Global i -> match Llvm . lookup_function i env . m with | Some fn -> fn | _ -> assert false |
let string_of_ident : Ollvm . Ast . ident -> string = function | ID_Local i | ID_Global i -> i |
let label : env -> Ollvm . Ast . ident -> Llvm . llbasicblock = fun env id -> List . assoc ( string_of_ident id ) env . labels |
let linkage : Ollvm . Ast . linkage -> Llvm . Linkage . t = let open Llvm . Linkage in function | LINKAGE_Private -> Private | LINKAGE_Internal -> Internal | LINKAGE_Available_externally -> Available_externally | LINKAGE_Linkonce -> Link_once | LINKAGE_Weak -> Weak | LINKAGE_Common -> Common |... |
let dll_storage : Ollvm . Ast . dll_storage -> Llvm . Linkage . t = let open Llvm . Linkage in function | DLLSTORAGE_Dllimport -> Dllimport | DLLSTORAGE_Dllexport -> Dllexport |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.