summaryrefslogtreecommitdiff
path: root/src/pretty_print_sail.ml
diff options
context:
space:
mode:
authorThomas Bauereiss2017-11-08 16:27:49 +0000
committerThomas Bauereiss2017-11-08 16:27:49 +0000
commit16272e084d118c1b72d7921455d023aaafbf3dd5 (patch)
treec982bbc3748a56e230880e54e57380bbdb2a049a /src/pretty_print_sail.ml
parent275ded17e9d0824a932fe23607fe4f7d7b1da62f (diff)
Allow functions to be selectively declared external only for some backends
For example, val test = { ocaml: "test_ocaml" } : unit -> unit will only be external for OCaml. For other backends, it will have to be defined.
Diffstat (limited to 'src/pretty_print_sail.ml')
-rw-r--r--src/pretty_print_sail.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pretty_print_sail.ml b/src/pretty_print_sail.ml
index 710c9dac..c53d30b4 100644
--- a/src/pretty_print_sail.ml
+++ b/src/pretty_print_sail.ml
@@ -410,9 +410,9 @@ let doc_default (DT_aux(df,_)) = match df with
let doc_spec (VS_aux(v,_)) = match v with
| VS_val_spec(ts,id,ext_opt,is_cast) ->
let cast_pp = if is_cast then [string "cast"] else [] in
- let extern_kwd_pp, id_pp = match ext_opt with
- (* This sail syntax only supports a single extern name, so just use the ocaml version *)
- | Some ext -> [string "extern"], doc_op equals (doc_id id) (dquotes (string (ext "ocaml")))
+ (* This sail syntax only supports a single extern name, so just use the ocaml version *)
+ let extern_kwd_pp, id_pp = match ext_opt "ocaml" with
+ | Some ext -> [string "extern"], doc_op equals (doc_id id) (dquotes (string (ext)))
| None -> [], doc_id id
in
separate space ([string "val"] @ cast_pp @ extern_kwd_pp @ [doc_typscm ts] @ [id_pp])