diff options
| author | Alasdair Armstrong | 2019-02-12 17:58:30 +0000 |
|---|---|---|
| committer | Alasdair Armstrong | 2019-02-12 17:59:47 +0000 |
| commit | 25a84ea4594de693808564b78c49c4fbefd0a555 (patch) | |
| tree | 82f03a16b1d308ed79eac4ec094666e548c55a45 /src | |
| parent | 60025145509db4152d48f2ad3a78b1e46be064fe (diff) | |
Add a CHANGELOG file
Fix a bug where we generated empty definitions which pre 4.07 versions
of OCaml don't appear to support.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ocaml_backend.ml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ocaml_backend.ml b/src/ocaml_backend.ml index 3f34c422..d51aba75 100644 --- a/src/ocaml_backend.ml +++ b/src/ocaml_backend.ml @@ -591,22 +591,27 @@ let ocaml_typedef ctx (TD_aux (td_aux, (l, _))) = ^/^ rbrace) ^^ ocaml_def_end ^^ ocaml_string_of_struct ctx id typq fields + ^^ ocaml_def_end | TD_variant (id, _, cases, _) when string_of_id id = "exception" -> ocaml_exceptions ctx cases + ^^ ocaml_def_end | TD_variant (id, typq, cases, _) -> (separate space [string "type"; ocaml_typquant typq; zencode ctx id; equals] ^//^ ocaml_cases ctx cases) ^^ ocaml_def_end ^^ ocaml_string_of_variant ctx id typq cases + ^^ ocaml_def_end | TD_enum (id, ids, _) -> (separate space [string "type"; zencode ctx id; equals] ^//^ (bar ^^ space ^^ ocaml_enum ctx ids)) ^^ ocaml_def_end ^^ ocaml_string_of_enum ctx id ids + ^^ ocaml_def_end | TD_abbrev (id, typq, A_aux (A_typ typ, _)) -> separate space [string "type"; ocaml_typquant typq; zencode ctx id; equals; ocaml_typ ctx typ] ^^ ocaml_def_end ^^ ocaml_string_of_abbrev ctx id typq typ + ^^ ocaml_def_end | TD_abbrev _ -> empty | TD_bitfield _ -> @@ -634,7 +639,7 @@ let ocaml_def ctx def = match def with | DEF_fundef fd -> group (ocaml_fundef ctx fd) ^^ twice hardline | DEF_internal_mutrec fds -> separate_map (twice hardline) (fun fd -> group (ocaml_fundef ctx fd)) fds ^^ twice hardline - | DEF_type td -> nf_group (ocaml_typedef ctx td) ^^ ocaml_def_end + | DEF_type td -> nf_group (ocaml_typedef ctx td) | DEF_val lb -> nf_group (string "let" ^^ space ^^ ocaml_letbind ctx lb) ^^ ocaml_def_end | _ -> empty |
