Fix literal bytes printing again

This commit is contained in:
Tom Jack 2020-02-15 05:13:34 -06:00
parent 26332f396e
commit 9f09506f58
2 changed files with 6 additions and 1 deletions

View File

@ -166,7 +166,7 @@ let literal ppf (l : literal) =
| Literal_string s ->
fprintf ppf "%S" s
| Literal_bytes b ->
fprintf ppf "0x%s" @@ Bytes.to_string @@ Bytes.escaped b
fprintf ppf "0x%a" Hex.pp (Hex.of_bytes b)
| Literal_address s ->
fprintf ppf "@%S" s
| Literal_operation _ ->

View File

@ -0,0 +1,5 @@
open PP
let%expect_test _ =
Format.printf "%a" literal (Literal_bytes (Bytes.of_string "foo")) ;
[%expect{| 0x666f6f |}]