summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Norton2017-04-19 10:56:56 +0100
committerRobert Norton2017-04-20 11:06:05 +0100
commita4b66c24311e2f9525936894f0fb7b191fceb9ee (patch)
tree80cf9645ad0fb43d084689f79555cbc0a0dff70c /src
parent20f68623e7d15493308f2da3210ad699568b5996 (diff)
add missing KD_nabbrev support in ocaml shallow embedding.
Diffstat (limited to 'src')
-rw-r--r--src/pretty_print_ocaml.ml7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pretty_print_ocaml.ml b/src/pretty_print_ocaml.ml
index 8f5fb591..9ba2a3bf 100644
--- a/src/pretty_print_ocaml.ml
+++ b/src/pretty_print_ocaml.ml
@@ -585,6 +585,11 @@ let doc_typdef_ocaml (TD_aux(td,_)) = match td with
brackets doc_rids]))])
let doc_kdef_ocaml (KD_aux(kd,_)) = match kd with
+ | KD_nabbrev (k, id, name_scm, nexp) ->
+ separate space [string "let" ;
+ doc_id_ocaml id;
+ equals;
+ doc_nexp nexp]
| KD_abbrev(_,id,nm,typschm) ->
doc_op equals (concat [string "type"; space; doc_id_ocaml_type id;]) (doc_typscm_ocaml typschm)
| KD_record(_,id,nm,typq,fs,_) ->
@@ -727,7 +732,7 @@ let doc_def_ocaml def = group (match def with
| DEF_val lbind -> doc_let_ocaml lbind
| DEF_reg_dec dec -> doc_dec_ocaml dec
| DEF_scattered sdef -> empty (*shoulnd't still be here*)
- | DEF_kind _ -> failwith "unhandled DEF_kind"
+ | DEF_kind k_def -> doc_kdef_ocaml k_def
| DEF_comm _ -> failwith "unhandled DEF_comm"
) ^^ hardline