Commits

Antoine Pietri committed fd9cb78

prettyprint: deleted empty line before main() when there isn't any functions

Comments (0)

Files changed (1)

 
 let rec format_function_list ppf = function
   | [] -> Format.fprintf ppf ""
+  | [x] -> Format.fprintf ppf "%a@\n" format_function x
   | x :: xs -> Format.fprintf ppf "%a@\n%a"
                  format_function x
                  format_function_list xs
     format_statement_list main.Ast.mainbody
 
 let f ast =
-  Format.fprintf Format.std_formatter "%a@\n%a@."
+  Format.fprintf Format.std_formatter "%a%a@."
     format_function_list ast.Ast.func
     format_main ast.Ast.main