diff options
| author | Alasdair Armstrong | 2017-10-23 18:31:05 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-10-23 18:31:05 +0100 |
| commit | 761c9bda82472b39d64416b6d4e25d21081fa261 (patch) | |
| tree | be6e0ff64a4a3a86e47704839cc5484a71c97d72 /src/pretty_print_sail2.ml | |
| parent | a92a237fa23e6dd4b06f58615338a609c34d72be (diff) | |
Added effect set pretty printing for new parser
Also added some new utility functions in ast_util
Diffstat (limited to 'src/pretty_print_sail2.ml')
| -rw-r--r-- | src/pretty_print_sail2.ml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pretty_print_sail2.ml b/src/pretty_print_sail2.ml index 3fa05132..5662fe1a 100644 --- a/src/pretty_print_sail2.ml +++ b/src/pretty_print_sail2.ml @@ -90,8 +90,11 @@ let rec doc_typ (Typ_aux (typ_aux, _)) = enclose (string "{|") (string "|}") (separate_map (string ", ") doc_int ints) | Typ_exist (kids, nc, typ) -> braces (separate_map space doc_kid kids ^^ comma ^^ space ^^ doc_nc nc ^^ dot ^^ space ^^ doc_typ typ) - | Typ_fn (typ1, typ2, eff) -> + | Typ_fn (typ1, typ2, Effect_aux (Effect_set [], _)) -> separate space [doc_typ typ1; string "->"; doc_typ typ2] + | Typ_fn (typ1, typ2, Effect_aux (Effect_set effs, _)) -> + let ocaml_eff = braces (separate (comma ^^ space) (List.map (fun be -> string (string_of_base_effect be)) effs)) in + separate space [doc_typ typ1; string "->"; doc_typ typ2; string "effect"; ocaml_eff] and doc_typ_arg (Typ_arg_aux (ta_aux, _)) = match ta_aux with | Typ_arg_typ typ -> doc_typ typ |
