summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlasdair Armstrong2019-03-21 19:09:42 +0000
committerAlasdair Armstrong2019-03-21 19:18:49 +0000
commit2b0a4e2746e632d3f823baade49b560f79317497 (patch)
tree6d6f2bc4e008782673a5d915a5805a54c2cbf2a1 /src
parentb28dc3f4f74d02f5f0244ee3cee019bc1e4c7583 (diff)
Fix: Use doc_binding for printing scattered mapping types
Issue with pretty-printing mapping clauses types fixed by both cf7eb8b83 and 0e2f1710a, so remove the redundant clauses. In the parser we allow both ``` | Mapping id { mk_sd (SD_mapping ($2, mk_tannotn)) $startpos $endpos } | Mapping id Colon funcl_typ { mk_sd (SD_mapping ($2, $4)) $startpos $endpos } ``` so we should probably use doc_binding to correctly print any quantifier on the funcl_typ. Although since polymorphism and mappings don't play nicely together right now this likely doesn't occur very often in practice.
Diffstat (limited to 'src')
-rw-r--r--src/pretty_print_sail.ml8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/pretty_print_sail.ml b/src/pretty_print_sail.ml
index af25f189..1fa14a7d 100644
--- a/src/pretty_print_sail.ml
+++ b/src/pretty_print_sail.ml
@@ -659,14 +659,10 @@ let rec doc_scattered (SD_aux (sd_aux, _)) =
separate space [string "mapping clause"; doc_id id; equals; doc_mapcl mapcl]
| SD_mapping (id, Typ_annot_opt_aux (Typ_annot_opt_none, _)) ->
separate space [string "scattered mapping"; doc_id id]
- | SD_mapping (id, Typ_annot_opt_aux (Typ_annot_opt_some (_, typ), _)) ->
- separate space [string "scattered mapping"; doc_id id; string ":"; doc_typ typ]
+ | SD_mapping (id, Typ_annot_opt_aux (Typ_annot_opt_some (typq, typ), _)) ->
+ separate space [string "scattered mapping"; doc_id id; colon; doc_binding (typq, typ)]
| SD_unioncl (id, tu) ->
separate space [string "union clause"; doc_id id; equals; doc_union tu]
- | SD_mapping (id, _) ->
- string "scattered" ^^ space ^^ string "mapping" ^^ space ^^ doc_id id
- | SD_mapcl (id, mapcl) ->
- separate space [string "mapping clause"; doc_id id; equals; doc_mapcl mapcl]
let rec doc_def def = group (match def with
| DEF_default df -> doc_default df