[fix] identation error

This commit is contained in:
dsac 2022-12-15 20:37:05 +01:00
parent ca271eaf66
commit eceeb3c157

View File

@ -48,8 +48,8 @@ let pre2vars verbose debug main_fn =
| EApp (ty, node, arg) -> | EApp (ty, node, arg) ->
let arg = pre_push arg in let arg = pre_push arg in
EApp (ty, node, arg) EApp (ty, node, arg)
in in
let rec aux (expr: t_expression) = let rec aux (expr: t_expression) =
match expr with match expr with
| EVar _ -> expr | EVar _ -> expr
| EMonOp (ty, mop, expr) -> | EMonOp (ty, mop, expr) ->
@ -82,11 +82,11 @@ let rec aux (expr: t_expression) =
| EApp (ty, node, arg) -> | EApp (ty, node, arg) ->
let arg = aux arg in let arg = aux arg in
EApp (ty, node, arg) EApp (ty, node, arg)
in in
expression_pass (somify aux) expression_pass (somify aux)
let chkvar_init_unicity verbose debug main_fn : t_nodelist -> t_nodelist option = let chkvar_init_unicity verbose debug main_fn : t_nodelist -> t_nodelist option =
let aux (node: t_node) : t_node option = let aux (node: t_node) : t_node option =
let incr_aux h n = let incr_aux h n =
match Hashtbl.find_opt h n with match Hashtbl.find_opt h n with
| None -> failwith "todo, should not happened." | None -> failwith "todo, should not happened."
@ -152,11 +152,11 @@ let aux (node: t_node) : t_node option =
else None else None
end end
(** never purge -> failwith never executed! purge_initialized h; *) (** never purge -> failwith never executed! purge_initialized h; *)
in in
node_pass aux node_pass aux
let pass_linearization verbose debug main_fn = let pass_linearization verbose debug main_fn =
let node_lin (node: t_node): t_node option = let node_lin (node: t_node): t_node option =
let rec tpl ((pat, exp): t_equation) = let rec tpl ((pat, exp): t_equation) =
match exp with match exp with
| ETuple (_, hexps :: texps) -> | ETuple (_, hexps :: texps) ->
@ -189,11 +189,11 @@ let node_lin (node: t_node): t_node option =
n_equations = new_equations; n_equations = new_equations;
n_automata = node.n_automata; n_automata = node.n_automata;
} }
in in
node_pass node_lin node_pass node_lin
let pass_eq_reordering verbose debug main_fn ast = let pass_eq_reordering verbose debug main_fn ast =
let rec pick_equations init_vars eqs remaining_equations = let rec pick_equations init_vars eqs remaining_equations =
match remaining_equations with match remaining_equations with
| [] -> Some eqs | [] -> Some eqs
| _ -> | _ ->
@ -214,7 +214,7 @@ let rec pick_equations init_vars eqs remaining_equations =
(List.filter (fun eq -> List.for_all (fun e -> eq <> e) (h :: t)) remaining_equations) (List.filter (fun eq -> List.for_all (fun e -> eq <> e) (h :: t)) remaining_equations)
end end
in in
let node_eq_reorganising (node: t_node): t_node option = let node_eq_reorganising (node: t_node): t_node option =
let init_vars = List.map name_of_var (snd node.n_inputs) in let init_vars = List.map name_of_var (snd node.n_inputs) in
try try
begin begin
@ -223,8 +223,8 @@ let node_eq_reorganising (node: t_node): t_node option =
| Some eqs -> Some { node with n_equations = eqs } | Some eqs -> Some { node with n_equations = eqs }
end end
with PassExn err -> (verbose err; None) with PassExn err -> (verbose err; None)
in in
node_pass node_eq_reorganising ast node_pass node_eq_reorganising ast
let pass_typing verbose debug main_fn ast = let pass_typing verbose debug main_fn ast =
let htbl = Hashtbl.create (List.length ast) in let htbl = Hashtbl.create (List.length ast) in