text stringlengths 0 601k |
|---|
let compare_ge_ast = let binop = BinOp ( Ge , make_int 1 , make_int 2 ) in make_simple_ast [ ] binop |
let compare_lt_tokens = Lex . lex " int main ( ) { return 1 < 2 ; } " |
let compare_lt_ast = let binop = BinOp ( Lt , make_int 1 , make_int 2 ) in make_simple_ast [ ] binop |
let compare_le_tokens = Lex . lex " int main ( ) { return 1 <= 2 ; } " |
let compare_le_ast = let binop = BinOp ( Le , make_int 1 , make_int 2 ) in make_simple_ast [ ] binop |
let comp_parse_tests = [ " test_eq " >:: test_compare_asts compare_eq_tokens compare_eq_ast ; " test_neq " >:: test_compare_asts compare_neq_tokens compare_neq_ast ; " test_lt " >:: test_compare_asts compare_lt_tokens compare_lt_ast ; " test_gt " >:: test_compare_asts compare_gt_tokens compare_gt_ast ; " test_le " >:: ... |
let declaration_tokens = Lex . lex " int main ( ) { int a = 2 ; return a ; } " |
let declaration_ast = let decl = Decl { var_type = IntType ; var_name = ID " a " ; init = Some ( make_int 2 ) ; } in let ret = Statement ( ReturnVal ( Var ( ID " a " ) ) ) in let statements = [ decl ; ret ] in make_ast [ ] statements |
let assignment_tokens = Lex . lex " int main ( ) { int a ; a = 2 ; return 0 ; } " |
let assignment_ast = let decl = Decl { var_type = IntType ; var_name = ID " a " ; init = None ; } in let assign = make_exp_statement ( Assign ( Equals , ID " a " , make_int 2 ) ) in let ret = Statement ( ReturnVal ( make_int 0 ) ) in let block_items = [ decl ; assign ; ret ] in make_ast [ ] block_items |
let multi_assign_tokens = Lex . lex " int main ( ) { int a ; int b = a = 2 ; return b ; } " |
let multi_assign_ast = let decl_1 = ( Decl { var_type = IntType ; var_name = ID " a " ; init = None } ) in let assign = ( Assign ( Equals , ID " a " , make_int 2 ) ) in let decl_2 = ( Decl { var_type = IntType ; var_name = ID " b " ; init = Some assign } ) in let ret = ( Statement ( ReturnVal ( Var ( ID " b " ) ) ) ) i... |
let variable_parse_tests = [ " test_declaration " >:: test_compare_asts declaration_tokens declaration_ast ; " test_assignment " >:: test_compare_asts assignment_tokens assignment_ast ; " test_multi_assign " >:: test_compare_asts multi_assign_tokens multi_assign_ast ; ] |
let single_if_tokens = Lex . lex " int main ( ) { if ( 0 ) return 1 ; return 0 ; } " |
let single_if_ast = let cond = make_int 0 in let if_body = ReturnVal ( make_int 1 ) in let if_statement = ( Statement ( If { cond ; if_body ; else_body = None } ) ) in let return = ( Statement ( ReturnVal ( make_int 0 ) ) ) in make_ast [ ] [ if_statement ; return ] |
let single_if_else_tokens = Lex . lex " int main ( ) { if ( 0 ) return 1 ; else return 2 ; } " |
let single_if_else_ast = let cond = make_int 0 in let if_body = ReturnVal ( make_int 1 ) in let else_body = Some ( ReturnVal ( make_int 2 ) ) in let if_statement = ( Statement ( If { cond ; if_body ; else_body } ) ) in make_ast [ ] [ if_statement ] |
let ternary_tokens = Lex . lex " int main ( ) { return 3 < 4 ? 5 : 6 ; } " |
let ternary_ast = let condition = BinOp ( Lt , make_int 3 , make_int 4 ) in let ternop = TernOp ( condition , make_int 5 , make_int 6 ) in make_simple_ast [ ] ternop |
let conditional_parse_tests = [ " test_single_if " >:: test_compare_asts single_if_tokens single_if_ast ; " test_single_if_else " >:: test_compare_asts single_if_else_tokens single_if_else_ast ; " test_ternary " >:: test_compare_asts ternary_tokens ternary_ast ] |
let for_tokens = Lex . lex " int main ( ) { for ( 1 ; 1 ; 1 ) { 1 ; } } " |
let for_ast = let const = make_int 1 in let for_loop = ( Statement ( For { init = Some const ; cond = const ; post = Some const ; body = Block [ make_exp_statement const ] } ) ) in make_ast [ ] [ for_loop ] |
let for_compound_tokens = Lex . lex " int main ( ) { int a ; for ( a = 0 ; a < 5 ; a = a + 1 ) { 1 + 1 ; if ( a < 5 ) { return 3 ; } } } " |
let for_compound_ast = let decl = Decl { var_type = IntType ; var_name = ID " a " ; init = None } in let init = Assign ( Equals , ID " a " , make_int 0 ) in let post = Assign ( Equals , ID " a " , BinOp ( Add , Var ( ID " a " ) , make_int 1 ) ) in let cond = BinOp ( Lt , Var ( ID " a " ) , make_int 5 ) in let exp = mak... |
let for_declaration_tokens = Lex . lex " int main ( ) { for ( int a ; 1 ; 1 ) { 1 ; } } " |
let for_decl_ast = let const = make_int 1 in let decl = { var_type = IntType ; var_name = ID " a " ; init = None } in let for_loop = Statement ( ForDecl { init = decl ; cond = const ; post = Some const ; body = Block [ make_exp_statement const ] } ) in make_ast [ ] [ for_loop ] |
let single_for_tokens = Lex . lex " int main ( ) { for ( 1 ; 1 ; 1 ) if ( 1 ) 1 ; } " |
let single_for_ast = let const = make_int 1 in let if_statement = If { cond = const ; if_body = Exp ( Some const ) ; else_body = None } in let for_loop = For { init = Some const ; cond = const ; post = Some const ; body = if_statement } in make_ast [ ] [ Statement for_loop ] |
let for_parse_tests = [ " test_for " >:: test_compare_asts for_tokens for_ast ; " test_for_compound " >:: test_compare_asts for_compound_tokens for_compound_ast ; " test_for_declaration " >:: test_compare_asts for_declaration_tokens for_decl_ast ; " test_single_for " >:: test_compare_asts single_for_tokens single_for_a... |
let while_tokens = Lex . lex " int main ( ) { while ( 1 ) 2 ; } " |
let while_ast = let cond = make_int 1 in let body = Exp ( Some ( make_int 2 ) ) in let while_statement = Statement ( While { cond ; body } ) in make_ast [ ] [ while_statement ] |
let while_block_tokens = Lex . lex " int main ( ) { while ( 1 ) { 2 ; } } " |
let while_block_ast = let cond = make_int 1 in let body = make_exp_statement ( make_int 2 ) in let while_statement = Statement ( While { cond ; body = Block [ body ] } ) in make_ast [ ] [ while_statement ] |
let do_while_tokens = Lex . lex " int main ( ) { do 2 ; while ( 1 ) ; } " |
let do_while_ast = let cond = make_int 1 in let body = Exp ( Some ( make_int 2 ) ) in let do_while_statement = Statement ( DoWhile { body ; cond } ) in make_ast [ ] [ do_while_statement ] |
let do_while_block_tokens = Lex . lex " int main ( ) { do { 2 ; } while ( 1 ) ; } " |
let do_while_block_ast = let cond = make_int 1 in let body = make_exp_statement ( make_int 2 ) in let do_while_statement = Statement ( DoWhile { body = Block [ body ] ; cond } ) in make_ast [ ] [ do_while_statement ] |
let while_parse_tests = [ " test_while " >:: test_compare_asts while_tokens while_ast ; " test_while_block " >:: test_compare_asts while_block_tokens while_block_ast ; " test_do_while " >:: test_compare_asts do_while_tokens do_while_ast ; " test_do_while_block " >:: test_compare_asts do_while_block_tokens do_while_bloc... |
let make_foo_decl params = FunDecl { fun_type = IntType ; name = ID " foo " ; params ; body = Some [ ] } |
let make_fun_call_program params args = let foo_decl = make_foo_decl params in let fun_call = FunCall ( ID " foo " , args ) in let main_body = [ Statement ( ReturnVal fun_call ) ] in let main_decl = FunDecl { fun_type = IntType ; name = ID " main " ; params [ ] ; = body = Some main_body } in Prog [ foo_decl ; main_decl... |
let make_param name = Param ( IntType , ID name ) |
let fun_tokens = Lex . lex " int foo ( ) { } int main ( ) { return foo ( ) ; } " |
let fun_ast = make_fun_call_program [ ] [ ] |
let fun_args_tokens = Lex . lex " int foo ( int a ) { } int main ( ) { return foo ( 5 ) ; } " |
let fun_args_ast = let foo_params = [ make_param " a " ] in let foo_args = [ make_int 5 ] in make_fun_call_program foo_params foo_args |
let fun_arg_exp_tokens = Lex . lex " int foo ( int a ) { } int main ( ) { return foo ( a + 5 ) ; } " |
let fun_arg_exp_ast = let foo_params = [ make_param " a " ] in let arg_exp = BinOp ( Add , Var ( ID " a " ) , make_int 5 ) in make_fun_call_program foo_params [ arg_exp ] |
let fun_call_standalone = " int main ( ) { incr ( b ) ; } " |
let fun_call_parse_tests = [ " test_simple_call " >:: test_compare_asts fun_tokens fun_ast ; " test_call_with_args " >:: test_compare_asts fun_args_tokens fun_args_ast ; " test_call_with_complex_arg " >:: test_compare_asts fun_arg_exp_tokens fun_arg_exp_ast ; ] |
let missing_semicolon = Lex . lex " int main ( ) { return 2 } " |
let incomplete_addition = Lex . lex " int main ( ) { return 2 ; } " + |
let mismatched_parens = Lex . lex " int main ( ) { return ( ( 1 ) ; } " |
let mismatched_right_parens = Lex . lex " int main ( ) { return ( 1 ) ) ; } " |
let one_paren = Lex . lex " int main ( ) { return ( 1 ; } " |
let backwards_parens = Lex . lex " int main ( ) { return ) 1 + 2 ; } " |
let failure_parse_tests = [ " test_parse_fail " >:: test_expect_failure bad_token_list " Parse error in parse_fun : bad function type or name " ; " test_semicolon_required " >:: test_expect_failure missing_semicolon " Expected semicolon after return statement " ; " test_incomplete_addition " >:: test_expect_failure inc... |
let parse_tests = basic_parse_tests @ unop_parse_tests @ binop_parse_tests @ boolean_binop_tests @ bitwise_binops_tests @ comp_parse_tests @ variable_parse_tests @ conditional_parse_tests @ fun_call_parse_tests @ for_parse_tests @ while_parse_tests @ failure_parse_tests |
let assert_tokenize ~ loc given expected = match Micheline_parser . tokenize given with | ( tokens , [ ] ) -> let tokens_got = List . map ( fun x -> x . Micheline_parser . token ) tokens in Assert . equal_tokens ~ loc tokens_got expected | ( _ , _ ) -> failwith " % s - Cannot tokenize % s " loc given |
let assert_tokenize_error ~ loc given forbidden_tokens = match Micheline_parser . tokenize given with | ( tokens , [ ] ) -> let tokens_got = List . map ( fun x -> x . Micheline_parser . token ) tokens in Assert . not_equal_tokens ~ loc tokens_got forbidden_tokens | ( _ , _ ) -> return_unit |
let test_tokenize_basic ( ) = let * ( ) = assert_tokenize ~ loc : __LOC__ " " \ abc " " \ [ String " abc " ] in let * ( ) = assert_tokenize ~ loc : __LOC__ " " \ abc \ t " " \ [ String " abc \ t " ] in let * ( ) = assert_tokenize ~ loc : __LOC__ " " \ abc \ b " " \ [ String " abc \ b " ] in let * ( ) = assert_tokenize ... |
let test_one_line_contract ( ) = let * ( ) = assert_tokenize ~ loc : __LOC__ " ( option int ) " [ Open_paren ; Ident " option " ; Ident " int " ; Close_paren ] in let * ( ) = assert_tokenize ~ loc : __LOC__ " DIP { ADD } " [ Ident " DIP " ; Open_brace ; Ident " ADD " ; Close_brace ] in let * ( ) = assert_tokenize ~ loc... |
let test_condition_contract ( ) = let * ( ) = assert_tokenize ~ loc : __LOC__ " parameter ( or string ( option int ) ) ; storage unit ; return string ; code \ { CAR ; IF_LEFT { } { IF_NONE { FAIL } { PUSH int 0 ; CMPGT ; IF { FAIL } { PUSH string \ " " } } } ; \\ UNIT ; SWAP ; PAIR } " [ Ident " parameter " ; Open_pare... |
let assert_toplevel_parsing ~ loc source expected = match Micheline_parser . tokenize source with | ( _ , _ :: _ ) -> failwith " % s - Cannot tokenize % s " loc source | ( tokens , [ ] ) -> ( match Micheline_parser . parse_toplevel tokens with | ( _ , _ :: _ ) -> failwith " % s - Cannot parse_toplevel % s " loc source ... |
let assert_toplevel_parsing_error ~ loc source forbidden_tokens = match Micheline_parser . tokenize source with | ( _ , _ :: _ ) -> return_unit | ( tokens , [ ] ) -> ( match Micheline_parser . parse_toplevel tokens with | ( _ , _ :: _ ) -> return_unit | ( ast , [ ] ) -> let ast = List . map Micheline . strip_locations ... |
let test_basic_parsing ( ) = let * ( ) = assert_toplevel_parsing ~ loc : __LOC__ " parameter unit ; " [ Prim ( ( ) , " parameter " , [ Prim ( ( ) , " unit " , [ ] , [ ] ) ] , [ ] ) ] in let * ( ) = assert_toplevel_parsing ~ loc : __LOC__ " code { } " [ Prim ( ( ) , " code " , [ Seq ( ( ) , [ ] ) ] , [ ] ) ] in let * ( ... |
let test_condition_contract_parsing ( ) = assert_toplevel_parsing ~ loc : __LOC__ " parameter unit ; return unit ; storage tez ; # How much you have to send me \ n \ code { CDR ; DUP ; AMOUNT ; CMPLT ; IF { FAIL } } " [ Prim ( ( ) , " parameter " , [ Prim ( ( ) , " unit " , [ ] , [ ] ) ] , [ ] ) ; Prim ( ( ) , " return... |
let test_list_append_parsing ( ) = assert_toplevel_parsing ~ loc : __LOC__ " parameter ( pair ( list int ) ( list int ) ) ; return ( list int ) ; storage unit ; code \ { CAR ; DUP ; DIP { CDR } ; CAR ; NIL int ; SWAP ; LAMBDA ( pair int ( list int ) ) ( list \ int ) { DUP ; CAR ; DIP { CDR } ; CONS } ; REDUCE ; LAMBDA ... |
let assert_expression_parsing ~ loc source expected = match Micheline_parser . tokenize source with | ( _ , _ :: _ ) -> failwith " % s - Cannot tokenize % s " loc source | ( tokens , [ ] ) -> ( match Micheline_parser . parse_expression tokens with | ( _ , _ :: _ ) -> failwith " % s - Cannot parse_expression % s " loc s... |
let test_parses_expression ( ) = let * ( ) = assert_expression_parsing ~ loc : __LOC__ " Pair False " \ abc " " \ ( Prim ( ( ) , " Pair " , [ Prim ( ( ) , " False " , [ ] , [ ] ) ; String ( ( ) , " abc " ) ] , [ ] ) ) in let * ( ) = assert_expression_parsing ~ loc : __LOC__ " Item 100 " ( Prim ( ( ) , " Item " , [ Int ... |
let tests = [ ( " tokenize " , fun _ -> test_tokenize_basic ( ) ) ; ( " test one line contract " , fun _ -> test_one_line_contract ( ) ) ; ( " test_condition_contract " , fun _ -> test_condition_contract ( ) ) ; ( " test_basic_parsing " , fun _ -> test_basic_parsing ( ) ) ; ( " test_condition_contract_parsing " , fun _... |
let wrap ( n , f ) = Alcotest . test_case n ` Quick ( fun ( ) -> match f ( ) with Ok ( ) -> ( ) | Error err -> Stdlib . failwith err ) |
let ( ) = Alcotest . run ~ argv [ " " ] :|| " tezos - lib - micheline " [ ( " micheline " , List . map wrap tests ) ] |
let test s = Single . parse_string s |> [ % sexp_of : ( Sexp . t , Parse_error . t ) Result . t ] |> print_s ; ; test " ( abc " ; [ % expect { | ( Error ( ( position ( ( line 1 ) ( col 4 ) ( offset 4 ) ) ) ( message " unclosed parentheses at end of input " ) ) ) } ] ; | test " " ; [ % expect { | ( Error ( ( position ( ... |
let parse_eager_cst ~ no_sexp_is_error str = let r = ref [ ] in let state = Eager_cst . State . create ~ no_sexp_is_error ( fun _ v -> r := v :: ! r ) in Result . try_with ( fun ( ) -> let stack = Eager_cst . Stack . empty in let stack = Eager_cst . feed_string state str stack in Eager_cst . feed_eoi state stack ; List... |
let parse_eager_cst_no_sexp_is_error = parse_eager_cst ~ no_sexp_is_error : true |
let parse_eager_cst = parse_eager_cst ~ no_sexp_is_error : false missing comments or assertion failures ) " = let test s = parse_eager_cst s |> [ % sexp_of : ( Cst . t_or_comment list , exn ) Result . t ] |> print_s in test " ; " ; [ % expect { | ( Ok ( ( Comment ( Plain_comment ( loc ( ( start_pos ( ( line 1 ) ( col 0... |
let rec hot_loop state stream stack = match Stream . peek stream with | None -> P . feed_eoi state stack | Some char -> let stack = P . feed state char stack in Stream . junk stream ; hot_loop state stream stack ; ; |
let fetch_sexp ( stream : char Stream . t ) = let got_sexp _state sexp = Exn . raise_without_backtrace ( Got_sexp sexp ) in let count = Stream . count stream in let state = P . State . create got_sexp in match hot_loop state stream P . Stack . empty with | ( ) -> None | exception Got_sexp sexp -> if P . State . offset ... |
let iter_sexps ( stream : char Stream . t ) ~ f = let got_sexp _state sexp = f sexp in let state = P . State . create got_sexp in hot_loop state stream P . Stack . empty ; ; |
let input = { | } | let stream = Stream . of_string input in let rec loop stream = match fetch_sexp stream with | None -> assert ( Option . is_none ( Stream . peek stream ) ) | Some sexp -> Caml . Format . printf " got : % a . " @ Sexp . pp_hum sexp ; loop stream in loop stream ; [ % expect { | got : ( Hello World ) go... |
let all_short_strings ( ) = let all_chars = [ ' \ 000 ' ; ' \ 001 ' ; ' \ t ' ; ' ' ; ' \ n ' ; ' \ 012 ' ; ' \ r ' ; ' " ' ; ' ' # ; ' ( ' ; ' ) ' ; ' 8 ' ; ' ; ' ; ' A ' ; ' b ' ; ' ' \\ ; ' x ' ; ' ' | ] in List . bind [ 0 ; 1 ; 2 ; 3 ; 4 ] ~ f ( : fun len -> List . all ( List . init len ~ f ( : fun _ -> all_chars )... |
let test input = Single_just_positions . parse_string input |> Result . map ~ f : Positions . to_list |> [ % sexp_of : ( Positions . pos list , Parse_error . t ) Result . t ] |> print_s ; ; |
let test_many input = Many_just_positions . parse_string input |> Result . map ~ f : Positions . to_list |> [ % sexp_of : ( Positions . pos list , Parse_error . t ) Result . t ] |> print_s ; ; test " ( 1 2 3 ) " ; [ % expect { | ( Ok ( ( ( line 1 ) ( col 0 ) ( offset 0 ) ) ( ( line 1 ) ( col 1 ) ( offset 1 ) ) ( ( line... |
type ' a conv_result = ( ' a , Conv_error . t ) Result . t [ @@ deriving sexp_of ] |
let test a_of_sexp input = match Conv_single . parse_string input a_of_sexp with | Ok _ -> ( ) | Error error -> Conv_error . report Caml . Format . std_formatter error ~ filename " :< string " > ; ; |
let test_many a_of_sexp input = match Conv_many . parse_string input a_of_sexp with | Ok _ -> ( ) | Error error -> Conv_error . report Caml . Format . std_formatter error ~ filename " :< string " > ; ; test [ % of_sexp : int list ] { | [ % expect { | File " < string " , > line 2 , character 6 : Error : s - expression p... |
let assoc s = Lexer . assoc ( Eager . Lexbuf_consumer . create ( ) ) ( Lexing . from_string s ) |> [ % sexp_of : ( string * Sexp . t ) list ] |> print_s ; ; |
let sexps s = let lexbuf = Lexing . from_string s in let p = Eager . Lexbuf_consumer . create ( ) in let rec loop ( ) = match Eager . Lexbuf_consumer . parse_opt p lexbuf with | None -> [ ] | Some sexp -> sexp :: loop ( ) in loop ( ) |> List . iter ~ f : print_s ; ; assoc { | } ; | [ % expect { | ( ( x ( a b c ) ) ( y ... |
let bake_and_endorse_once ( b_pred , b_cur ) baker endorser = let open Context in Context . get_endorsers ( B b_cur ) >>=? fun endorsers_list -> List . find_map ( function | { Plugin . RPC . Validators . delegate ; slots ; _ } -> if Signature . Public_key_hash . equal delegate endorser then Some ( delegate , slots ) el... |
let test_participation ~ sufficient_participation ( ) = let n_accounts = 2 in Context . init ~ consensus_threshold : 1 n_accounts >>=? fun ( b0 , accounts ) -> Context . get_constants ( B b0 ) >>=? fun csts -> let blocks_per_cycle = Int32 . to_int csts . parametric . blocks_per_cycle in let mpr = csts . parametric . mi... |
let test_participation_rpc ( ) = let n_accounts = 2 in Context . init ~ consensus_threshold : 1 n_accounts >>=? fun ( b0 , accounts ) -> let ( account1 , account2 ) = match accounts with a1 :: a2 :: _ -> ( a1 , a2 ) | _ -> assert false in Context . Contract . pkh account1 >>=? fun del1 -> Context . Contract . pkh accou... |
let tests = [ Tztest . tztest " test insufficient participation " ` Quick ( test_participation ~ sufficient_participation : false ) ; Tztest . tztest " test minimal participation " ` Quick ( test_participation ~ sufficient_participation : true ) ; Tztest . tztest " test participation RPC " ` Quick test_participation_rp... |
let test_primitives_are_passable _ = let _ = void @-> returning void and _ = char @-> returning char and _ = schar @-> returning schar and _ = float @-> returning float and _ = double @-> returning double and _ = int @-> returning int and _ = nativeint @-> returning nativeint and _ = int8_t @-> returning int8_t and _ =... |
let test_unions_are_not_passable _ = let module M = struct type u let u : u union typ = union " u " let ( ) -: ty label = field u label ty let c = int -: " c " let f = double -: " f " let p = ptr u -: " p " let ( ) = seal u let _ = begin ignore ( u @-> returning void ) ; assert_raises ~ msg " : Foreign rejects union ty... |
let test_ldouble_not_passable _ = assert_raises ~ msg " : Foreign rejects ldouble type as argument " ( Unsupported " libffi does not support passing long double " ) ( fun ( ) -> Foreign . funptr ( ldouble @-> returning void ) ) ; assert_raises ~ msg " : Foreign rejects ldouble type as return type " ( Unsupported " libf... |
let test_complex_value_passability _ = ignore ( complex32 @-> returning void ) ; ignore ( complex64 @-> returning void ) ; ignore ( complexld @-> returning void ) ; assert_raises ~ msg " : Foreign rejects complex32 type as argument " ( Unsupported " libffi does not support passing float _Complex " ) ( fun ( ) -> Foreig... |
let test_arrays_are_not_passable _ = assert_raises ~ msg " : Array type rejected as argument " ( Unsupported " Unsupported argument type " ) ( fun ( ) -> array 1 int @-> returning void ) ; assert_raises ~ msg " : Array type rejected as return type " ( Unsupported " Unsupported return type " ) ( fun ( ) -> void @-> retu... |
let test_bigarrays_are_not_passable _ = assert_raises ~ msg " : bigarray type rejected as argument " ( Unsupported " Unsupported argument type " ) ( fun ( ) -> bigarray genarray [ | 1 ] | Bigarray_compat . int @-> returning void ) ; assert_raises ~ msg " : bigarray1 type rejected as argument " ( Unsupported " Unsupport... |
let test_pointers_are_passable _ = let _ = ptr void @-> returning ( ptr void ) and _ = ptr int @-> returning ( ptr int ) and _ = ptr ( ptr int ) @-> returning ( ptr ( ptr int ) ) in let module M = struct type s1 and u let s1 : s1 structure typ = structure " s1 " let _ = field s1 " _ " int let _ = field s1 " _ " ( ptr s... |
let test_function_pointers_are_passable _ = ignore ( Foreign . funptr ( int @-> returning int ) @-> returning ( Foreign . funptr ( int @-> returning int ) ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.