summaryrefslogtreecommitdiff
path: root/src/pretty_print.ml
diff options
context:
space:
mode:
authorKathy Gray2015-09-29 13:30:32 +0100
committerKathy Gray2015-09-29 13:30:32 +0100
commit7adb28800e349fdf57815bd0904e5f2aeedcf1a7 (patch)
tree6483493d76527140fbac9c04c26a9cb92e273367 /src/pretty_print.ml
parentf54f2988e8fce87dee5e9b19dc552d2ef1c842ab (diff)
Boiler plate to generate an ml file from a sail spec. Now debugging the output of such
Diffstat (limited to 'src/pretty_print.ml')
-rw-r--r--src/pretty_print.ml11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pretty_print.ml b/src/pretty_print.ml
index d667a1ee..1d3947cd 100644
--- a/src/pretty_print.ml
+++ b/src/pretty_print.ml
@@ -1374,7 +1374,8 @@ let doc_exp_ocaml, doc_let_ocaml =
parens ((string "vector_subrange") ^^ space ^^ exp v ^^ space ^^ (exp e1) ^^ space ^^ (exp e2))
| E_field((E_aux(_,(_,fannot)) as fexp),id) ->
(match fannot with
- | Base((_,{t= Tapp("register",_)}),External _,_,_,_) ->
+ | Base((_,{t= Tapp("register",_)}),_,_,_,_) |
+ Base((_,{t= Tabbrev(_,{t=Tapp("register",_)})}),_,_,_,_)->
parens ((string "get_register_field") ^^ space ^^ exp fexp ^^ space ^^
(string "\"") ^^ (doc_id id) ^^ string "\"")
| _ -> exp fexp ^^ dot ^^ doc_id id)
@@ -1541,10 +1542,10 @@ let doc_typdef_ocaml (TD_aux(td,_)) = match td with
doc_op equals
((string "let") ^^ space ^^ doc_id_ocaml id ^^ space ^^ (string "init_val"))
(separate space [string "Vregister";
- (separate comma_sp [string "init_val";
- doc_nexp n1;
- string (if dir then "true" else "false");
- brackets doc_rids])])
+ (parens (separate comma_sp [string "init_val";
+ doc_nexp n1;
+ string (if dir then "true" else "false");
+ brackets doc_rids]))])
let doc_rec_ocaml (Rec_aux(r,_)) = match r with
| Rec_nonrec -> empty