diff --git a/compiler/main/mls2obc.ml b/compiler/main/mls2obc.ml index 4fff980..bc1d865 100644 --- a/compiler/main/mls2obc.ml +++ b/compiler/main/mls2obc.ml @@ -313,7 +313,8 @@ and mk_node_call map call_context app loc name_list args = match app.Minils.a_op with | Minils.Enode f | Minils.Efun f -> let o = mk_obj_call_from_context call_context (gen_obj_name f) in - let j = [(o, f, size_from_call_context call_context, loc)] in + let j = [(o, f, app.Minils.a_params, + size_from_call_context call_context, loc)] in let si = (match app.Minils.a_op with | Minils.Efun _ -> [] @@ -395,8 +396,8 @@ let var_decl l = List.map (fun (x, t) -> mk_var_dec x t) l let obj_decl l = - List.map (fun (x, t, i, loc) -> - { o_name = obj_call_name x; o_class = t; + List.map (fun (x, t, p, i, loc) -> + { o_name = obj_call_name x; o_class = t; o_params = p; o_size = i; o_loc = loc }) l let translate_contract map mem_vars = diff --git a/compiler/obc/obc.ml b/compiler/obc/obc.ml index a629196..18214da 100644 --- a/compiler/obc/obc.ml +++ b/compiler/obc/obc.ml @@ -80,6 +80,7 @@ and var_dec = type obj_dec = { o_name : obj_name; o_class : instance_name; + o_params : static_exp list; o_size : static_exp option; o_loc : location } diff --git a/compiler/obc/obc_printer.ml b/compiler/obc/obc_printer.ml index 58f03c9..d34dd09 100644 --- a/compiler/obc/obc_printer.ml +++ b/compiler/obc/obc_printer.ml @@ -15,8 +15,9 @@ let print_vd ff vd = let print_obj ff o = fprintf ff "@["; print_name ff o.o_name; fprintf ff " : "; print_longname ff o.o_class; + fprintf ff "@[<2>%a@]" (print_list_r print_static_exp "<<"","">>") o.o_params; (match o.o_size with - | Some se -> print_static_exp ff se; + | Some se -> fprintf ff "[%a]" print_static_exp se | None -> ()); fprintf ff ";@]"