Commit 01fc55d2 authored by Mário Pereira's avatar Mário Pereira

Extraction: printing of exceptions arguments

parent 0db1c7f8
......@@ -563,9 +563,12 @@ module Print = struct
| Some s ->
fprintf fmt "@[<hov 4>| %a ->@ %a@]"
(syntax_arguments s print_var) pvl (print_expr info ~paren:true) e
| None ->
fprintf fmt "@[<hov 4>| %a %a ->@ %a@]" (print_uident info) (xs.xs_name)
(print_list nothing print_var) pvl (print_expr info) e
| None when pvl = []->
fprintf fmt "@[<hov 4>| %a ->@ %a@]" (print_uident info)
(xs.xs_name) (print_expr info) e
| None ->
fprintf fmt "@[<hov 4>| %a (%a) ->@ %a@]" (print_uident info)
(xs.xs_name) (print_list comma print_var) pvl (print_expr info) e
let print_type_decl info fst fmt its =
let print_constr fmt (id, cs_args) =
......
......@@ -226,10 +226,10 @@ module TestExtraction
let constant opt_a = opt_f 40 2
let opt_g (x [@ocaml:optional]) (y [@ocaml:named]: int) =
match x with None -> y | Some x -> x + y end
let constant opt_b = opt_g None 42
let constant opt_c = opt_g (Some 40) 2
(* FIXME: partial application with named arguments not yet supported *)
let constant opt_b = fun y -> opt_g y 42
let opt_h () = fun y -> opt_f 40 y
let opt_i () = opt_h () 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment