diff options
| author | Robert Norton | 2017-04-20 11:43:43 +0100 |
|---|---|---|
| committer | Robert Norton | 2017-04-20 11:43:43 +0100 |
| commit | 69010a4328be6e26ecb8e14073cb16c30a38d52c (patch) | |
| tree | 9f5c8fc3a7089bdeccebf6bbf8cf045683495504 | |
| parent | ed1927a2b7f4be3d5b6a1eea9541894db8897582 (diff) | |
add brackets around integer literals so that ocaml parses them correctly and doesn't mistake the - for minus operator
| -rw-r--r-- | src/pretty_print_ocaml.ml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pretty_print_ocaml.ml b/src/pretty_print_ocaml.ml index 9ba2a3bf..fb6dd99f 100644 --- a/src/pretty_print_ocaml.ml +++ b/src/pretty_print_ocaml.ml @@ -127,7 +127,7 @@ let doc_lit_ocaml in_pat (L_aux(l,_)) = | L_one -> "Vone" | L_true -> "Vone" | L_false -> "Vzero" - | L_num i -> "(big_int_of_int " ^ (string_of_int i) ^ ")" + | L_num i -> "(big_int_of_int (" ^ (string_of_int i) ^ "))" | L_hex n -> "(num_to_vec " ^ ("0x" ^ n) ^ ")" (*shouldn't happen*) | L_bin n -> "(num_to_vec " ^ ("0b" ^ n) ^ ")" (*shouldn't happen*) | L_undef -> "failwith \"undef literal not supported\"" (* XXX Undef vectors get handled with to_vec_undef. We could support undef bit but would need to check type. For the moment treat as runtime error. *) |
