Skip to content
Snippets Groups Projects
Commit 753d4562 authored by Pierre Loic Garoche's avatar Pierre Loic Garoche
Browse files

[general] print types before nodes in lustre output

parent 1613ad20
No related branches found
No related tags found
No related merge requests found
...@@ -331,8 +331,12 @@ let pp_decl fmt decl = ...@@ -331,8 +331,12 @@ let pp_decl fmt decl =
| Open (local, s) -> if local then fprintf fmt "#open \"%s\"@ " s else fprintf fmt "#open <%s>@ " s | Open (local, s) -> if local then fprintf fmt "#open \"%s\"@ " s else fprintf fmt "#open <%s>@ " s
| TypeDef tdef -> fprintf fmt "%a@ " pp_typedef tdef | TypeDef tdef -> fprintf fmt "%a@ " pp_typedef tdef
let pp_prog fmt prog = let pp_prog fmt prog =
fprintf_list ~sep:"@ " pp_decl fmt prog (* we first print types *)
let type_decl, others =
List.partition (fun decl -> match decl.top_decl_desc with TypeDef _ -> true | _ -> false) prog
in
fprintf_list ~sep:"@ " pp_decl fmt (type_decl@others)
let pp_short_decl fmt decl = let pp_short_decl fmt decl =
match decl.top_decl_desc with match decl.top_decl_desc with
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment