summaryrefslogtreecommitdiff
path: root/src/pretty_print_sail.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2017-07-19 16:21:15 +0100
committerAlasdair Armstrong2017-07-19 16:22:52 +0100
commit754686295309c1ce36ca9d367365474ed467ffa1 (patch)
treef5c4620fb752042ed43e0df2c1b59eec815bf23f /src/pretty_print_sail.ml
parenta19a44469d07d5669db0691edd196b538d2cad17 (diff)
Better pretty printing for sail functions with no inline type annotations
Also added some additional helper functions in type_check_new.mli and changed real literals slightly
Diffstat (limited to 'src/pretty_print_sail.ml')
-rw-r--r--src/pretty_print_sail.ml7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pretty_print_sail.ml b/src/pretty_print_sail.ml
index 7544146e..d4278b56 100644
--- a/src/pretty_print_sail.ml
+++ b/src/pretty_print_sail.ml
@@ -489,10 +489,10 @@ let doc_rec (Rec_aux(r,_)) = match r with
| Rec_nonrec -> empty
(* include trailing space because caller doesn't know if we return
* empty *)
- | Rec_rec -> string "rec" ^^ space
+ | Rec_rec -> space ^^ string "rec"
let doc_tannot_opt (Typ_annot_opt_aux(t,_)) = match t with
- | Typ_annot_opt_some(tq,typ) -> doc_typquant tq (doc_typ typ)
+ | Typ_annot_opt_some(tq,typ) -> space ^^ doc_typquant tq (doc_typ typ)
| Typ_annot_opt_none -> empty
let doc_effects_opt (Effect_opt_aux(e,_)) = match e with
@@ -508,8 +508,7 @@ let doc_fundef (FD_aux(FD_function(r, typa, efa, fcls),_)) =
| _ ->
let sep = hardline ^^ string "and" ^^ space in
let clauses = separate_map sep doc_funcl fcls in
- separate space ([string "function";
- doc_rec r ^^ doc_tannot_opt typa;]@
+ separate space ([string "function" ^^ doc_rec r ^^ doc_tannot_opt typa]@
(match efa with
| Effect_opt_aux (Effect_opt_pure,_) -> []
| _ -> [string "effect";