summaryrefslogtreecommitdiff
path: root/src/ocaml_backend.ml
diff options
context:
space:
mode:
authorJon French2019-04-15 16:18:18 +0100
committerJon French2019-04-15 16:18:18 +0100
commita9f0b829507e9882efdb59cce4d83ea7e87f5f71 (patch)
tree11cde6c1918bc15f4dda9a8e40afd4a1fe912a0a /src/ocaml_backend.ml
parent0f6fd188ca232cb539592801fcbb873d59611d81 (diff)
parent57443173923e87f33713c99dbab9eba7e3db0660 (diff)
Merge branch 'sail2' into rmem_interpreter
Diffstat (limited to 'src/ocaml_backend.ml')
-rw-r--r--src/ocaml_backend.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ocaml_backend.ml b/src/ocaml_backend.ml
index 27b5b16e..cc1afaac 100644
--- a/src/ocaml_backend.ml
+++ b/src/ocaml_backend.ml
@@ -463,6 +463,7 @@ let ocaml_funcls ctx =
match Bindings.find id ctx.val_specs with
| Typ_aux (Typ_fn (typs, typ, _), _) -> (typs, typ)
| _ -> failwith "Found val spec which was not a function!"
+ | exception Not_found -> failwith ("No val spec found for " ^ string_of_id id)
in
(* Any remaining type variables after simple_typ rewrite should
indicate Type-polymorphism. If we have it, we need to generate
@@ -578,7 +579,7 @@ let ocaml_string_of_struct ctx id typq fields =
let ocaml_field (typ, id) =
separate space [string (string_of_id id ^ " = \""); string "^"; ocaml_string_typ typ (arg ^^ string "." ^^ zencode ctx id)]
in
- separate space [string "let"; ocaml_string_of id; parens (arg ^^ space ^^ colon ^^ space ^^ zencode ctx id); equals]
+ separate space [string "let"; ocaml_string_of id; parens (arg ^^ space ^^ colon ^^ space ^^ ocaml_typquant typq ^^ space ^^ zencode ctx id); equals]
^//^ (string "\"{" ^^ separate_map (hardline ^^ string "^ \", ") ocaml_field fields ^^ string " ^ \"}\"")
let ocaml_string_of_abbrev ctx id typq typ =