removing white spaces
This commit is contained in:
parent
c70d34ec06
commit
c5fbcbe765
|
@ -796,7 +796,7 @@ and typing_iterator const_env h
|
||||||
in
|
in
|
||||||
let mk_array_type ty_list = List.map (array_of_idx_list n_list) ty_list in
|
let mk_array_type ty_list = List.map (array_of_idx_list n_list) ty_list in
|
||||||
let n_size = List.length n_list in
|
let n_size = List.length n_list in
|
||||||
let mk_array_type_butnlast ty_list =
|
let mk_array_type_butnlast ty_list =
|
||||||
map_butnlast n_size (array_of_idx_list n_list) ty_list in
|
map_butnlast n_size (array_of_idx_list n_list) ty_list in
|
||||||
match it with
|
match it with
|
||||||
| Imap ->
|
| Imap ->
|
||||||
|
@ -811,10 +811,10 @@ and typing_iterator const_env h
|
||||||
let args_ty_list = mk_array_type args_ty_list in
|
let args_ty_list = mk_array_type args_ty_list in
|
||||||
let result_ty_list = mk_array_type result_ty_list in
|
let result_ty_list = mk_array_type result_ty_list in
|
||||||
(* Last but one arg of the function should be integer *)
|
(* Last but one arg of the function should be integer *)
|
||||||
List.iter
|
List.iter
|
||||||
(fun idx_ty ->
|
(fun idx_ty ->
|
||||||
( try unify cenv idx_ty (Tid Initial.pint)
|
( try unify cenv idx_ty (Tid Initial.pint)
|
||||||
with TypingError _ -> raise (TypingError (Emapi_bad_args idx_ty))))
|
with TypingError _ -> raise (TypingError (Emapi_bad_args idx_ty))))
|
||||||
idx_ty_list;
|
idx_ty_list;
|
||||||
let typed_e_list = typing_args const_env h
|
let typed_e_list = typing_args const_env h
|
||||||
args_ty_list e_list in
|
args_ty_list e_list in
|
||||||
|
@ -836,8 +836,8 @@ and typing_iterator const_env h
|
||||||
(* Last but one arg of the function should be integer *)
|
(* Last but one arg of the function should be integer *)
|
||||||
List.iter
|
List.iter
|
||||||
(fun idx_ty ->
|
(fun idx_ty ->
|
||||||
( try unify cenv idx_ty (Tid Initial.pint)
|
( try unify cenv idx_ty (Tid Initial.pint)
|
||||||
with TypingError _ -> raise (TypingError (Emapi_bad_args idx_ty))))
|
with TypingError _ -> raise (TypingError (Emapi_bad_args idx_ty))))
|
||||||
idx_ty_list;
|
idx_ty_list;
|
||||||
let args_ty_list = mk_array_type_butnlast (args_ty_list@[acc_ty]) in
|
let args_ty_list = mk_array_type_butnlast (args_ty_list@[acc_ty]) in
|
||||||
let typed_e_list =
|
let typed_e_list =
|
||||||
|
|
|
@ -91,7 +91,7 @@ let array_elt_of_exp idx e =
|
||||||
mk_ext_value_exp ty (Warray(ext_value_of_exp e, idx))
|
mk_ext_value_exp ty (Warray(ext_value_of_exp e, idx))
|
||||||
| _ -> internal_error "mls2obc"
|
| _ -> internal_error "mls2obc"
|
||||||
|
|
||||||
let rec array_elt_of_exp_list idx_list e =
|
let rec array_elt_of_exp_list idx_list e =
|
||||||
match e.e_desc, Modules.unalias_type e.e_ty with
|
match e.e_desc, Modules.unalias_type e.e_ty with
|
||||||
| Econst ({ se_desc = Sarray_power (c, _) }), Tarray (ty,_) ->
|
| Econst ({ se_desc = Sarray_power (c, _) }), Tarray (ty,_) ->
|
||||||
mk_exp ty (Econst c)
|
mk_exp ty (Econst c)
|
||||||
|
@ -440,7 +440,7 @@ let rec translate_eq map call_context { Minils.eq_lhs = pat; Minils.eq_rhs = e }
|
||||||
let p_list = List.map (translate_extvalue_to_exp map) pe_list in
|
let p_list = List.map (translate_extvalue_to_exp map) pe_list in
|
||||||
let c_list = List.map (translate_extvalue_to_exp map) e_list in
|
let c_list = List.map (translate_extvalue_to_exp map) e_list in
|
||||||
let xl, xdl = List.split (List.map (fun _ -> fresh_it ()) n_list) in
|
let xl, xdl = List.split (List.map (fun _ -> fresh_it ()) n_list) in
|
||||||
let call_context =
|
let call_context =
|
||||||
Some { oa_index = List.map (fun x -> mk_pattern_int (Lvar x)) xl;
|
Some { oa_index = List.map (fun x -> mk_pattern_int (Lvar x)) xl;
|
||||||
oa_size = n_list} in
|
oa_size = n_list} in
|
||||||
let n_list = List.map mk_exp_static_int n_list in
|
let n_list = List.map mk_exp_static_int n_list in
|
||||||
|
@ -536,7 +536,7 @@ and translate_iterator map call_context it name_list
|
||||||
List.map2 (fun l ty -> aux l ty xl) name_list ty_list
|
List.map2 (fun l ty -> aux l ty xl) name_list ty_list
|
||||||
in
|
in
|
||||||
let array_of_input c_list =
|
let array_of_input c_list =
|
||||||
List.map (array_elt_of_exp_list (List.map mk_evar_int xl)) c_list
|
List.map (array_elt_of_exp_list (List.map mk_evar_int xl)) c_list
|
||||||
in
|
in
|
||||||
let mk_loop b xdl nl =
|
let mk_loop b xdl nl =
|
||||||
let rec mk_loop b xdl nl = match xdl, nl with
|
let rec mk_loop b xdl nl = match xdl, nl with
|
||||||
|
@ -544,7 +544,7 @@ and translate_iterator map call_context it name_list
|
||||||
| xd::xdl, n::nl -> mk_loop (mk_block [Afor (xd, mk_exp_const_int 0, n, b)]) xdl nl
|
| xd::xdl, n::nl -> mk_loop (mk_block [Afor (xd, mk_exp_const_int 0, n, b)]) xdl nl
|
||||||
| _, _ -> assert false
|
| _, _ -> assert false
|
||||||
in
|
in
|
||||||
mk_loop b (List.rev xdl) nl
|
mk_loop b (List.rev xdl) nl
|
||||||
in
|
in
|
||||||
match it with
|
match it with
|
||||||
| Minils.Imap ->
|
| Minils.Imap ->
|
||||||
|
|
|
@ -406,7 +406,7 @@ let step_fun_call out_env var_env sig_info objn out args =
|
||||||
| Oobj o -> Cfield (Cderef (Cvar "self"), local_qn (name o))
|
| Oobj o -> Cfield (Cderef (Cvar "self"), local_qn (name o))
|
||||||
| Oarray (o, l) ->
|
| Oarray (o, l) ->
|
||||||
let f = Cfield (Cderef (Cvar "self"), local_qn (name o)) in
|
let f = Cfield (Cderef (Cvar "self"), local_qn (name o)) in
|
||||||
let rec mk_idx pl = match pl with
|
let rec mk_idx pl = match pl with
|
||||||
| [] -> f
|
| [] -> f
|
||||||
| p::pl -> Carray (mk_idx pl, Clhs (clhs_of_lhs var_env p))
|
| p::pl -> Carray (mk_idx pl, Clhs (clhs_of_lhs var_env p))
|
||||||
in
|
in
|
||||||
|
@ -568,7 +568,7 @@ let rec cstm_of_act out_env var_env obj_env act =
|
||||||
let field = Cfield (Cderef (Cvar "self"), local_qn (name on)) in
|
let field = Cfield (Cderef (Cvar "self"), local_qn (name on)) in
|
||||||
let rec mk_loop nl elt = match nl with
|
let rec mk_loop nl elt = match nl with
|
||||||
| [] -> [Csexpr (Cfun_call (classn ^ "_reset", [Caddrof elt] ))]
|
| [] -> [Csexpr (Cfun_call (classn ^ "_reset", [Caddrof elt] ))]
|
||||||
| n::nl ->
|
| n::nl ->
|
||||||
let x = gen_symbol () in
|
let x = gen_symbol () in
|
||||||
let elt = Carray(elt, Clhs (Cvar x)) in
|
let elt = Carray(elt, Clhs (Cvar x)) in
|
||||||
[Cfor(x, Cconst (Ccint 0), cexpr_of_static_exp n, mk_loop nl elt)]
|
[Cfor(x, Cconst (Ccint 0), cexpr_of_static_exp n, mk_loop nl elt)]
|
||||||
|
@ -667,7 +667,7 @@ let mem_decl_of_class_def cd =
|
||||||
let ty = Cty_id (qn_append od.o_class "_mem") in
|
let ty = Cty_id (qn_append od.o_class "_mem") in
|
||||||
let ty = match od.o_size with
|
let ty = match od.o_size with
|
||||||
| Some nl ->
|
| Some nl ->
|
||||||
let rec mk_idx nl = match nl with
|
let rec mk_idx nl = match nl with
|
||||||
| [] -> ty
|
| [] -> ty
|
||||||
| n::nl -> Cty_arr (int_of_static_exp n, mk_idx nl)
|
| n::nl -> Cty_arr (int_of_static_exp n, mk_idx nl)
|
||||||
in
|
in
|
||||||
|
|
|
@ -52,9 +52,9 @@ let rec map_butlast f l =
|
||||||
let map_butnlast n f l =
|
let map_butnlast n f l =
|
||||||
let rec aux l = match l with
|
let rec aux l = match l with
|
||||||
| [] -> [], 0
|
| [] -> [], 0
|
||||||
| a::l ->
|
| a::l ->
|
||||||
let (res, k) = aux l in
|
let (res, k) = aux l in
|
||||||
if k < n then
|
if k < n then
|
||||||
a::res, (k + 1)
|
a::res, (k + 1)
|
||||||
else
|
else
|
||||||
(f a)::res, (k+1)
|
(f a)::res, (k+1)
|
||||||
|
@ -82,9 +82,9 @@ let rec split_last = function
|
||||||
let rec split_nlast n l =
|
let rec split_nlast n l =
|
||||||
let rec aux l = match l with
|
let rec aux l = match l with
|
||||||
| [] -> [], [], 0
|
| [] -> [], [], 0
|
||||||
| a::l ->
|
| a::l ->
|
||||||
let (l1, l2, k) = aux l in
|
let (l1, l2, k) = aux l in
|
||||||
if k < n then
|
if k < n then
|
||||||
l1, a::l2, (k + 1)
|
l1, a::l2, (k + 1)
|
||||||
else
|
else
|
||||||
a::l1, l2, (k+1)
|
a::l1, l2, (k+1)
|
||||||
|
|
Loading…
Reference in New Issue