text stringlengths 12 786k |
|---|
let replicaContent2shortString rc = let ( typ , status ) = rc in match typ , status with _ , Unchanged -> " " | ABSENT , Deleted -> " deleted " | FILE , Created -> " new file " | FILE , Modified -> " changed " | FILE , PropsChanged -> " props " | SYMLINK , Created -... |
let replicaContent2shortString rc = let ( typ , status ) = rc in match typ , status with _ , ` Unchanged -> " " | ` ABSENT , ` Deleted -> " deleted " | ` FILE , ` Created -> " new file " | ` FILE , ` Modified -> " changed " | ` FILE , ` PropsChanged -> " ... |
type ab = A of int | B of int |
type cd = C | D |
let ohl = function | ( A ( p ) | B ( p ) ) , C -> p | ( A ( p ) | B ( p ) ) , D -> p ; ; ; ; |
type pottier = | A | B ; ; |
let pottier x = match x with | ( ( ( A , 1 ) | ( B , 2 ) ) , A ) -> false | _ -> true ; ; ; ; |
let coquery q = match q with ; ; ; ; |
type vars = A of int | B of ( int * int ) | C ; ; |
let vars1 = function | ( A x | B ( _ , x ) ) -> x | C -> 0 ; ; ; ; |
let vars2 = function | ( [ x ] [ | 1 ; x ] [ | 1 ; 2 ; x ] ) -> x | _ -> 0 ; ; ; ; |
type eber = { x : int ; y : int ; z : bool } |
let eber = function | { x = a ; z = true } | { y = a ; z = false } -> a ; ; ; ; |
let escaped = function | ' " ' \ | ' ' \\ | ' \ n ' | ' \ t ' -> 2 | c -> 1 ; ; ( ) ; ; |
type command_reply = RPL_TRYAGAIN | RPL_TRACEEND | RPL_TRACELOG | RPL_ADMINEMAIL | RPL_ADMINLOC2 | RPL_ADMINLOC1 | RPL_ADMINME | RPL_LUSERME | RPL_LUSERCHANNELS | RPL_LUSERUNKNOWN | RPL_LUSEROP | RPL_LUSERCLIENT | RPL_STATSDLINE | RPL_STATSDEBUG | RPL_STATSDEFINE | RPL_STATSBLINE | RPL_STATSPING | RPL... |
let get_command_reply n = 263 -> RPL_TRYAGAIN | 319 -> RPL_WHOISCHANNELS | 318 -> RPL_ENDOFWHOIS | 317 -> RPL_WHOISIDLE | 316 -> RPL_WHOISCHANOP | 369 -> RPL_ENDOFWHOWAS | 314 -> RPL_WHOWASUSER | 313 -> RPL_WHOISOPERATOR | 312 -> RPL_WHOISSERVER | 311 -> RPL_WHOISUSER | 262 -> RPL_TRACE... |
type habert_a = | A of habert_c | B of habert_c |
let habert = function | ( A { lnb = i } | B { lnb = i } ) when i = 0 -> 1 | A { lassoc ( { = lnb = j } ) ; lnb = i } -> 2 | _ -> 3 ; ; |
let rec ex0 = { lvar = 0 ; lnb = 0 ; lassoc = ex1 } |
type type_expr = [ | ` TTuple of type_expr list | ` TConstr of type_expr list | ` TVar of string | ` TVariant of string list | ` TBlock of int | ` TCopy of type_expr ] | ` TTuple of type_expr list | ` TConstr of type_expr list | ` TVariant of string list ] |
let rec maf te = match te with | ` TCopy te -> 1 | ` TVar _ -> 2 | ` TBlock _ -> 2 | # recurs_type_expr as desc -> let te = ( match desc with ` TTuple tl -> 4 | ` TConstr tl -> 5 | ` TVariant ( row ) -> 6 ) in te ; ; |
let base = ` TBlock 0 ; ; ; ; |
type t_seb = Uin | Uout ; ; |
let rec seb = function | ( ( i , Uin ) | ( i , Uout ) ) , Uout -> 1 | ( ( j , Uin ) | ( j , Uout ) ) , Uin -> 2 ; ; ( ) ; ; |
type ( ' a , ' b ) t_j = A of ' a | B of ' b * ' a | C |
let f = function | A ( ` A ` | C ) -> 0 | B ( ` B , ` D ) -> 1 | C -> 2 |
let g x = try f x with Match_failure _ -> 3 |
let _ = test " jacques " g ( A ` A ) 0 ; test " jacques " g ( A ` C ) 0 ; test " jacques " g ( B ( ` B , ` D ) ) 1 ; test " jacaues " g C 2 ; ) * ( ) |
type t_l = A | B |
let f = function | _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , B , _ , _ -> " 0 " | _ , _ , _ , B , A , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ -> " 1 " | _ , _ , _ , B , _ , A , _ , _ ... |
let _ = test " luc " f ( B , A , A , A , A , A , A , A , A , A , A , B , A , A , A , A ) " 10 " ; test " luc " f ( B , A , A , A , A , A , A , A , A , A , A , A , A , A , A , A ) " 12 " ; ( ) |
type bg = [ | ` False | ` True ] |
type vg = [ | ` A | ` B | ` U of int | ` V of int ] |
type tg = { v : vg ; x : bg ; } |
let predg x = true |
let rec gilles o = match o with | { v = ( ` U data | ` V data ) ; x = ` False } when predg o -> 1 | { v = ( ` A ` | B ) ; x = ` False } | { v = ( ` U _ | ` V _ ) ; x = ` False } | { v = _ ; x = ` True } -> 2 |
let lucexn e = try try raise e with Error msg -> msg with Found ( s , r ) -> s ^ Int . to_string r |
let ( ) = test " lucexn1 " lucexn ( Error " coucou " ) " coucou " ; test " lucexn2 " lucexn ( Found ( " int : " , 0 ) ) " int : 0 " ; ( ) |
let pr5758 x str = match ( x , str ) with | ( 1 . , " A " ) -> " Matched A " | ( 1 . 0 , " B " ) -> " Matched B " | ( 1 . , " C " ) -> " Matched C " | result -> match result with | ( 1 . , " A " ) -> " Failed match A then later matched ... |
let ( ) = test " pr5758 " ( pr5758 1 . ) " A " " Matched A " ; ; |
let unknown ( kind : K . t ) = match kind with | Value -> TG . any_value | Naked_number Naked_immediate -> TG . any_naked_immediate | Naked_number Naked_float -> TG . any_naked_float | Naked_number Naked_int32 -> TG . any_naked_int32 | Naked_number Naked_int64 -> TG . any_naked_int64 | Nake... |
let unknown_like t = unknown ( TG . kind t ) |
let bottom ( kind : K . t ) = match kind with | Value -> TG . bottom_value | Naked_number Naked_immediate -> TG . bottom_naked_immediate | Naked_number Naked_float -> TG . bottom_naked_float | Naked_number Naked_int32 -> TG . bottom_naked_int32 | Naked_number Naked_int64 -> TG . bottom_naked... |
let bottom_like t = bottom ( TG . kind t ) |
let these_naked_immediates is = TG . these_naked_immediates ~ no_alias : false is |
let these_naked_floats fs = TG . these_naked_floats ~ no_alias : false fs |
let these_naked_int32s is = TG . these_naked_int32s ~ no_alias : false is |
let these_naked_int64s is = TG . these_naked_int64s ~ no_alias : false is |
let these_naked_nativeints is = TG . these_naked_nativeints ~ no_alias : false is |
let any_tagged_immediate = TG . create_variant ~ is_unique : false ~ immediates : Unknown ~ blocks ( : Known TG . Row_like_for_blocks . bottom ) ( Known Heap ) |
let these_tagged_immediates0 ~ no_alias imms = match Targetint_31_63 . Set . get_singleton imms with | Some imm when not no_alias -> TG . this_tagged_immediate imm | _ -> if Targetint_31_63 . Set . is_empty imms then TG . bottom_value else TG . create_variant ~ is_unique : false ~ immediates ( ... |
let these_tagged_immediates imms = these_tagged_immediates0 ~ no_alias : false imms |
let any_tagged_bool = these_tagged_immediates Targetint_31_63 . all_bools |
let any_naked_bool = TG . these_naked_immediates ~ no_alias : false Targetint_31_63 . all_bools |
let this_boxed_float f alloc_mode = TG . box_float ( TG . this_naked_float f ) alloc_mode |
let this_boxed_int32 i alloc_mode = TG . box_int32 ( TG . this_naked_int32 i ) alloc_mode |
let this_boxed_int64 i alloc_mode = TG . box_int64 ( TG . this_naked_int64 i ) alloc_mode |
let this_boxed_nativeint i alloc_mode = TG . box_nativeint ( TG . this_naked_nativeint i ) alloc_mode |
let these_boxed_floats fs alloc_mode = TG . box_float ( these_naked_floats fs ) alloc_mode |
let these_boxed_int32s is alloc_mode = TG . box_int32 ( these_naked_int32s is ) alloc_mode |
let these_boxed_int64s is alloc_mode = TG . box_int64 ( these_naked_int64s is ) alloc_mode |
let these_boxed_nativeints is alloc_mode = TG . box_nativeint ( these_naked_nativeints is ) alloc_mode |
let any_boxed_float = TG . box_float TG . any_naked_float Unknown |
let any_boxed_int32 = TG . box_int32 TG . any_naked_int32 Unknown |
let any_boxed_int64 = TG . box_int64 TG . any_naked_int64 Unknown |
let any_boxed_nativeint = TG . box_nativeint TG . any_naked_nativeint Unknown |
let any_block = TG . create_variant ~ is_unique : false ~ immediates ( : Known TG . bottom_naked_immediate ) ~ blocks : Unknown Unknown |
let blocks_with_these_tags tags : _ Or_unknown . t = if not ( Tag . Set . for_all Tag . is_structured_block tags ) then Unknown else let blocks = TG . Row_like_for_blocks . create_blocks_with_these_tags ~ field_kind : K . value tags in Known ( TG . create_variant ~ is_unique : false ~ imm... |
let immutable_block ~ is_unique tag ~ field_kind alloc_mode ~ fields = match Targetint_31_63 . Imm . of_int_option ( List . length fields ) with | None -> Misc . fatal_error " Block too long for target " | Some _size -> TG . create_variant ~ is_unique ~ immediates ( : Known TG . bottom... |
let immutable_block_with_size_at_least ~ tag ~ n ~ field_kind ~ field_n_minus_one = let n = Targetint_31_63 . Imm . to_int n in let field_tys = List . init n ( fun index -> if index < n - 1 then unknown field_kind else TG . alias_type_of field_kind ( Simple . var field_n_minus_one ) ) in TG... |
let variant ~ const_ctors ~ non_const_ctors alloc_mode = let blocks = let field_tys_by_tag = Tag . Scannable . Map . fold ( fun tag ty non_const_ctors -> Tag . Map . add ( Tag . Scannable . to_tag tag ) ty non_const_ctors ) non_const_ctors Tag . Map . empty in TG . Row_like_for_blocks ... |
let open_variant_from_const_ctors_type ~ const_ctors = TG . create_variant ~ is_unique : false ~ immediates ( : Known const_ctors ) ~ blocks : Unknown Unknown |
let open_variant_from_non_const_ctor_with_size_at_least ~ n ~ field_n_minus_one = let n = Targetint_31_63 . Imm . to_int n in let field_tys = List . init n ( fun index -> if index < n - 1 then TG . any_value else TG . alias_type_of K . value ( Simple . var field_n_minus_one ) ) in TG . ... |
let exactly_this_closure function_slot ~ all_function_slots_in_set : function_types ~ all_closure_types_in_set : closure_types ~ all_value_slots_in_set : value_slot_types alloc_mode = let closure_types = TG . Product . Function_slot_indexed . create closure_types in let closures_entry = let value_slot_ty... |
let closure_with_at_least_these_function_slots ~ this_function_slot function_slots_and_bindings = let function_slot_components_by_index = Function_slot . Map . map ( fun bound_to -> TG . alias_type_of K . value bound_to ) function_slots_and_bindings in let function_types = Function_slot . Map . map... |
let closure_with_at_least_these_value_slots ~ this_function_slot value_slots = let value_slot_types = let type_of_var v = TG . alias_type_of K . value ( Simple . var v ) in let value_slot_components_by_index = Value_slot . Map . map type_of_var value_slots in TG . Product . Value_slot_indexed . ... |
let closure_with_at_least_this_value_slot ~ this_function_slot value_slot ~ value_slot_var = closure_with_at_least_these_value_slots ~ this_function_slot ( Value_slot . Map . singleton value_slot value_slot_var ) |
let type_for_const const = match RWC . descr const with | Naked_immediate i -> TG . this_naked_immediate i | Tagged_immediate i -> TG . this_tagged_immediate i | Naked_float f -> TG . this_naked_float f | Naked_int32 n -> TG . this_naked_int32 n | Naked_int64 n -> TG . this_naked_int64 n | Naked... |
let kind_for_const const = TG . kind ( type_for_const const ) |
let is_alias_of_name ty name = match TG . get_alias_exn ty with | exception Not_found -> false | simple -> Simple . pattern_match simple ~ name ( : fun name ' ~ coercion : _ -> Name . equal name name ' ) ~ const ( : fun _ -> false ) |
let check_equation name ty = if Flambda_features . check_invariants ( ) then if is_alias_of_name ty name then Misc . fatal_errorf " Directly recursive equation @ % a = % a @ disallowed " Name . print name TG . print ty |
let arity_of_list ts = Flambda_arity . create ( List . map TG . kind ts ) |
let unknown_types_from_arity arity = List . map ( fun kind -> unknown kind ) ( Flambda_arity . to_list arity ) |
let rec unknown_with_descr ( descr : Flambda_kind . With_subkind . descr ) = match descr with | Any_value -> TG . any_value | Naked_number Naked_immediate -> TG . any_naked_immediate | Naked_number Naked_float -> TG . any_naked_float | Naked_number Naked_int32 -> TG . any_naked_int32 | Naked_... |
let unknown_with_subkind kind = unknown_with_descr ( Flambda_kind . With_subkind . descr kind ) |
let unknown_types_from_arity_with_subkinds arity = List . map ( fun kind -> unknown_with_subkind kind ) ( Flambda_arity . With_subkinds . to_list arity ) |
let bottom_types_from_arity arity = List . map ( fun kind -> bottom kind ) ( Flambda_arity . to_list arity ) |
let parse_args params body = let _loc = Loc . ghost in let nargs = List . length params in let rec aux acc i a = if i > nargs - ! n_lifted_vals then acc else match a with | [ ] -> acc | t :: q -> match t with | PaTyc ( _ , x , <: ctyp < $ e $ vector ) >> -> ( match e with | <: c... |
let gen_arg_from_patt p = match p with | PaId ( _loc , x ) -> <: expr ( < spoc_id $ ExId ( _loc , x ) ) $>> | _ -> failwith " error gen_arg_from_patt " |
let rec gen_arg_from_patt2 p = match p with | PaId ( _loc , IdLid ( _loc2 , x ) ) -> ( let var = ( Hashtbl . find ! current_args x ) in match var . var_type with | TUnknown -> <: expr ( < new_unknown_var ` $ int : var . n $ $ str : x ) $>> | TInt32 | TInt64 | TBool -> ... |
let rec patt_is_vector p = match p with | PaId ( _loc , IdLid ( _loc2 , x ) ) -> let var = ( Hashtbl . find ! current_args x ) in begin match var . var_type with | TVec _ -> true | _ -> false end | PaTyc ( _loc , x , _ ) -> patt_is_vector x | _ -> assert false |
let rec gen_arg_from_patt3 p = match p with | PaId ( _loc , IdLid ( _loc2 , x ) ) -> ( let var = ( Hashtbl . find ! current_args x ) in let s = <: ident < $ lid ( " : spoc_var " ^ string_of_int var . n ) $>> in let v = <: patt < $ id : s $ >> in let e1 , e2 , e3 , ... |
let rec float32_expr f = let f32_typer f = ( match f . t with | TUnknown -> f . t <- TFloat32 | TFloat32 -> f . t <- TFloat32 | TVec TFloat32 -> f . t <- TVec TFloat32 | _ -> assert ( not debug ) ; raise ( TypeError ( TFloat32 , f . t , f . loc ) ) ) in f32_typer f ; ( ... |
let rec float64_expr f = let f64_typer f = ( match f . t with | TUnknown -> ( ) | TVec TFloat64 -> f . t <- TVec TFloat64 | TFloat64 -> ( ) | _ ( ) -> ) in f64_typer f ; ( match f . e with | PlusF64 ( l , a , b ) -> ( f . e <- PlusF64 ( l , float64_expr a , flo... |
let nb_ker = ref 0 |
let gen_ctype t1 t2 t3 name _loc = let field_name = ( string_of_ident t2 " ^ _ " ^ t3 ) in begin <: str_item < let $ lid : field_name $ = let open Ctypes in Ctypes . field $ lid : string_of_ident t2 $ $ str : field_name $ $ lid : get_sarek_name ( ( string_of_ctyp t1 ) ) $ ; ; ... |
let gen_ctype_repr t1 t2 name : string = let field_name = ( string_of_ident t2 " ^ _t " ) in ( ( ctype_of_sarek_type ( string_of_ctyp t1 ) ) " ^ " ^ field_name ) |
type ktyp_repr = { type_id : int ; name : string ; typ : ktyp ; ml_typ : str_item ; ctype : str_item ; crepr : string ; ml_to_c : expr ; c_to_ml : expr ; build_c : string list ; compare : string ; } |
let type_id = ref 0 |
let gen_mltyp _loc name t = begin match t with | Custom ( KRecord ( ctypes , idents , muts ) , _ ) -> begin let aux list_elt list_mut = let idfield = match list_elt with | TyCol ( _loc , TyId ( _ , IdLid ( _ , t ) ) , _ ) -> mltype_of_sarek_type t | _ -> assert false in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.