Indentation fixes!
This commit is contained in:
parent
ef55c8f9fd
commit
f35bf95458
|
@ -157,8 +157,10 @@ and translate_op_desc const_env desc =
|
|||
Heptagon.op_kind = translate_op_kind desc.op_kind }
|
||||
|
||||
and translate_array_op const_env env = function
|
||||
| Eselect e_list -> Heptagon.Eselect (List.map (translate_size_exp const_env) e_list)
|
||||
| Eupdate e_list -> Heptagon.Eupdate (List.map (translate_size_exp const_env) e_list)
|
||||
| Eselect e_list ->
|
||||
Heptagon.Eselect (List.map (translate_size_exp const_env) e_list)
|
||||
| Eupdate e_list ->
|
||||
Heptagon.Eupdate (List.map (translate_size_exp const_env) e_list)
|
||||
| Erepeat -> Heptagon.Erepeat
|
||||
| Eselect_slice -> Heptagon.Eselect_slice
|
||||
| Econcat -> Heptagon.Econcat
|
||||
|
@ -177,7 +179,8 @@ and translate_desc loc const_env env = function
|
|||
else (* undefined var *)
|
||||
Error.message loc (Error.Evar x)
|
||||
| Elast x -> Heptagon.Elast (Rename.name loc env x)
|
||||
| Etuple e_list -> Heptagon.Etuple (List.map (translate_exp const_env env) e_list)
|
||||
| Etuple e_list ->
|
||||
Heptagon.Etuple (List.map (translate_exp const_env env) e_list)
|
||||
| Eapp ({ a_op = (Earray_op Erepeat)} as app, e_list) ->
|
||||
let e_list = List.map (translate_exp const_env env) e_list in
|
||||
(match e_list with
|
||||
|
@ -190,9 +193,11 @@ and translate_desc loc const_env env = function
|
|||
Heptagon.Eapp (translate_app const_env env app, e_list)
|
||||
| Efield (e, field) -> Heptagon.Efield (translate_exp const_env env e, field)
|
||||
| Estruct f_e_list ->
|
||||
let f_e_list = List.map (fun (f,e) -> f, translate_exp const_env env e) f_e_list in
|
||||
let f_e_list =
|
||||
List.map (fun (f,e) -> f, translate_exp const_env env e) f_e_list in
|
||||
Heptagon.Estruct f_e_list
|
||||
| Earray e_list -> Heptagon.Earray (List.map (translate_exp const_env env) e_list)
|
||||
| Earray e_list ->
|
||||
Heptagon.Earray (List.map (translate_exp const_env env) e_list)
|
||||
|
||||
and translate_pat loc env = function
|
||||
| Evarpat x -> Heptagon.Evarpat (Rename.name loc env x)
|
||||
|
|
|
@ -43,9 +43,11 @@ and edesc =
|
|||
| Econstvar of name
|
||||
| Efby of const option * exp
|
||||
| Etuple of exp list
|
||||
| Ecall of op_desc * exp list * ident option (** [op_desc] is the function called
|
||||
[exp list] is the passed arguments
|
||||
[ident option] is the optional reset condition *)
|
||||
| Ecall of op_desc * exp list * ident option (** [op_desc] is the function
|
||||
called [exp list] is the
|
||||
passed arguments [ident
|
||||
option] is the optional reset
|
||||
condition *)
|
||||
|
||||
| Ewhen of exp * longname * ident
|
||||
| Emerge of ident * (longname * exp) list
|
||||
|
@ -65,11 +67,10 @@ and array_op =
|
|||
| Eselect_slice of size_exp * size_exp * exp (*lower bound, upper bound,
|
||||
array*)
|
||||
| Econcat of exp * exp
|
||||
| Eiterator of iterator_type * op_desc * size_exp * exp list * ident option (**
|
||||
[op_desc] is the function iterated,
|
||||
[size_exp] is the size of the iteration,
|
||||
[exp list] is the passed arguments,
|
||||
[ident option] is the optional reset condition *)
|
||||
| Eiterator of iterator_type * op_desc * size_exp * exp list * ident option
|
||||
(** [op_desc] is the function iterated, [size_exp] is the size of the
|
||||
iteration, [exp list] is the passed arguments, [ident option] is the
|
||||
optional reset condition *)
|
||||
|
||||
and op_desc = { op_name: longname; op_params: size_exp list; op_kind: op_kind }
|
||||
and op_kind = | Eop | Enode
|
||||
|
|
|
@ -82,7 +82,8 @@ let rec translate const_env map (m, si, j, s)
|
|||
| Minils.Econst v -> Const (translate_const const_env v)
|
||||
| Minils.Evar n -> Lhs (var_from_name map n)
|
||||
| Minils.Econstvar n -> Const (Cint (int_of_size_exp const_env (SVar n)))
|
||||
| Minils.Ecall ( { Minils.op_name = n; Minils.op_kind = Minils.Eop }, e_list, _) ->
|
||||
| Minils.Ecall ({ Minils.op_name = n; Minils.op_kind = Minils.Eop },
|
||||
e_list, _) ->
|
||||
Op (n, List.map (translate const_env map (m, si, j, s)) e_list)
|
||||
| Minils.Ewhen (e, _, _) -> translate const_env map (m, si, j, s) e
|
||||
| Minils.Efield (e, field) ->
|
||||
|
@ -142,7 +143,8 @@ let rec translate_eq const_env map { Minils.eq_lhs = pat; Minils.eq_rhs = e }
|
|||
let si = (match opt_c with
|
||||
| None -> si
|
||||
| Some c ->
|
||||
(Assgn (x, Const (translate_const const_env c))) :: si) in
|
||||
(Assgn (x,
|
||||
Const (translate_const const_env c))) :: si) in
|
||||
let ty = translate_type const_env ty in
|
||||
let m = (n, ty) :: m in
|
||||
let action = Assgn (var_from_name map n,
|
||||
|
@ -164,7 +166,8 @@ let rec translate_eq const_env map { Minils.eq_lhs = pat; Minils.eq_rhs = e }
|
|||
| None -> (control map ck action) :: s
|
||||
| Some r ->
|
||||
let ra =
|
||||
control map (Minils.Con (ck, Name "true", r)) (Reinit o) in
|
||||
control map (Minils.Con (ck, Name "true", r))
|
||||
(Reinit o) in
|
||||
ra :: (control map ck action) :: s ) in
|
||||
m, si, j, s
|
||||
|
||||
|
|
Loading…
Reference in New Issue